Esempio n. 1
0
        /// <summary>
        /// 已审核和待审批列表
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1"></param>
        /// <param name="P2"></param>
        /// <param name="UserInfo"></param>
        public void GETYSPHDSPYCGLLIST_PAGE(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            List <Yan_WF_TI> ListData = new Yan_WF_TIB().GetEntities("TaskUserID ='" + UserInfo.User.UserName + "' AND isnull(TaskUserView,'')!='发起表单'").ToList();
            List <string>    intPro   = ListData.Select(d => d.PIID.ToString()).ToList();
            int page = 0;

            int.TryParse(context.Request.QueryString["p"] ?? "1", out page);
            page = page == 0 ? 1 : page;
            if (intPro.Count > 0)
            {
                string tableName   = string.Format(@" SZHL_YCGL ycgl inner join SZHL_YCGL_CAR  car on ycgl.CarID=car.ID inner join  Yan_WF_PI wfpi  on ycgl.intProcessStanceid=wfpi.ID");
                string tableColumn = "ycgl.* ,car.CarBrand,car.CarType,car.CarNum , case when wfpi.isComplete='Y' then '已审批'  WHEN wfpi.IsCanceled='Y' then '已退回' else '正在审批' END StateName ";
                string strWhere    = " ycgl.ComId=" + UserInfo.User.ComId + " And ycgl.intProcessStanceid in (" + intPro.ListTOString(',') + ")";
                if (P1 != "")
                {
                    strWhere += string.Format(" And  ycgl.XCType='{0}'", P1);
                }
                if (P2 != "")
                {
                    strWhere += string.Format(" And  ycgl.Remark like '%{0}%'", P2);
                }

                int total = 0;

                DataTable dt = new SZHL_YCGLB().GetDataPager(tableName, tableColumn, 8, page, " ycgl.CRDate desc", strWhere, ref total);
                msg.Result  = dt;
                msg.Result1 = total;
            }
        }
Esempio n. 2
0
        public void EXPORTYCGL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            int       total = 0;
            DataTable dt    = new SZHL_YCGLB().GetDataPager("SZHL_YCGL yc left join SZHL_YCGL_CAR car on yc.CarID=car.ID", "yc.*,car.CarBrand,car.CarType,car.CarNum ,dbo.fn_PDStatus(yc.intProcessStanceid) AS StateName", 2000, 1, " yc.CRDate desc", "", ref total);

            string     sqlCol = "SYUser|使用人,XCType|行程类别,CarNum|使用车辆,SYRS|用车人数,JSR|驾驶员,Remark|使用说明,StartTime|开始时间,EndTime|结束时间,StartAddress|出发地点,EndAddress|到达地点";
            CommonHelp ch     = new CommonHelp();
            DataTable  dt2    = dt.DelTableCol(sqlCol);

            foreach (DataRow dr in dt2.Rows)
            {
                try
                {
                    dr["使用人"] = new JH_Auth_UserB().GetUserRealName(UserInfo.QYinfo.ComId, dr["使用人"].ToString());
                    if (!string.IsNullOrEmpty(dr["驾驶员"].ToString()))
                    {
                        dr["驾驶员"] = new JH_Auth_UserB().GetUserRealName(UserInfo.QYinfo.ComId, dr["驾驶员"].ToString());
                    }
                }
                catch (Exception)
                {
                }
            }

            msg.ErrorMsg = ch.ExportToExcel("用车记录", dt2);
        }
Esempio n. 3
0
        /// <summary>
        /// 更新归还车辆记录
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1"></param>
        /// <param name="P2"></param>
        /// <param name="UserInfo"></param>
        public void BACKCLJL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            int       ID   = int.Parse(P1);
            SZHL_YCGL ycgl = new SZHL_YCGLB().GetEntity(d => d.ID == ID && d.ComId == UserInfo.User.ComId);

            ycgl.Status   = "0";//0 归还  1正在使用
            ycgl.BackDate = DateTime.Now;
            new SZHL_YCGLB().Update(ycgl);
            msg.Result = ycgl;
        }
Esempio n. 4
0
        /// <summary>
        /// 获取会议人员情况
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1"></param>
        /// <param name="P2"></param>
        /// <param name="UserInfo"></param>
        public void GETRYLIST_PAGE(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            int page = 0;

            int.TryParse(context.Request["p"] ?? "1", out page);
            page = page == 0 ? 1 : page;


            int total = 0;

            DataTable dt = new SZHL_YCGLB().GetDataPager("JH_Auth_TL", "*", 8, page, " CRDate desc", "MSGType='HYGL' and MSGTLYID='" + P1 + "' and MsgISShow='" + P2 + "' and  ComId=" + UserInfo.User.ComId, ref total);

            msg.Result  = dt;
            msg.Result1 = total;
        }
