Ejemplo n.º 1
0
        private SYS_HALL GetEdtDT(string id)
        {
            var hall = dao.GetEntity("HALL_NO", id);

            hall.HALLORG = DaoOrganize.GetEntity("ORG_ID", hall.ORG_ID);
            return(hall);
        }
Ejemplo n.º 2
0
        public ActionResult Details(string id, string orgid)
        {
            try
            {
                SYS_HALL info = new SYS_HALL();
                if (!string.IsNullOrEmpty(id))
                {
                    info = GetEdtDT(id);
                }
                if (!string.IsNullOrEmpty(orgid))
                {
                    info = dao.GetEntity("ORG_ID", orgid);
                }

                if (null != info)
                {
                    info.HALLORG = DaoOrganize.GetEntity("ORG_ID", info.ORG_ID);
                }
                return(View(info));
            }
            catch (Exception ex)
            {
                LogHelper.ErrorLog("查看信息出错", ex);
                return(Redirect("/Home/Error"));
            }
        }
Ejemplo n.º 3
0
        public ActionResult Create(string orgid)
        {
            var org = DaoOrganize.GetEntity("ORG_ID", orgid);

            ViewBag.ORG = org;
            GetCreateDT();
            return(View());
        }
Ejemplo n.º 4
0
 public ActionResult Create(string orgid)
 {
     if (null != orgid)
     {
         ViewBag.ORG = DaoOrganize.GetEntity("ORG_ID", orgid);
     }
     GetCreateData(null, orgid);
     return(View());
 }
Ejemplo n.º 5
0
 public ActionResult Details(string id)
 {
     try
     {
         var detail = dao.GetEntity("STAFF_ID", id);
         detail.ORG = DaoOrganize.GetEntity("ORG_ID", detail.ORG_ID);
         return(View(detail));
     }
     catch (Exception ex)
     {
         LogHelper.ErrorLog("查看信息出错", ex);
         return(Redirect("/Home/Error"));
     }
 }
Ejemplo n.º 6
0
        public ActionResult Index(string snam, string orgid, string orgnam, int pageIndex = 1, int pageSize = 20)
        {
            ViewBag.SNAM   = snam;
            ViewBag.ORGID  = orgid;
            ViewBag.ORGNAM = orgnam;
            var orgall = new SYS_USER_DAL().GetUserORG(UserState.UserID);

            if (string.IsNullOrEmpty(orgid) && orgall != null)
            {
                orgid = orgall.FirstOrDefault(obj => obj.ORG_LEVEL == 4).ORG_ID;
            }

            ViewBag.UserORG = new SelectList(orgall.Where(obj => obj.ORG_LEVEL == 4)
                                             , "ORG_ID", "ORG_NAM", orgid);

            var orgs = orgall.Select(obj => obj.ORG_ID);

            if (!string.IsNullOrEmpty(orgid))
            {
                orgs = orgs.Where(obj => obj == orgid);
                if (null == orgs || orgs.Count() == 0)
                {
                    orgs = new List <string> {
                        "-1"
                    };
                }
            }
            var halllist = DaoHall.FindList("", "ORG_ID in", orgs);

            var data = dao.GetList(pageIndex, pageSize, "Q_ID desc", "Q_SERIALNAME like", snam, "Q_SYSNO in", null == halllist ? null : halllist.Select(obj => obj.HALL_NO));

            if (data != null && data.Items != null)
            {
                halllist = DaoHall.FindList();
                var orglist = DaoOrganize.FindList();
                foreach (var item in data.Items)
                {
                    item.Hall = halllist.FirstOrDefault(obj => obj.HALL_NO == item.Q_SYSNO);
                    item.Org  = orglist.FirstOrDefault(obj => obj.ORG_ID == item.Hall.ORG_ID);
                }
            }
            return(View(data));
        }
Ejemplo n.º 7
0
        public ActionResult Index(string nam, string orgid, string orgnam, int?stafftype, int pageIndex = 1, int pageSize = 20)
        {
            ViewBag.NAM      = nam;
            ViewBag.ORGID    = orgid;
            ViewBag.ORGNAM   = orgnam;
            ViewBag.STAFFTYP = stafftype;
            var orgall = new SYS_USER_DAL().GetUserORG(UserState.UserID);

            if (string.IsNullOrEmpty(orgid) && orgall != null)
            {
                orgid = orgall.FirstOrDefault(obj => obj.ORG_LEVEL == 4).ORG_ID;
            }
            ViewBag.UserORG = new SelectList(orgall.Where(obj => obj.ORG_LEVEL == 4)
                                             , "ORG_ID", "ORG_NAM", orgid);

            GetCreateDT(orgid);

            var orgs = orgall.Select(obj => obj.ORG_ID);

            if (!string.IsNullOrEmpty(orgid))
            {
                orgs = orgs.Where(obj => obj == orgid);
                if (null == orgs || orgs.Count() == 0)
                {
                    orgs = new List <string> {
                        "-1"
                    };
                }
            }
            var data = dao.GetList(pageIndex, pageSize, "", "STAFF_NAM like", nam
                                   , "ORG_ID in", orgs, "STAFF_TYP", stafftype);
            var orglist = DaoOrganize.FindList();

            foreach (var item in data.Items)
            {
                item.ORG = orglist.FirstOrDefault(obj => obj.ORG_ID == item.ORG_ID);
            }

            return(View(data));
        }