public ActionResult Edit(string id) { try { ViewBag.ORG_LEVELLIST = EnumHelper.GetCategorySelectList(typeof(SYS_ORGANIZE.ORG_LEVEL_ENUM)); TempData["ORGALL"] = DaoOrg.FindList(); var role = DaoOrg.GetEntity("ORG_ID", id); return(View(role)); } catch (Exception ex) { LogHelper.ErrorLog("修改组织架构出错", ex); return(Json(new { result = false, desc = "系统错误,请重试" }, JsonRequestBehavior.AllowGet)); } }
public ActionResult Details(string id) { try { var orgall = DaoOrg.FindList(); var org = DaoOrg.GetEntity("ORG_ID", id); if (null != org) { org.Par_OrgList = orgall.Where(obj => obj.ORG_ID == org.PAR_ORG_ID).ToList(); } return(View(org)); } catch (Exception ex) { LogHelper.ErrorLog("查看组织架构出错", ex); return(Json(new { Result = false, Text = "系统出错!" + ex.Message }, JsonRequestBehavior.AllowGet)); } }
private void CreateValid(SYS_ORGANIZE org, bool isEdit = false) { if (string.IsNullOrEmpty(org.ORG_ID)) { ModelState.AddModelError("ORG_ID", "组织机构编码不能为空!"); } if (!isEdit && !string.IsNullOrEmpty(org.ORG_ID) && DaoOrg.GetEntity("ORG_ID", org.ORG_ID) != null) { ModelState.AddModelError("ORG_ID", "组织机构编码已经存在!"); } if (string.IsNullOrEmpty(org.ORG_NAM)) { ModelState.AddModelError("ORG_NAM", "组织机构名称不能为空!"); } if (string.IsNullOrEmpty(org.HEAD)) { ModelState.AddModelError("HEAD", "负责人不能为空!"); } if (string.IsNullOrEmpty(org.HEAD_TEL)) { ModelState.AddModelError("HEAD_TEL", "负责人电话不能为空!"); } if (string.IsNullOrEmpty(org.LONGITUDE)) { ModelState.AddModelError("LONGITUDE", "经度不能为空!"); } if (string.IsNullOrEmpty(org.DIMENSION)) { ModelState.AddModelError("DIMENSION", "纬度不能为空!"); } if (string.IsNullOrEmpty(org.DUTY_TEL)) { ModelState.AddModelError("DUTY_TEL", "值班领导手机不能为空!"); } if (org.ORG_LEVEL == 0) { ModelState.AddModelError("ORG_LEVEL", "组织机构级别不能为空!"); } if (org.PAR_ORG_ID == null) { org.PAR_ORG_ID = ""; } }