Esempio n. 5
0
        /// <summary>
        /// 查看可用车辆列表(微信端)
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1"></param>
        /// <param name="P2"></param>
        /// <param name="UserInfo"></param>
        public void GETKYCLLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            //var list = new SZHL_HYGL_ROOMB().GetEntities(p => p.Status == "1" && p.IsDel == 0);
            string strwhere = string.Empty;

            if (P1 != "all")
            {
                strwhere = " and isnull(CarBrand,'')!='' ";
            }
            DataTable dt = new SZHL_YCGL_CARB().GetDTByCommand("select * from dbo.SZHL_YCGL_CAR where IsDel=0 and Status='0'  and comid=" + UserInfo.QYinfo.ComId + strwhere);

            dt.Columns.Add("CarTypeName", Type.GetType("System.String"));
            dt.Columns.Add("ZT", Type.GetType("System.String"));
            dt.Columns.Add("ZYSJ", Type.GetType("System.String"));

            foreach (DataRow dr in dt.Rows)
            {
                int rid = Int32.Parse(dr["ID"].ToString());
                int tid = Int32.Parse(dr["CarType"].ToString());

                var st = DateTime.Now;
                var et = DateTime.Now.AddDays(1);

                var jaz = new JH_Auth_ZiDianB().GetEntity(p => p.ID == tid);
                if (jaz != null)
                {
                    dr["CarTypeName"] = jaz.TypeName;
                }

                var list = new SZHL_YCGLB().GetEntities(p => p.ComId == UserInfo.QYinfo.ComId && p.CarID == rid && p.IsDel == 0 && ((st > p.StartTime && st < p.EndTime) || (et > p.StartTime && et < p.EndTime))).OrderBy(p => p.StartTime);

                if (list.Count() == 0)
                {
                    dr["ZT"]   = "0";
                    dr["ZYSJ"] = "";
                }
                else
                {
                    dr["ZT"]   = "1";
                    dr["ZYSJ"] = list.First().StartTime.Value.ToString("yyyy-MM-dd HH:mm") + "~" + list.First().EndTime.Value.ToString("yyyy-MM-dd HH:mm");
                }
            }

            msg.Result = dt;
        }
Esempio n. 6
0
        /// <summary>
        /// 已审核,待审批列表
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1"></param>
        /// <param name="P2"></param>
        /// <param name="UserInfo"></param>

        public void GETYSPYCGLLIST_PAGE(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            #region 已审核
            List <Yan_WF_TI> ListData = new Yan_WF_TIB().GetEntities("TaskUserID ='" + UserInfo.User.UserName + "' AND EndTime IS NOT NULL AND TaskUserView!='发起表单'").ToList();
            List <string>    intPro   = ListData.Select(d => d.PIID.ToString()).ToList();
            int page = 0;
            int.TryParse(P2, out page);
            page = page == 0 ? 1 : page;
            if (intPro.Count > 0)
            {
                string tableName   = string.Format(@" SZHL_YCGL ycgl inner join SZHL_YCGL_CAR  car on ycgl.CarID=car.ID inner join  Yan_WF_PI wfpi  on ycgl.intProcessStanceid=wfpi.ID");
                string tableColumn = "ycgl.* ,car.CarBrand,car.CarType,car.CarNum , case when wfpi.IsCanceled is null then '已审批'  WHEN wfpi.IsCanceled='Y' then '已退回' END StateName ";
                string strWhere    = " ycgl.ComId=" + UserInfo.User.ComId + " And ycgl.intProcessStanceid in (" + intPro.ListTOString(',') + ")";
                if (P1 != "")
                {
                    strWhere += string.Format(" And  ycgl.XCType='{0}'", P1);
                }
                if (P2 != "")
                {
                    strWhere += string.Format(" And  ycgl.Remark like '%{0}%'", P2);
                }

                int total = 0;

                DataTable dt = new SZHL_YCGLB().GetDataPager(tableName, tableColumn, 8, page, " ycgl.CRDate desc", strWhere, ref total);
                msg.Result  = dt;
                msg.Result1 = total;
            }
            #endregion
            #region 待审核
            if (page == 1 && P1 == "" && P2 == "")
            {
                List <string> intProD = new Yan_WF_PIB().GetDSH(UserInfo.User).Select(d => d.PIID.ToString()).ToList();
                if (intProD.Count() > 0)
                {
                    string tableNameD   = string.Format(@" SZHL_YCGL ycgl inner join SZHL_YCGL_CAR  car on ycgl.CarID=car.ID");
                    string tableColumnD = "ycgl.* ,car.CarBrand,car.CarType,car.CarNum , '正在审批' StateName";
                    string strWhereD    = " ycgl.ComId=" + UserInfo.User.ComId + " And ycgl.intProcessStanceid in (" + intProD.ListTOString(',') + ")";
                    string strSql       = string.Format("Select {0}  From {1} where {2} order by ycgl.CRDate desc", tableColumnD, tableNameD, strWhereD);
                    msg.Result2 = new SZHL_YCGLB().GetDTByCommand(strSql);
                }
            }
            #endregion
        }
