public ActionResult CreateUpdateForm(ProductTypeMst productTypeMst) { _db.ProductTypeMsts.Add(productTypeMst); _db.SaveChanges(); return(View()); }
public ActionResult CreateUpdateForm(ProductTypeMst PT) { if (PT.pk_prodtypeid == 0) { _db.ProductTypeMsts.Add(PT); _db.SaveChanges(); } else { var productTypeInDB = _db.ProductTypeMsts.FirstOrDefault(a => a.pk_prodtypeid == PT.pk_prodtypeid); productTypeInDB.Description = PT.Description; _db.SaveChanges(); } return(RedirectToAction("ProductTypeList")); }
public ActionResult Create(ProductTypeMst PT) { _db.ProductTypeMsts.Add(PT); _db.SaveChanges(); return(View()); }