- Timestamp:
- 08/14/24 16:27:55 (6 weeks ago)
- Branches:
- main
- Children:
- ae6c071
- Parents:
- 784b3ad
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
PostgreSqlDotnetCore/Controllers/ProductsController.cs
r784b3ad r2639fab 2 2 using Microsoft.AspNetCore.Mvc; 3 3 using Microsoft.EntityFrameworkCore; 4 using Npgsql; 5 using System.Linq; 4 6 using PostgreSqlDotnetCore.Models; 5 using System.Net; 7 //using System.Net; 8 using System.Threading.Tasks; 9 using PostgreSqlDotnetCore.Data; 6 10 7 11 namespace PostgreSqlDotnetCore.Controllers … … 9 13 public class ProductsController : BaseController 10 14 { 15 11 16 public ProductsController(UserManager<IdentityUser> userManager) : base(userManager) 12 17 { … … 68 73 var model = new ProductsClass 69 74 { 70 dateadded = DateTime.Now // Поставете го датумот на моменталниот датум75 // dateadded = DateTime.Now // Поставете го датумот на моменталниот датум 71 76 }; 72 77 return View(model); 73 78 } 79 80 81 74 82 75 83 // POST: Customer/Create … … 78 86 [HttpPost] 79 87 [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) 81 89 { 82 90 if (ModelState.IsValid) 83 91 { 84 prodClass.dateadded = new DateTime();92 // prodClass.dateadded = new DateTime(); 85 93 prodClass.isactive = true; 86 94 db.ProductObj.Add(prodClass); … … 91 99 return View(prodClass); 92 100 } 101 102 103 104 105 106 107 108 109 110 93 111 94 112 // GET: Customer/Edit/5 … … 117 135 [HttpPost] 118 136 [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) 120 138 { 121 139 if (ModelState.IsValid)
Note:
See TracChangeset
for help on using the changeset viewer.