public ActionResult EditSize(int id = 0) { TblSizeMaster obj = dbContext.TblSizeMasters.Where(x => x.Id == id).FirstOrDefault(); if (obj == null) { return(HttpNotFound()); } ViewBag.SizeList = dbContext.TblSizeMasters.ToList(); return(View("Size", obj)); }
public ActionResult SizeSaveChanges(TblSizeMaster obj) { if (obj.Id > 0) { TblSizeMaster objbrand = dbContext.TblSizeMasters.Where(x => x.Id == obj.Id).FirstOrDefault(); objbrand.Name = obj.Name; } else { dbContext.TblSizeMasters.Add(obj); } //dbContext.TblSizeMasters.Add(obj); dbContext.SaveChanges(); return(RedirectToAction("Size")); }