public GroupingVendorViewModel Edit(string groupId, GroupingVendorViewModel model) { var dc = new eprocdbDataContext(); var md = (from c in dc.Master_Groups where c.GroupID == groupId select c).SingleOrDefault(); md.Description = model.Description; dc.SubmitChanges(); return(model); }
public GroupingVendorViewModel Add(GroupingVendorViewModel model) { var dc = new eprocdbDataContext(); VENDOR_GROUP obj = new VENDOR_GROUP(); obj.Group_VendorID = model.GroupVendorId; obj.Group_VendorName = model.Description; dc.VENDOR_GROUPs.InsertOnSubmit(obj); dc.SubmitChanges(); return(model); }
public ActionResult Edit(string groupId, GroupingVendorViewModel model) { try { IGroupVendorService svc = new GroupVendorService(); var result = svc.Edit(groupId, model); return(RedirectToAction("Index")); } catch (Exception ex) { general.AddLogError("GroupVendor Edit", ex.Message, ex.StackTrace); return(View("~/Views/Master/GroupVendor/Index.cshtml")); } }
public ActionResult Add(GroupingVendorViewModel model) { try { IGroupVendorService svc = new GroupVendorService(); var result = svc.Add(model); this.AddNotification("Your Data Has Been Successfully Saved. ", NotificationType.SUCCESS); return(RedirectToAction("Index")); } catch (Exception ex) { general.AddLogError("GroupVendor Add", ex.Message, ex.StackTrace); this.AddNotification("ID exist", NotificationType.ERROR); return(View("~/Views/Master/GroupVendor/Add.cshtml")); } }