Exemple #1
0
        public ActionResult Details(int id)
        {
            var model  = DaoRole.GetEntity("ROLE_ID", id);
            var orgall = DaoOrg.FindList();

            model.RoleORG = orgall.FirstOrDefault(obj => obj.ORG_ID == model.ORG_ID);
            return(View(model));
        }
Exemple #2
0
        public ActionResult RoleOrgTree(int?roleid)
        {
            var      orgall = DaoOrg.FindList();
            SYS_ROLE role   = null;

            if (roleid != null)
            {
                role = DaoRole.GetEntity("ROLE_ID", roleid);
            }
            return(Json(GenRoleOrgTree(orgall, role, string.Empty), JsonRequestBehavior.AllowGet));
        }
Exemple #3
0
        public ActionResult Create()
        {
            var selectlist = EnumHelper.GetCategorySelectList(typeof(SYS_ORGANIZE.ORG_LEVEL_ENUM));

            if (Request["orglev"] != null && selectlist != null)
            {
                selectlist.FirstOrDefault(obj => obj.Value == Request["orglev"]).Selected = true;
            }
            ViewBag.ORG_LEVELLIST = selectlist;
            TempData["ORGALL"]    = DaoOrg.FindList();
            return(View());
        }
Exemple #4
0
 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));
     }
 }
Exemple #5
0
 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));
     }
 }
Exemple #6
0
        public ActionResult Index(string rolenam, string orgid, string orgnam, int pageIndex = 1, int pageSize = 20)
        {
            ViewBag.ORGID   = orgid;
            ViewBag.ORGNAM  = orgnam;
            ViewBag.ROLENAM = rolenam;

            var orgall      = DaoOrg.FindList();
            var organdchild = new SYS_HALL_DAL().GetOrgAndChild(orgid);

            if (organdchild != null && organdchild.Count == 0)
            {
                organdchild = null;
            }

            Page <SYS_ROLE> data = dao.GetList(pageIndex, pageSize, "", "ROLE_NAM like", rolenam, "ORG_ID in", organdchild);

            foreach (var role in data.Items)
            {
                role.RoleORG = orgall.FirstOrDefault(obj => obj.ORG_ID == role.ORG_ID);
            }
            return(View(data));
        }
Exemple #7
0
 public ActionResult Create()
 {
     TempData["ORGALL"] = DaoOrg.FindList();
     return(View());
 }