Ignore:
Timestamp:
08/14/24 16:27:55 (6 weeks ago)
Author:
ElenaMoskova <elena.moskova99@…>
Branches:
main
Children:
ae6c071
Parents:
784b3ad
Message:

Update with triggers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • PostgreSqlDotnetCore/Controllers/ProductsController.cs

    r784b3ad r2639fab  
    22using Microsoft.AspNetCore.Mvc;
    33using Microsoft.EntityFrameworkCore;
     4using Npgsql;
     5using System.Linq;
    46using PostgreSqlDotnetCore.Models;
    5 using System.Net;
     7//using System.Net;
     8using System.Threading.Tasks;
     9using PostgreSqlDotnetCore.Data;
    610
    711namespace PostgreSqlDotnetCore.Controllers
     
    913    public class ProductsController : BaseController
    1014    {
     15
    1116        public ProductsController(UserManager<IdentityUser> userManager) : base(userManager)
    1217        {
     
    6873            var model = new ProductsClass
    6974            {
    70                 dateadded = DateTime.Now // Поставете го датумот на моменталниот датум
     75              //  dateadded = DateTime.Now // Поставете го датумот на моменталниот датум
    7176            };
    7277            return View(model);
    7378        }
     79
     80
     81
    7482
    7583        // POST: Customer/Create
     
    7886        [HttpPost]
    7987        [ValidateAntiForgeryToken]
    80         public ActionResult Create([Bind(include: "id,name,description,price, is_active, dateadded, category")] ProductsClass prodClass)
     88        public ActionResult Create([Bind(include: "id,name,description,price, is_active, dateadded, category, int available_quantity")] ProductsClass prodClass)
    8189        {
    8290            if (ModelState.IsValid)
    8391            {
    84                 prodClass.dateadded = new DateTime();
     92              //  prodClass.dateadded = new DateTime();
    8593                prodClass.isactive = true;
    8694                db.ProductObj.Add(prodClass);
     
    9199            return View(prodClass);
    92100        }
     101
     102
     103
     104
     105
     106
     107
     108
     109
     110
    93111
    94112        // GET: Customer/Edit/5
     
    117135        [HttpPost]
    118136        [ValidateAntiForgeryToken]
    119         public ActionResult Edit([Bind(include: "id,name,description,price, is_active, dateadded, category")] ProductsClass prodClass)
     137        public ActionResult Edit([Bind(include: "id,name,description,price, is_active, dateadded, category, int available_quantity")] ProductsClass prodClass)
    120138        {
    121139            if (ModelState.IsValid)
Note: See TracChangeset for help on using the changeset viewer.