public BusinessServiceTypeVo update(BusinessServiceTypeVo input, int?businessServiceTypeId = null) { using (var db = new MainDb()) { if (businessServiceTypeId == null) { businessServiceTypeId = input.businessServiceTypeId; } var res = db.businessServiceTypes.FirstOrDefault(e => e.businessServiceTypeId == businessServiceTypeId); 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(int id, BusinessServiceTypeVo input) { if (this.ModelState.IsValid) { var res = businessServiceTypeManager.update(input, id); return(RedirectToAction("Index")); } return(View(input)); }
public BusinessServiceTypeVo insert(BusinessServiceTypeVo input) { using (var db = new MainDb()) { db.businessServiceTypes.Add(input); db.SaveChanges(); return(input); } }
public ActionResult Create(BusinessServiceTypeVo input) { if (this.ModelState.IsValid) { var item = businessServiceTypeManager.insert(input); return(RedirectToAction("Index")); } return(View(input)); }
public ActionResult Create() { var vo = new BusinessServiceTypeVo(); return(View(vo)); }