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