コード例 #1
0
        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));
        }
コード例 #2
0
 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"));
 }