public ActionResult New(string id) { var mdoel = new DictIndexViewModel { ParentID = id, }; return(View(mdoel)); }
public ActionResult Edit(DictIndexViewModel model) { if (!ModelState.IsValid) { return(View(model)); } var result = _dictIndexService.Update(model); return(RedirectToAction("Index", "Result", new { state = result, style = "dialog" })); }
public bool Add(DictIndexViewModel model) { model.Id = Guid.NewGuid().ToString(); DictIndex entity = new DictIndex(); uow.Set <DictIndex>().Add(entity); entity.Id = model.Id; entity.Name = model.Name; entity.No = model.No; entity.Parent = uow.Set <DictIndex>().Find(model.ParentID); uow.Commit(); return(true); }
public bool Update(DictIndexViewModel model) { var entity = uow.Set <DictIndex>().Find(model.Id); if (entity == null) { return(false); } entity.Name = model.Name; entity.No = model.No; entity.Parent = uow.Set <DictIndex>().Find(model.ParentID); uow.Commit(); return(true); }
public ActionResult Delete(DictIndexViewModel model) { var result = _dictIndexService.Delete(model.Id); return(RedirectToAction("Index", "Result", new { state = result, style = "dialog" })); }