public BusinessServiceLookupVo update(BusinessServiceLookupVo input, Guid?businessServiceLookupId = null) { using (var db = new MainDb()) { if (businessServiceLookupId == null) { businessServiceLookupId = input.businessServiceLookupId; } var res = db.businessServiceLookups.FirstOrDefault(e => e.businessServiceLookupId == businessServiceLookupId); if (res == null) { return(null); } input.created = res.created; // input.createdBy = res.createdBy; db.Entry(res).CurrentValues.SetValues(input); db.SaveChanges(); return(res); } }
public ActionResult Edit(Guid id, BusinessServiceLookupVo input) { if (this.ModelState.IsValid) { var res = businessServiceLookupManager.update(input, id); return(RedirectToAction("Index")); } return(View(input)); }
public BusinessServiceLookupVo insert(BusinessServiceLookupVo input) { using (var db = new MainDb()) { db.businessServiceLookups.Add(input); db.SaveChanges(); return(input); } }
public ActionResult Create(BusinessServiceLookupVo input) { if (this.ModelState.IsValid) { var item = businessServiceLookupManager.insert(input); return(RedirectToAction("Index")); } return(View(input)); }
public ActionResult Create() { var vo = new BusinessServiceLookupVo(); return(View(vo)); }