public ActionResult DeleteDetails(string id) { IOrgDao orgDao = _factory.CreateOrgDao(); Org org = orgDao.Get(id); return(View(org)); }
public ActionResult Edit(string id) { IOrgDao orgDao = _factory.CreateOrgDao(); Org org = orgDao.Get(id); ViewData["ParentOrg"] = org.Parent; return(View(new OrgModel(org))); }
public ActionResult Delete(string id, string parentId) { IOrgDao orgDao = _factory.CreateOrgDao(); Org org = orgDao.Get(id); orgDao.Delete(org); return(RedirectToAction("Index", new { id = parentId })); }
public ActionResult Details(string id) { IOrgDao orgDao = _factory.CreateOrgDao(); Org org = orgDao.Get(id); IList <User> users = _factory.CreateUserDao().GetUsers(org); ViewData["ParentOrg"] = org.Parent; return(View(new OrgDetailsModel(org, users))); }
/// <summary> /// </summary> /// <param name="dao"></param> /// <exception cref="ArgumentNullException">dao is null.</exception> public void Save(IOrgDao dao) { if (dao == null) { throw new ArgumentNullException("dao"); } Org ug = !String.IsNullOrEmpty(Id) ? dao.Get(Id) : new Org(Name); ug.Name = Name; ug.Remarks = Remark; dao.SaveOrUpdate(ug); dao.Flush(); if (Parent != null) { IOrgCollection list = Parent.Childs; list.Add(ug); dao.SaveOrUpdate(Parent); } }
/// <summary> /// </summary> /// <param name="dao"></param> /// <exception cref="ArgumentNullException">dao is null.</exception> public void Save(IOrgDao dao) { if (dao == null) throw new ArgumentNullException("dao"); Org ug = !String.IsNullOrEmpty(Id) ? dao.Get(Id) : new Org(Name); ug.Name = Name; ug.Remarks = Remark; dao.SaveOrUpdate(ug); dao.Flush(); if (Parent != null) { IOrgCollection list = Parent.Childs; list.Add(ug); dao.SaveOrUpdate(Parent); } }