Esempio n. 7
0
        public void SENDMSG(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            int     Id         = int.Parse(P1);
            var     model      = new SZHL_YCGLB().GetEntity(d => d.ID == Id && d.ComId == UserInfo.User.ComId);
            string  strContent = "发起人:" + new JH_Auth_UserB().GetUserRealName(UserInfo.User.ComId.Value, model.CRUser) + "\r\n驾驶人:" + new JH_Auth_UserB().GetUserRealName(UserInfo.User.ComId.Value, model.JSR) + "\r\n您有新的用车通知,请尽快查看";
            Article ar0        = new Article();

            ar0.Title       = "用车通知";
            ar0.Description = strContent;
            ar0.Url         = model.ID.ToString();
            List <Article> al = new List <Article>();

            al.Add(ar0);
            //new JH_Auth_User_CenterB().SendMsg(UserInfo, "HYGL", strContent, model.ID.ToString(), model.JSR, "B", model.intProcessStanceid);

            WXHelp wx = new WXHelp(UserInfo.QYinfo);

            wx.SendTH(al, "YCGL", "A", model.JSR);
        }
Esempio n. 8
0
        /// <summary>
        /// 获取用车信息
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1"></param>
        /// <param name="P2"></param>
        /// <param name="UserInfo"></param>
        public void GETYCGLMODEL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            int Id    = int.Parse(P1);
            var model = new SZHL_YCGLB().GetEntity(d => d.ID == Id && d.ComId == UserInfo.User.ComId);

            if (model != null)
            {
                msg.Result = model;
                if (!string.IsNullOrEmpty(model.Files))
                {
                    msg.Result1 = new FT_FileB().GetEntities(" ID in (" + model.Files + ")");
                }
                if (model.CarID != null)
                {
                    msg.Result2 = new SZHL_YCGL_CARB().GetEntity(p => p.ID == model.CarID);
                }

                new JH_Auth_User_CenterB().ReadMsg(UserInfo, model.ID, "YCGL");
            }
        }
Esempio n. 9
0
        /// <summary>
        /// 获取车辆信息
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1"></param>
        /// <param name="P2"></param>
        /// <param name="UserInfo"></param>
        public void GETCLINFO(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            int Id  = int.Parse(P1);
            var car = new SZHL_YCGL_CARB().GetEntity(d => d.ID == Id && d.ComId == UserInfo.User.ComId);

            msg.Result = car;
            //string strSql = string.Format("SELECT  ycgl.*  from SZHL_YCGL  ycgl inner join SZHL_YCGL_CAR car on ycgl.CarID=car.ID inner join  Yan_WF_PI wfpi on ycgl.intProcessStanceid=wfpi.ID where  wfpi.isComplete='Y' and ycgl.ComId={0} and ycgl.CarID={1}", UserInfo.User.ComId, Id);
            //msg.Result1 = new SZHL_YCGL_CARB().GetDTByCommand(strSql);
            int tid = Int32.Parse(car.CarType);

            msg.Result3 = new JH_Auth_ZiDianB().GetEntity(p => p.ID == tid);
            #region 微信端
            var st = DateTime.Now;

            var list = new SZHL_YCGLB().GetEntities(p => p.CarID == Id && p.IsDel == 0 && st < p.EndTime).OrderBy(p => p.StartTime);

            List <int> li = new List <int>();

            foreach (var l in list)
            {
                var pi = new Yan_WF_PIB().GetEntity(p => p.ID == l.intProcessStanceid);
                if (pi != null && pi.IsCanceled == "Y")
                {
                    li.Add(l.ID);
                }
            }

            var list1 = list.Where(p => !li.Contains(p.ID));

            msg.Result2 = list1;
            #endregion
            if (!string.IsNullOrEmpty(car.Files))
            {
                msg.Result4 = new FT_FileB().GetEntities(" ID in (" + car.Files + ")");
            }
        }