Exemplo n.º 1
0
        /// <summary>
        /// 获取报表标题,如“江西省地方税务局排队叫号分析(2014年11月23日 - 2014年11月29日)”
        /// </summary>
        /// <param name="orgid"></param>
        /// <param name="beginTime"></param>
        /// <param name="endTime"></param>
        /// <returns></returns>
        protected string GetStatTitle(string orgid, DateTime?beginTime, DateTime?endTime)
        {
            var    orgall     = new SYS_USER_DAL().GetUserORG(UserState.UserID);
            string _statTitle = "";

            if (!string.IsNullOrEmpty(orgid))
            {
                var d = orgall.FirstOrDefault(o => o.ORG_ID == orgid);
                if (null != d)
                {
                    _statTitle += d.ORG_NAM;
                }
            }
            else
            {
                var d = orgall.OrderBy(o => o.ORG_LEVEL).FirstOrDefault();
                if (null != d)
                {
                    _statTitle += d.ORG_NAM;
                }
            }

            _statTitle += StatNAM;
            if (beginTime != null && endTime != null)
            {
                _statTitle += "<span style='font-size:12px;'>(" + beginTime.Value.ToString("yyyy年MM月dd日");
                _statTitle += " - " + endTime.Value.ToString("yyyy年MM月dd日") + ")</span>";
            }
            return(_statTitle);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取报表标题组织的名称
        /// </summary>
        /// <param name="orgId"></param>
        /// <param name="level"></param>
        /// <returns></returns>
        public string GetOrgName(string orgId, byte?level)
        {
            var orgall    = new SYS_USER_DAL().GetUserORG(UserState.UserID);
            var MainTitle = string.Empty;

            if (!string.IsNullOrEmpty(orgId))
            {
                var obj = orgall.FirstOrDefault((o => o.ORG_ID == orgId));
                if (obj != null)
                {
                    MainTitle = obj.ORG_NAM;
                }
            }
            else
            {
                if (level != null)
                {
                    var obj = orgall.Where(m => m.ORG_LEVEL == level).OrderBy(o => o.ORG_LEVEL).FirstOrDefault();
                    if (obj != null)
                    {
                        MainTitle = obj.ORG_NAM;
                    }
                }
                else
                {
                    var obj = orgall.OrderBy(o => o.ORG_LEVEL).FirstOrDefault();
                    if (obj != null)
                    {
                        MainTitle = obj.ORG_NAM;
                    }
                }
            }

            return(MainTitle);
        }
Exemplo n.º 3
0
        public ActionResult ParamSendUsr(string hallno, byte id, WARN_PARAM_SEND_USER_CON model)
        {
            if (!ModelState.IsValid)
            {
                Alter("提交失败!", AlterTypeEnum.Error, false, false);
                return(View());
            }
            var USER_ID = Request.Form["USER_ID"];
            List <WARN_PARAM_SEND_USER_CON> models = new List <WARN_PARAM_SEND_USER_CON>();

            if (!string.IsNullOrEmpty(USER_ID))
            {
                var ARR_USER_ID = USER_ID.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                var hall        = DaoHall.GetEntity("HALL_NO", hallno);
                if (null != hall)
                {
                    var USERLIST = new SYS_USER_DAL().GetORGUser(hall.ORG_ID);
                    foreach (var _USERID in ARR_USER_ID)
                    {
                        model.WARN_LEVEL = 1;
                        model.USER_ID    = _USERID;
                        model.MOB_NBR    = USERLIST.FirstOrDefault(obj => obj.USER_ID == _USERID).TEL;
                        models.Add(model);

                        var model2 = CommonHelper.DeepClone(model);
                        model2.WARN_LEVEL = 2;
                        model.USER_ID     = _USERID;
                        model.MOB_NBR     = USERLIST.FirstOrDefault(obj => obj.USER_ID == _USERID).TEL;
                        models.Add(model2);

                        var model3 = CommonHelper.DeepClone(model);
                        model3.WARN_LEVEL = 3;
                        model.USER_ID     = _USERID;
                        model.MOB_NBR     = USERLIST.FirstOrDefault(obj => obj.USER_ID == _USERID).TEL;
                        models.Add(model3);
                    }
                }
            }
            new WARN_PARAM_DAL().AddParamUserList(hallno, id, models);
            Alter("提交成功!", AlterTypeEnum.Error, true, true);
            return(RedirectToAction("ParamSendUsr", new { hallno = hallno, id = id }));
        }
Exemplo n.º 4
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));
        }
Exemplo n.º 5
0
        private string GetSubTitle(string orgid, DateTime?beginTime, DateTime?endTime)
        {
            var    orgall   = new SYS_USER_DAL().GetUserORG(UserState.UserID);
            string subTitle = "";

            if (!string.IsNullOrEmpty(orgid))
            {
                subTitle += orgall.FirstOrDefault((o => o.ORG_ID == orgid)).ORG_NAM;
            }
            else
            {
                subTitle += orgall.OrderBy(o => o.ORG_LEVEL).FirstOrDefault().ORG_NAM;
            }
            subTitle += "人流量对比分析";
            if (beginTime != null && endTime != null)
            {
                subTitle += "<span style='font-size:12px;'>(" + beginTime.Value.ToString("yyyy年MM月dd日");
                subTitle += " - " + endTime.Value.ToString("yyyy年MM月dd日") + ")</span>";
            }
            return(subTitle);
        }
Exemplo n.º 6
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));
        }