/// <summary> /// 部门数据 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETCCXJLIST_PAGE(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string strWhere = " cc.ComId=" + UserInfo.User.ComId; if (P1 != "") { strWhere += string.Format(" And cc.LeiBie={0}", P1); } if (P2 != "") { strWhere += string.Format(" And cc.ZhuYaoShiYou like '%{0}%'", P2); } int page = 0; int.TryParse(context.Request["p"] ?? "1", out page); page = page == 0 ? 1 : page; int total = 0; string colNme = @"cc.ShenQingRen,cc.LeiBie,cc.StarTime,cc.EndTime,cc.Daycount,cc.ZhuYaoShiYou,cc.ID,cc.BranchName,zd.TypeName , case WHEN wfpi.isComplete is null and wfpi.IsCanceled is null THEN '正在审批' when wfpi.isComplete='Y' then '已审批' WHEN wfpi.IsCanceled='Y' then '已退回' END StateName,intProcessStanceid"; DataTable dt = new SZHL_CCXJB().GetDataPager("SZHL_CCXJ cc inner join JH_Auth_ZiDian zd on cc.LeiBie=zd.ID inner join Yan_WF_PI wfpi on cc.intProcessStanceid=wfpi.ID", colNme, 8, page, " cc.CRDate desc", strWhere, ref total); msg.Result = dt; msg.Result1 = total; }
/// <summary> /// 部门数据 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETTSGLLIST_PAGE(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string strWhere = " jygl.ComId=" + UserInfo.User.ComId; if (P1 != "") { strWhere += string.Format(" And jygl.XCType='{0}'", P1); } if (P2 != "") { strWhere += string.Format(" And jygl.Remark like '%{0}%'", P2); } int page = 0; int.TryParse(context.Request["p"] ?? "1", out page); page = page == 0 ? 1 : page; int total = 0; string colNme = @"jygl.*,ts.tsBrand,ts.tsType,ts.tsNum , case WHEN wfpi.isComplete is null and wfpi.IsCanceled is null THEN '正在审批' when wfpi.isComplete='Y' then '已审批' WHEN wfpi.IsCanceled='Y' then '已退回' END StateName"; DataTable dt = new SZHL_CCXJB().GetDataPager("SZHL_TSGL jygl left outer join SZHL_TSGL_TS ts on jygl.tsID=ts.ID inner join Yan_WF_PI wfpi on jygl.intProcessStanceid=wfpi.ID", colNme, 8, page, " ycgl.CRDate desc", strWhere, ref total); msg.Result = dt; msg.Result1 = total; }
/// <summary> /// 福利列表 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETFLLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string userName = UserInfo.User.UserName; string strWhere = " 1=1 and ComId=" + UserInfo.User.ComId; int page = 0; int pagecount = 8; int.TryParse(context.Request["p"] ?? "1", out page); int.TryParse(context.Request["pagecount"] ?? "8", out pagecount);//页数 page = page == 0 ? 1 : page; int total = 0; DataTable dt = new DataTable(); dt = new SZHL_CCXJB().GetDataPager("SZHL_GZGL_FL", " * ", pagecount, page, " CRDate ", strWhere, ref total); if (dt.Rows.Count > 0) { dt.Columns.Add("FileList", Type.GetType("System.Object")); foreach (DataRow dr in dt.Rows) { if (dr["Files"] != null && dr["Files"].ToString() != "") { dr["FileList"] = new FT_FileB().GetEntities(" ID in (" + dr["Files"].ToString() + ")"); } } } msg.Result = dt; msg.Result1 = total; }
/// <summary> /// 查看会议室列表 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETHYSLIST_PAGE(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string strWhere = " cc.ComId=" + UserInfo.User.ComId; //strWhere += string.Format(" And cc.CRUser='******' ", UserInfo.User.UserName); if (P1 != "") { strWhere += string.Format(" And cc.Name like '%{0}%'", P1); } if (P2 != "") { strWhere += string.Format(" And cc.IsDMT ='{0}'", P2); } string TYY = context.Request["lb"] ?? ""; if (TYY != "") { strWhere += string.Format(" And cc.IsTYY ='{0}'", TYY); } int page = 0; int pagecount = 8; int.TryParse(context.Request["p"] ?? "1", out page); int.TryParse(context.Request["pagecount"] ?? "8", out pagecount);//页数 page = page == 0 ? 1 : page; int total = 0; DataTable dt = new SZHL_CCXJB().GetDataPager(" SZHL_HYGL_ROOM cc", "cc.*", pagecount, page, " cc.CRDate desc", strWhere, ref total); 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()); var st = DateTime.Now; var et = DateTime.Now.AddHours(3); var list = new SZHL_HYGLB().GetEntities(p => p.RoomID == 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; msg.Result1 = total; }
/// <summary> /// 请假列表 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETCCXJUSERLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string userName = UserInfo.User.UserName; string strWhere = " 1=1 and cc.ComId=" + UserInfo.User.ComId; string strUserName = context.Request["username"] ?? "";//经费报销统计中的查看列表需要的参数 if (!string.IsNullOrEmpty(strUserName)) { userName = strUserName; } strWhere += " And cc.CRUser ='******'"; if (P1 != "") { strWhere += string.Format(" And cc.LeiBie='{0}' ", P1); } string strContent = context.Request["Content"] ?? ""; if (strContent != "") { strWhere += string.Format(" And ( cc.ZhuYaoShiYou like '%{0}%' )", strContent); } int month = 0; int.TryParse(context.Request["month"] ?? "1", out month); if (month == 0) { month = DateTime.Now.Month; } string strTime = new DateTime(DateTime.Now.Year, month, 1).ToShortDateString(); string endTime = new DateTime(DateTime.Now.Year, month, 1).AddMonths(1).ToShortDateString(); strWhere += string.Format("And cc.CRDate BETWEEN '{0}' and '{1}'", strTime, endTime); //已审核的经费报销 //var intProD = new Yan_WF_PIB().GetYSHUserPI(userName, UserInfo.User.ComId.Value, "CCXJ").Select(d => d.ID.ToString()).ToList(); //if (intProD.Count > 0) //{ // strWhere += " And intProcessStanceid in (" + (intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(',')) + ")"; //} //else //{ // strWhere += " And 1=0"; //} string strSql = string.Format("select cc.*,zd.TypeName from SZHL_CCXJ cc left join JH_Auth_ZiDian zd on cc.LeiBie=zd.ID where {0} and (dbo.fn_PDStatus(cc.intProcessStanceid)='-1' or dbo.fn_PDStatus(cc.intProcessStanceid)='已审批') order by cc.CRDate desc", strWhere); DataTable dt = new SZHL_CCXJB().GetDTByCommand(strSql); msg.Result = dt; }
/// <summary> /// 请假天数统计 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETCCXJTJ(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int page = 0; int pagecount = 8; int.TryParse(context.Request["p"] ?? "1", out page); int.TryParse(context.Request["pagecount"] ?? "8", out pagecount);//页数 page = page == 0 ? 1 : page; int total = 0; string starDate = (P1 == "" ? DateTime.Now.Year.ToString() : P1) + "-"; string EndDate = ""; if (P2 == "0" || P2 == "") { starDate = starDate + "01" + "-01"; EndDate = (P1 == "" ? DateTime.Now.Year.ToString() : P1) + "-12" + "-31"; } else { starDate = starDate + P2 + "-01"; EndDate = DateTime.Parse(starDate).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd"); } string searchContent = context.Request["search"] ?? ""; string strWhere = ""; if (!string.IsNullOrEmpty(searchContent)) { strWhere = string.Format(" And cc.ShenQingRen like '%{0}%'", searchContent); } string strSql = string.Format(@"SELECT cc.ShenQingRen,cc.BranchName,sum(cc.Daycount) daycount,zd.TypeName,DATEPART(MONTH,cc.CRDate) ccMonth,cc.CRUser,cc.LeiBie from SZHL_CCXJ cc inner join JH_Auth_ZiDian zd on cc.LeiBie=zd.ID where (dbo.fn_PDStatus(cc.intProcessStanceid)='-1' or dbo.fn_PDStatus(cc.intProcessStanceid)='已审批') And cc.ComId={0} and cc.CRDate BETWEEN '{1}' and '{2}' " + strWhere + @" GROUP by cc.ShenQingRen,zd.TypeName,cc.LeiBie,cc.BranchName,cc.CRUser,DATEPART(MONTH,cc.CRDate)", UserInfo.User.ComId, starDate + " 00:00:00", EndDate + " 23:59:59"); DataTable dt = new SZHL_CCXJB().GetDataPager("(" + strSql + ") as newcc", "*", pagecount, page, "BranchName,ShenQingRen,ccMonth,TypeName,CRUser", "1=1", ref total); msg.Result = dt; msg.Result1 = total; }
/// <summary> /// 获取出差请假信息 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETCCXJMODEL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int Id = int.Parse(P1); SZHL_CCXJ ccxj = new SZHL_CCXJB().GetEntity(d => d.ID == Id); msg.Result = ccxj; if (ccxj != null) { int id = Int32.Parse(ccxj.LeiBie); var zd = new JH_Auth_ZiDianB().GetEntity(p => p.ID == id); msg.Result1 = zd.TypeName; if (!string.IsNullOrEmpty(ccxj.Files)) { msg.Result2 = new FT_FileB().GetEntities(" ID in (" + ccxj.Files + ")"); } if (ccxj.intProcessStanceid != 0) { msg.Result3 = new JH_Auth_User_CenterB().GetDTByCommand("select dbo.fn_PDStatus(" + ccxj.intProcessStanceid + ") AS StateName"); } new JH_Auth_User_CenterB().ReadMsg(UserInfo, ccxj.ID, "CCXJ"); } }
/// <summary> /// 请假列表 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETCCXJLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string userName = UserInfo.User.UserName; string strWhere = " 1=1 and cc.ComId=" + UserInfo.User.ComId; string leibie = context.Request["lb"] ?? ""; if (leibie != "") { strWhere += string.Format(" And cc.LeiBie='{0}' ", leibie); } string strContent = context.Request["Content"] ?? ""; strContent = strContent.TrimEnd(); if (strContent != "") { strWhere += string.Format(" And ( cc.ZhuYaoShiYou like '%{0}%' )", strContent); } int DataID = -1; int.TryParse(context.Request["ID"] ?? "-1", out DataID);//记录Id if (DataID != -1) { string strIsHasDataQX = new JH_Auth_QY_ModelB().ISHASDATAREADQX("CCXJ", DataID, UserInfo); if (strIsHasDataQX == "Y") { strWhere += string.Format(" And cc.ID = '{0}'", DataID); } } if (P1 != "") { int page = 0; int pagecount = 8; int.TryParse(context.Request["p"] ?? "1", out page); int.TryParse(context.Request["pagecount"] ?? "8", out pagecount);//页数 page = page == 0 ? 1 : page; int total = 0; DataTable dt = new DataTable(); switch (P1) { case "0": //手机单条数据 { //设置usercenter已读 new JH_Auth_User_CenterB().ReadMsg(UserInfo, DataID, "CCXJ"); } break; case "1": //创建的 { strWhere += " And cc.CRUser ='******'"; } break; case "2": //待审核 { var intProD = new Yan_WF_PIB().GetDSH(UserInfo.User).Select(d => d.PIID.ToString()).ToList(); if (intProD.Count > 0) { strWhere += " And cc.intProcessStanceid in (" + (intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(',')) + ")"; } else { strWhere += " And 1=0"; } } break; case "3": //已审核 { var intProD = new Yan_WF_PIB().GetYSH(UserInfo.User).Select(d => d.PIID.ToString()).ToList(); if (intProD.Count > 0) { strWhere += " And cc.intProcessStanceid in (" + (intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(',')) + ")"; } else { strWhere += " And 1=0"; } } break; } dt = new SZHL_CCXJB().GetDataPager("SZHL_CCXJ cc left join JH_Auth_ZiDian zd on cc.LeiBie=zd.ID", "cc.*,zd.TypeName ,dbo.fn_PDStatus(cc.intProcessStanceid) AS StateName", pagecount, page, " cc.CRDate desc", strWhere, ref total); if (dt.Rows.Count > 0) { dt.Columns.Add("FileList", Type.GetType("System.Object")); foreach (DataRow dr in dt.Rows) { if (dr["Files"] != null && dr["Files"].ToString() != "") { dr["FileList"] = new FT_FileB().GetEntities(" ID in (" + dr["Files"].ToString() + ")"); } } } msg.Result = dt; msg.Result1 = total; } }
/// <summary> /// 用车列表 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETYCGLLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string userName = UserInfo.User.UserName; string strWhere = " 1=1 and yc.ComId=" + UserInfo.User.ComId; string leibie = context.Request["lb"] ?? ""; if (leibie != "") { strWhere += string.Format(" And yc.CarID='{0}' ", leibie); } string strContent = context.Request["Content"] ?? ""; strContent = strContent.TrimEnd(); if (strContent != "") { strWhere += string.Format(" And ( yc.Remark like '%{0}%' or yc.StartAddress like '%{0}%' or yc.EndAddress like '%{0}%')", strContent); } int DataID = -1; int.TryParse(context.Request["ID"] ?? "-1", out DataID);//记录Id if (DataID != -1) { string strIsHasDataQX = new JH_Auth_QY_ModelB().ISHASDATAREADQX("YCGL", DataID, UserInfo); if (strIsHasDataQX == "Y") { strWhere += string.Format(" And yc.ID = '{0}'", DataID); } } if (P1 != "") { int page = 0; int pagecount = 8; int.TryParse(context.Request["p"] ?? "1", out page); int.TryParse(context.Request["pagecount"] ?? "8", out pagecount);//页数 page = page == 0 ? 1 : page; int total = 0; DataTable dt = new DataTable(); #region no use // switch (P1) // { // case "0": // string colNme1 = @"ycgl.*,car.CarBrand,car.CarType,car.CarNum , case WHEN wfpi.isComplete is null and wfpi.IsCanceled is null THEN '正在审批' // when wfpi.isComplete='Y' then '已审批' WHEN wfpi.IsCanceled='Y' then '已退回' END StateName"; // //strWhere += " And cc.CRUser ='******'"; // dt = new SZHL_CCXJB().GetDataPager("SZHL_YCGL ycgl left outer join SZHL_YCGL_CAR car on ycgl.CarID=car.ID inner join Yan_WF_PI wfpi on ycgl.intProcessStanceid=wfpi.ID", colNme1, 8, page, " ycgl.CRDate desc", strWhere, ref total); // break; // case "1": // string colNme = @"ycgl.*,car.CarBrand,car.CarType,car.CarNum , case WHEN wfpi.isComplete is null and wfpi.IsCanceled is null THEN '正在审批' // when wfpi.isComplete='Y' then '已审批' WHEN wfpi.IsCanceled='Y' then '已退回' END StateName"; // strWhere += " And ycgl.CRUser ='******'"; // dt = new SZHL_CCXJB().GetDataPager("SZHL_YCGL ycgl left outer join SZHL_YCGL_CAR car on ycgl.CarID=car.ID inner join Yan_WF_PI wfpi on ycgl.intProcessStanceid=wfpi.ID", colNme, 8, page, " ycgl.CRDate desc", strWhere, ref total); // break; // case "2": // 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 left outer join SZHL_YCGL_CAR car on ycgl.CarID=car.ID"); // string tableColumnD = "ycgl.* ,car.CarBrand,car.CarType,car.CarNum , '正在审批' StateName"; // strWhere += " And ycgl.intProcessStanceid in (" + (intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(',')) + ")"; // //string strSql = string.Format("Select {0} From {1} where {2} order by cc.CRDate desc", tableColumnD, tableNameD, strWhere); // dt = new SZHL_CCXJB().GetDataPager(tableNameD, tableColumnD, 8, page, " ycgl.CRDate desc", strWhere, ref total); // } // break; // case "3": // 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(); // string tableName = string.Format(@" SZHL_YCGL ycgl left outer 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 "; // strWhere += " And ycgl.intProcessStanceid in (" + (intPro.ListTOString(',') == "" ? "0" : intPro.ListTOString(',')) + ")"; // dt = new SZHL_CCXJB().GetDataPager(tableName, tableColumn, 8, page, " ycgl.CRDate desc", strWhere, ref total); // break; // } #endregion switch (P1) { case "0": //手机单条数据 { //设置usercenter已读 new JH_Auth_User_CenterB().ReadMsg(UserInfo, DataID, "YCGL"); } break; case "1": //创建的 { strWhere += " And yc.CRUser ='******'"; } break; case "2": //待审核 { var intProD = new Yan_WF_PIB().GetDSH(UserInfo.User).Select(d => d.PIID.ToString()).ToList(); if (intProD.Count > 0) { strWhere += " And yc.intProcessStanceid in (" + (intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(',')) + ")"; } else { strWhere += " And 1=0"; } } break; case "3": //已审核 { var intProD = new Yan_WF_PIB().GetYSH(UserInfo.User).Select(d => d.PIID.ToString()).ToList(); if (intProD.Count > 0) { strWhere += " And yc.intProcessStanceid in (" + (intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(',')) + ")"; } else { strWhere += " And 1=0"; } } break; } dt = new SZHL_CCXJB().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", pagecount, page, " yc.CRDate desc", strWhere, ref total); if (dt.Rows.Count > 0) { dt.Columns.Add("FileList", Type.GetType("System.Object")); foreach (DataRow dr in dt.Rows) { if (dr["Files"] != null && dr["Files"].ToString() != "") { dr["FileList"] = new FT_FileB().GetEntities(" ID in (" + dr["Files"].ToString() + ")"); } } } msg.Result = dt; msg.Result1 = total; } }
/// <summary> /// 获取提醒事项列表 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETTXSXLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string userName = UserInfo.User.UserName; string strWhere = " 1=1 and ComId=" + UserInfo.User.ComId; string type = context.Request["lb"] ?? "1"; if (type == "1") { strWhere += string.Format(" And CRUser='******'", userName); } else if (type == "2") { strWhere += string.Format(" And ','+TXUser+',' like '%,{0},%'", userName); } if (P1 == "2") { strWhere += string.Format(" and Status='1' "); } else if (P1 == "1") { strWhere += string.Format(" and Status='0' "); } string strContent = context.Request["Content"] ?? ""; strContent = strContent.TrimEnd(); if (strContent != "") { //strWhere += string.Format(" And ( TXContent like '%{0}%' or TXUser like '%{0}%' )", strContent); strWhere += string.Format(" And ( TXContent like '%{0}%')", strContent); } int DataID = -1; int.TryParse(context.Request["ID"] ?? "-1", out DataID);//记录Id if (DataID != -1) { string strIsHasDataQX = new JH_Auth_QY_ModelB().ISHASDATAREADQX("TXSX", DataID, UserInfo); if (strIsHasDataQX == "Y") { strWhere += string.Format(" And ID = '{0}'", DataID); } } int page = 0; int pagecount = 8; int.TryParse(context.Request["p"] ?? "1", out page); int.TryParse(context.Request["pagecount"] ?? "8", out pagecount);//页数 page = page == 0 ? 1 : page; int total = 0; DataTable dt = new DataTable(); if (P2 == "-1" || P2 == "") { strWhere += " and type in ('0','1','2')"; } else { strWhere += " and type ='" + P2 + "'"; } dt = new SZHL_CCXJB().GetDataPager("SZHL_TXSX", "*", pagecount, page, " CRDate desc", strWhere, ref total); dt.Columns.Add("TXMS", Type.GetType("System.Object")); foreach (DataRow dr in dt.Rows) { string html = "", html2 = "", html3 = ""; switch (dr["TXType"].ToString()) { case "0": html2 = "立即发送"; break; case "1": html2 = "仅一次," + dr["Date"] + " " + dr["Hour"] + ":" + dr["Minute"]; break; case "2": html2 = "每个工作日的" + dr["Hour"] + ":" + dr["Minute"]; break; case "3": html2 = "每天的" + dr["Hour"] + ":" + dr["Minute"]; break; case "4": html2 = "每周" + dr["Days"] + "的" + dr["Hour"] + ":" + dr["Minute"]; break; case "5": html2 = "每月" + dr["Days"] + "日的" + dr["Hour"] + ":" + dr["Minute"]; break; } if (!(dr["TXType"].ToString() == "0" || dr["TXType"].ToString() == "1")) { switch (dr["CFType"].ToString()) { case "1": html3 = ",无结束时间"; break; case "2": html3 = "," + dr["CFCount"].ToString() + "次后结束,已经执行" + (string.IsNullOrWhiteSpace(dr["ZXCount"].ToString()) ? "0" : dr["ZXCount"].ToString()) + "次"; break; case "3": html3 = ",结束时间:" + (string.IsNullOrWhiteSpace(dr["CFJZDate"].ToString()) ? "" : dr["CFJZDate"].ToString().Substring(0, 10)); break; } } html = html2 + html3; dr["TXMS"] = html; } msg.Result = dt; msg.Result1 = total; }
/// <summary> /// 会议列表 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETHYGLLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string userName = UserInfo.User.UserName; string strWhere = " 1=1 and hy.ComId=" + UserInfo.User.ComId; string leibie = context.Request["lb"] ?? ""; if (leibie != "") { strWhere += string.Format(" And hy.RoomID='{0}' ", leibie); } string strContent = context.Request["Content"] ?? ""; strContent = strContent.TrimEnd(); if (strContent != "") { strWhere += string.Format(" And ( hy.Title like '%{0}%' )", strContent); } int DataID = -1; int.TryParse(context.Request["ID"] ?? "-1", out DataID);//记录Id if (DataID != -1) { string strIsHasDataQX = new JH_Auth_QY_ModelB().ISHASDATAREADQX("HYGL", DataID, UserInfo); if (strIsHasDataQX == "Y") { strWhere += string.Format(" And hy.ID = '{0}'", DataID); } } if (P1 != "") { int page = 0; int pagecount = 8; int.TryParse(context.Request["p"] ?? "1", out page); int.TryParse(context.Request["pagecount"] ?? "8", out pagecount);//页数 page = page == 0 ? 1 : page; int total = 0; DataTable dt = new DataTable(); #region no use // switch (P1) // { // case "0": // string colNme1 = @"ycgl.*,case when ycgl.StartTime>getdate() then '即将开始' when ycgl.StartTime<=getdate() and ycgl.EndTime>=getdate() then '正在进行' // when ycgl.EndTime<getdate() then '已结束' end as HLStatus,car.Name ,case WHEN wfpi.isComplete is null and wfpi.IsCanceled is null THEN '正在审批' // when wfpi.isComplete='Y' then '已审批' WHEN wfpi.IsCanceled='Y' then '已退回' END as StateName"; // //strWhere += " And cc.CRUser ='******'"; // dt = new SZHL_CCXJB().GetDataPager("SZHL_HYGL ycgl inner join SZHL_HYGL_ROOM car on ycgl.RoomID=car.ID inner join Yan_WF_PI wfpi on ycgl.intProcessStanceid=wfpi.ID", colNme1, 8, page, " ycgl.CRDate desc", strWhere, ref total); // break; // case "1": // string colNme = @"ycgl.*,case when ycgl.StartTime>getdate() then '即将开始' when ycgl.StartTime<=getdate() and ycgl.EndTime>=getdate() then '正在进行' // when ycgl.EndTime<getdate() then '已结束' end as HLStatus,car.Name ,case WHEN wfpi.isComplete is null and wfpi.IsCanceled is null THEN '正在审批' // when wfpi.isComplete='Y' then '已审批' WHEN wfpi.IsCanceled='Y' then '已退回' END as StateName"; // strWhere += " And ycgl.CRUser ='******'"; // dt = new SZHL_CCXJB().GetDataPager("SZHL_HYGL ycgl inner join SZHL_HYGL_ROOM car on ycgl.RoomID=car.ID inner join Yan_WF_PI wfpi on ycgl.intProcessStanceid=wfpi.ID", colNme, 8, page, " ycgl.CRDate desc", strWhere, ref total); // break; // case "2": // string colNme2 = @"ycgl.*,case when ycgl.StartTime>getdate() then '即将开始' when ycgl.StartTime<=getdate() and ycgl.EndTime>=getdate() then '正在进行' // when ycgl.EndTime<getdate() then '已结束' end as HLStatus,car.Name ,'已审批' StateName"; // strWhere += string.Format(" And (','+ycgl.CYUser+',' like '%,{0},%' or ','+ycgl.JLUser+',' like '%,{0},%' or ','+ycgl.ZCUser+',' like '%,{0},%' or ','+ycgl.SXUser+',' like '%,{0},%' ) and wfpi.isComplete='Y'", userName); // dt = new SZHL_CCXJB().GetDataPager("SZHL_HYGL ycgl inner join SZHL_HYGL_ROOM car on ycgl.RoomID=car.ID inner join Yan_WF_PI wfpi on ycgl.intProcessStanceid=wfpi.ID", colNme2, 8, page, " ycgl.StartTime desc", strWhere, ref total); // break; // case "3": // 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_HYGL ycgl inner join SZHL_HYGL_ROOM car on ycgl.RoomID=car.ID"); // string tableColumnD = "ycgl.* ,car.Name , '正在审批' StateName,case when ycgl.StartTime>getdate() then '即将开始' when ycgl.StartTime<=getdate() and ycgl.EndTime>=getdate() then '正在进行' when ycgl.EndTime<getdate() then '已结束' end as HLStatus"; // strWhere += " And ycgl.intProcessStanceid in (" + (intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(',')) + ")"; // dt = new SZHL_CCXJB().GetDataPager(tableNameD, tableColumnD, 8, page, " ycgl.CRDate desc", strWhere, ref total); // } // break; // case "4": // 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(); // string tableName = string.Format(@" SZHL_HYGL ycgl inner join SZHL_HYGL_ROOM car on ycgl.RoomID=car.ID inner join Yan_WF_PI wfpi on ycgl.intProcessStanceid=wfpi.ID"); // string tableColumn = "ycgl.* ,car.Name , case when wfpi.IsCanceled is null then '已审批' WHEN wfpi.IsCanceled='Y' then '已退回' END StateName,case when ycgl.StartTime>getdate() then '即将开始' when ycgl.StartTime<=getdate() and ycgl.EndTime>=getdate() then '正在进行' when ycgl.EndTime<getdate() then '已结束' end as HLStatus "; // strWhere += " And ycgl.intProcessStanceid in (" + (intPro.ListTOString(',') == "" ? "0" : intPro.ListTOString(',')) + ")"; // dt = new SZHL_CCXJB().GetDataPager(tableName, tableColumn, 8, page, " ycgl.CRDate desc", strWhere, ref total); // break; // } #endregion switch (P1) { case "0": //手机单条数据 { //设置usercenter已读 new JH_Auth_User_CenterB().ReadMsg(UserInfo, DataID, "HYGL"); } break; case "1": //创建的 { strWhere += " And hy.CRUser ='******'"; } break; case "2": //参与的 { strWhere += string.Format(" And (','+hy.CYUser+',' like '%,{0},%' or ','+hy.JLUser+',' like '%,{0},%' or ','+hy.ZCUser+',' like '%,{0},%' or ','+hy.SXUser+',' like '%,{0},%' ) and ( dbo.fn_PDStatus(hy.intProcessStanceid)='已审批' or dbo.fn_PDStatus(hy.intProcessStanceid)='-1')", userName); } break; case "3": //待审核 { var intProD = new Yan_WF_PIB().GetDSH(UserInfo.User).Select(d => d.PIID.ToString()).ToList(); if (intProD.Count > 0) { strWhere += " And hy.intProcessStanceid in (" + (intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(',')) + ")"; } else { strWhere += " And 1=0"; } } break; case "4": //已审核 { var intProD = new Yan_WF_PIB().GetYSH(UserInfo.User).Select(d => d.PIID.ToString()).ToList(); if (intProD.Count > 0) { strWhere += " And hy.intProcessStanceid in (" + (intProD.ListTOString(',') == "" ? "0" : intProD.ListTOString(',')) + ")"; } else { strWhere += " And 1=0"; } } break; } dt = new SZHL_CCXJB().GetDataPager("SZHL_HYGL hy left join SZHL_HYGL_ROOM hys on hy.RoomID=hys.ID", "hy.*,hys.Name ,dbo.fn_PDStatus(hy.intProcessStanceid) AS StateName,case when hy.StartTime>getdate() then '即将开始' when hy.StartTime<=getdate() and hy.EndTime>=getdate() then '正在进行' when hy.EndTime<getdate() then '已结束' end as HLStatus ", pagecount, page, " hy.CRDate desc", strWhere, ref total); if (dt.Rows.Count > 0) { dt.Columns.Add("RYStatus", Type.GetType("System.String")); dt.Columns.Add("FileList", Type.GetType("System.Object")); dt.Columns.Add("PLList", Type.GetType("System.Object")); foreach (DataRow dr in dt.Rows) { if (dr["Files"] != null && dr["Files"].ToString() != "") { dr["FileList"] = new FT_FileB().GetEntities(" ID in (" + dr["Files"].ToString() + ")"); } string strid = dr["ID"].ToString(); var hysat = new JH_Auth_TLB().GetEntities(p => p.ComId == UserInfo.User.ComId && p.MSGType == "HYGL" && p.MSGTLYID == strid && p.CRUser == UserInfo.User.UserName && p.MsgISShow != null).OrderByDescending(p => p.CRDate).ToList(); if (hysat.Count() > 0) { string strs = string.Empty; foreach (var l in hysat) { if (string.IsNullOrEmpty(strs)) { strs = l.MsgISShow; } else { strs = strs + "," + l.MsgISShow; } } dr["RYStatus"] = strs; } dr["PLList"] = new JH_Auth_TLB().GetEntities(p => p.ComId == UserInfo.User.ComId && p.MSGType == "HYGL" && p.MSGTLYID == strid); } } msg.Result = dt; msg.Result1 = total; } }