/// <summary> /// 向服务器发送压缩目录命令 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1">目录ID</param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void COMPRESSFOLDER(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string strCode = P1; FT_FolderB.FoldFile Mode = new FT_FolderB.FoldFile(); Mode.FolderID = -1; Mode.Name = "压缩文件"; Mode.SubFileS = new List <FT_File>(); Mode.SubFolder = new List <FT_FolderB.FoldFile>(); foreach (string item in P1.SplitTOList(',')) { int FileID = int.Parse(item.Split('|')[0].ToString()); string strType = item.Split('|')[1].ToString(); if (item.Split('|')[1].ToString() == "file") { FT_File file = new FT_FileB().GetEntity(d => d.ID == FileID); file.YLUrl = ""; Mode.SubFileS.Add(file); } else { List <FT_FolderB.FoldFileItem> ListID = new List <FT_FolderB.FoldFileItem>(); FT_FolderB.FoldFile obj = new FT_FolderB().GetWDTREE(FileID, ref ListID, UserInfo.User.ComId.Value); Mode.SubFolder.Add(obj); } } IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; string Result = JsonConvert.SerializeObject(Mode, Formatting.Indented, timeConverter).Replace("null", "\"\""); string strData = new FileHelp().CompressZip(Result, UserInfo.QYinfo); msg.Result = strData; }
/// <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(JObject 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") ?? "0", 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_GZGL_FLB().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">活动报名信息ID</param> /// <param name="P2"></param> /// <param name="strUserName"></param> public void GETQYHDMODEL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int Id = int.Parse(P1); SZHL_QYHDN qyhd = new SZHL_QYHDNB().GetEntity(d => d.ID == Id); msg.Result = qyhd; DataTable dtPL = new SZHL_GZBGB().GetDTByCommand(" SELECT * FROM JH_Auth_TL WHERE MSGType='QYHD' AND MSGTLYID='" + P1 + "'"); dtPL.Columns.Add("FileList", Type.GetType("System.Object")); foreach (DataRow dr in dtPL.Rows) { if (dr["MSGisHasFiles"] != null && dr["MSGisHasFiles"].ToString() != "") { int[] fileIds = dr["MSGisHasFiles"].ToString().SplitTOInt(','); dr["FileList"] = new FT_FileB().GetEntities(d => fileIds.Contains(d.ID)); } } msg.Result1 = dtPL; if (!string.IsNullOrEmpty(qyhd.Files)) { int[] fileIds = qyhd.Files.SplitTOInt(','); msg.Result2 = new FT_FileB().GetEntities(d => fileIds.Contains(d.ID)); } msg.Result3 = new SZHL_QYHD_ResultB().GetEntities(d => d.HDID == qyhd.ID); msg.Result4 = new SZHL_QYHD_OptionB().GetEntities(d => d.HDId == qyhd.ID); }
/// <summary> /// 查看项目的详细 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETXMGLMODEL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int Id = 0; int.TryParse(P1, out Id); DataTable Model = new SZHL_XMGLB().GetDTByCommand("SELECT xm.*,zd.TypeName from SZHL_XMGL xm left join JH_Auth_ZiDian zd on convert(varchar,YXJ)=convert(varchar,zd.ID) WHERE xm.ID=" + Id + ""); msg.Result = Model; if (Model != null && Model.Rows.Count > 0) { DataTable dtpl = new JH_Auth_TLB().GetTL("XMGL", Model.Rows[0]["ID"].ToString()); msg.Result1 = dtpl; DataTable filedt = dtpl.Copy(); if (filedt != null && filedt.Rows.Count > 0) { foreach (DataRow dr in filedt.Rows) { if (dr["MSGisHasFiles"] == null || dr["MSGisHasFiles"].ToString() == "") { dr.Delete(); } } filedt.AcceptChanges(); msg.Result3 = filedt; } if (Model.Rows[0]["Files"].ToString() != "") { int[] fileIDs = Model.Rows[0]["Files"].ToString().SplitTOInt(','); List <FT_File> FileList = new FT_FileB().GetEntities(d => fileIDs.Contains(d.ID)).ToList(); msg.Result2 = FileList; } } }
/// <summary> /// 获取文件信息 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETFILEINFO(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int FileID = int.Parse(P1);// FT_File MODEL = new FT_FileB().GetEntity(d => d.ID == FileID); msg.Result = MODEL; //msg.Result2 = new FT_FileB().GetYLURL(MODEL); }
public void ADDJFBX(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { SZHL_JFBX jfbxModel = JsonConvert.DeserializeObject <SZHL_JFBX>(P1); List <SZHL_JFBXITEM> itemList = JsonConvert.DeserializeObject <List <SZHL_JFBXITEM> >(P2); if (itemList == null || itemList.Count() == 0) { msg.Result = "请添加消费记录"; return; } string wximg = context.Request["wximg"] ?? ""; if (wximg != "") // 处理微信上传的图片 { string fids = new FT_FileB().ProcessWxIMG(wximg, "JFBX", UserInfo); if (!string.IsNullOrEmpty(jfbxModel.Files)) { jfbxModel.Files += "," + fids; } else { jfbxModel.Files = fids; } } if (jfbxModel.ID == 0) { jfbxModel.CRDate = DateTime.Now; jfbxModel.CRUser = UserInfo.User.UserName; jfbxModel.ComId = UserInfo.User.ComId; jfbxModel.FormCode = new SZHL_JFBXB().GetFormCode(); jfbxModel.BranchName = UserInfo.BranchInfo.DeptName; jfbxModel.BranchNo = UserInfo.BranchInfo.DeptCode; new SZHL_JFBXB().Insert(jfbxModel); foreach (SZHL_JFBXITEM item in itemList) { item.ComID = UserInfo.User.ComId; item.JFBXID = jfbxModel.ID; new SZHL_JFBXITEMB().Insert(item); } } else { new SZHL_JFBXB().Update(jfbxModel); new SZHL_JFBXITEMB().Delete(d => d.JFBXID == jfbxModel.ID && d.ComID == UserInfo.User.ComId); foreach (SZHL_JFBXITEM item in itemList) { item.ComID = UserInfo.User.ComId; item.JFBXID = jfbxModel.ID; new SZHL_JFBXITEMB().Insert(item); } } msg.Result = jfbxModel; }
/// <summary> /// 添加外勤签到 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1">客户信息</param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void ADDWQQD(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { SZHL_WQQD wqqd = JsonConvert.DeserializeObject <SZHL_WQQD>(P1); if (string.IsNullOrEmpty(wqqd.Position)) { msg.ErrorMsg = "当前位置不能为空"; return; } if (P2 != "") // 处理微信上传的图片 { string fids = new FT_FileB().ProcessWxIMG(P2, "RLZY", UserInfo); if (!string.IsNullOrEmpty(wqqd.Files)) { wqqd.Files += "," + fids; } else { wqqd.Files = fids; } } if (wqqd.ID == 0) { wqqd.CRDate = DateTime.Now; wqqd.CRUser = UserInfo.User.UserName; wqqd.BranchName = UserInfo.BranchInfo.DeptName; wqqd.BranchNo = UserInfo.User.BranchCode; wqqd.ComId = UserInfo.User.ComId; wqqd.CRUserName = UserInfo.User.UserRealName; new SZHL_WQQDB().Insert(wqqd); if (!string.IsNullOrEmpty(wqqd.HBUser)) { SZHL_TXSX CSTX = new SZHL_TXSX(); CSTX.Date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); CSTX.APIName = "WQQD"; CSTX.ComId = UserInfo.User.ComId; CSTX.FunName = "SENDWQMSG"; CSTX.CRUserRealName = UserInfo.User.UserRealName; CSTX.MsgID = wqqd.ID.ToString(); CSTX.ISCS = "N"; CSTX.TXUser = wqqd.HBUser; CSTX.TXMode = "WQQD"; CSTX.CRUser = UserInfo.User.UserName; TXSX.TXSXAPI.AddALERT(CSTX); //时间为发送时间 } } else { new SZHL_WQQDB().Update(wqqd); } msg.Result = wqqd; }
public void UPDZY(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { String zyid = context.Request("ZYID") ?? "0"; FT_File model = new FT_FileB().GetEntity(d => d.zyid == zyid && d.ComId == UserInfo.User.ComId.Value); model.Name = P1; new FT_FileB().Update(model); msg.Result = model; }
/// <summary> /// 添加话题 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void ADDHT(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { SZHL_TSSQ tssq = JsonConvert.DeserializeObject <SZHL_TSSQ>(P1); if (!string.IsNullOrEmpty(tssq.URL) && !tssq.URL.Contains("http://")) { tssq.URL = "http://" + tssq.URL; } if (P2 != "") // 处理微信上传的图片 { string fids = new FT_FileB().ProcessWxIMG(P2, "TSSQ", UserInfo); if (!string.IsNullOrEmpty(tssq.Files)) { tssq.Files += "," + fids; } else { tssq.Files = fids; } } if (tssq.ID == 0) { tssq.CRDate = DateTime.Now; tssq.CRUser = UserInfo.User.UserName; tssq.ComId = UserInfo.User.ComId; new SZHL_TSSQB().Insert(tssq); SZHL_TXSX CSTX = new SZHL_TXSX(); CSTX.Date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); CSTX.APIName = "TSSQ"; CSTX.ComId = UserInfo.User.ComId; CSTX.FunName = "SENDHTMSG"; CSTX.CRUserRealName = UserInfo.User.UserRealName; CSTX.MsgID = tssq.ID.ToString(); CSTX.ISCS = "N"; CSTX.TXUser = tssq.CRUser; CSTX.TXMode = "TSSQ"; CSTX.CRUser = UserInfo.User.UserName; TXSX.TXSXAPI.AddALERT(CSTX); //时间为发送时间 } else { new SZHL_TSSQB().Update(tssq); } msg.Result = tssq; }
/// <summary> /// 移动剪切-粘贴 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void PASTEITEM(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int PID = int.Parse(P1); JArray PASTEITEMS = (JArray)JsonConvert.DeserializeObject(P2); string strPASTEtype = context.Request("PASTETYPE"); if (strPASTEtype == "copy") { foreach (var item in PASTEITEMS) { int itemid = int.Parse(item["ID"].ToString()); if (item["type"].ToString() == "file") { FT_File Model = new FT_FileB().GetEntity(d => d.ID == itemid); Model.FolderID = PID; new FT_FileB().Insert(Model); } else { new FT_FolderB().CopyFloderTree(itemid, PID, UserInfo.User.ComId.Value); } } } else { foreach (var item in PASTEITEMS) { int itemid = int.Parse(item["ID"].ToString()); if (item["type"].ToString() == "file") { FT_File Model = new FT_FileB().GetEntity(d => d.ID == itemid); Model.FolderID = PID; new FT_FileB().Update(Model); } else { FT_Folder PModel = new FT_FolderB().GetEntity(d => d.ID == PID); FT_Folder Model = new FT_FolderB().GetEntity(d => d.ID == itemid); Model.PFolderID = PID; Model.Remark = PModel.Remark + "-" + Model.ID; new FT_FolderB().Update(Model); //子文件夹路径修改 new FT_FolderB().ExsSql(" UPDATE FT_Folder set Remark= '" + PModel.Remark + "'+SUBSTRING(Remark, CHARINDEX('-" + Model.ID + "-',Remark), 2000) WHERE ComId=" + UserInfo.User.ComId + " AND Remark LIKE '" + Model.Remark + "-%' "); } } } }
public DataTable GetTL(string strMsgType, string MSGTLYID) { DataTable dtList = new DataTable(); dtList = new JH_Auth_TLB().GetDTByCommand(" SELECT * FROM JH_Auth_TL WHERE MSGType='" + strMsgType + "' AND MSGTLYID='" + MSGTLYID + "'"); dtList.Columns.Add("FileList", Type.GetType("System.Object")); foreach (DataRow dr in dtList.Rows) { if (dr["MSGisHasFiles"] != null && dr["MSGisHasFiles"].ToString() != "") { int[] fileIds = dr["MSGisHasFiles"].ToString().SplitTOInt(','); dr["FileList"] = new FT_FileB().GetEntities(d => fileIds.Contains(d.ID)); } } return(dtList); }
/// <summary> /// 添加用车管理 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void ADDYCGL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { SZHL_YCGL ycgl = JsonConvert.DeserializeObject <SZHL_YCGL>(P1); if (ycgl == null) { msg.ErrorMsg = "操作失败"; return; } if (ycgl.SYRS == null) { msg.ErrorMsg = "请填写使用人数"; return; } if (string.IsNullOrWhiteSpace(ycgl.StartAddress) || string.IsNullOrWhiteSpace(ycgl.EndAddress)) { msg.ErrorMsg = "请填写地点"; return; } if (ycgl.ID == 0) { if (P2 != "") // 处理微信上传的图片 { string fids = new FT_FileB().ProcessWxIMG(P2, "YCGL", UserInfo); if (!string.IsNullOrEmpty(ycgl.Files)) { ycgl.Files += "," + fids; } else { ycgl.Files = fids; } } ycgl.CRDate = DateTime.Now; ycgl.CRUser = UserInfo.User.UserName; ycgl.ComId = UserInfo.User.ComId; ycgl.Status = "1"; ycgl.IsDel = 0; new SZHL_YCGLB().Insert(ycgl); } else { new SZHL_YCGLB().Update(ycgl); } msg.Result = ycgl; }
/// <summary> /// 获取文档ITEM /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETWDITEM(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int ID = int.Parse(P2); if (P1 == "file")// { FT_File Model = new FT_FileB().GetEntity(d => d.ID == ID); List <FT_File_Vesion> ListVer = new FT_File_VesionB().GetEntities(D => D.ComId == UserInfo.User.ComId && D.RFileID == Model.ID).ToList(); msg.Result = Model; msg.Result1 = ListVer; } else { FT_Folder Model = new FT_FolderB().GetEntity(d => d.ID == ID); msg.Result = Model; } }
/// <summary> /// 获取文档资源 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETWDZY(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string strWDYM = CommonHelp.GetConfig("WDYM"); FT_File ff = new FT_FileB().GetEntities(p => p.YLCode == P1).FirstOrDefault(); if (ff != null) { msg.Result = strWDYM + ff.YLPath; msg.Result1 = ff.YLCount; msg.Result2 = ff.Name + "." + ff.FileExtendName; } else { msg.ErrorMsg = "此文件不存在或您没有权限!"; } }
/// <summary> /// 获取文档资源 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETWDZY(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { FT_File ff = new FT_FileB().GetEntities(p => p.zyid == P1).FirstOrDefault(); JH_Auth_QY QY = new JH_Auth_QYB().GetALLEntities().FirstOrDefault(); if (ff != null) { HttpWebResponse ResponseData = CommonHelp.CreateHttpResponse(QY.FileServerUrl + "/document/officecov/" + ff.zyid, null, 0, "", null, "GET"); string Returndata = CommonHelp.GetResponseString(ResponseData); msg.Result = Returndata.ToString().Split(',')[1]; msg.Result1 = ff.Name; msg.Result2 = QY.FileServerUrl; } else { msg.ErrorMsg = "此文件不存在或您没有权限!"; } }
public void ISCOV(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { List <FT_File> ListData = JsonConvert.DeserializeObject <List <FT_File> >(P1); if (ListData.Count > 0) { int[] fileId = ListData.Select(d => d.ID).ToList().ListTOString(',').SplitTOInt(','); int count = new FT_FileB().GetEntities(d => fileId.Contains(d.ID) && d.FileExtendName == "pdf" && d.YLPath == null).Count(); if (count == 0) { msg.Result = new FT_FileB().GetEntities(d => fileId.Contains(d.ID)); } else { msg.ErrorMsg = "转换未完成"; } } }
/// <summary> /// 添加出差请假 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1">客户信息</param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void ADDCCXJ(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { SZHL_CCXJ ccxj = JsonConvert.DeserializeObject <SZHL_CCXJ>(P1); if (ccxj.Daycount == 0) { msg.ErrorMsg = "申请天数不能为空"; return; } if (ccxj.EndTime < ccxj.StarTime) { msg.ErrorMsg = "开始时间不能大于结束时间"; return; } if (P2 != "") // 处理微信上传的图片 { string fids = new FT_FileB().ProcessWxIMG(P2, "CCXJ", UserInfo); if (!string.IsNullOrEmpty(ccxj.Files)) { ccxj.Files += "," + fids; } else { ccxj.Files = fids; } } if (ccxj.ID == 0) { ccxj.ShenQingRen = string.IsNullOrEmpty(ccxj.ShenQingRen) ? UserInfo.User.UserRealName : ccxj.ShenQingRen; ccxj.CRDate = DateTime.Now; ccxj.CRUser = UserInfo.User.UserName; ccxj.BranchName = UserInfo.BranchInfo.DeptName; ccxj.BranchNo = UserInfo.User.BranchCode; ccxj.ComId = UserInfo.User.ComId; new SZHL_CCXJB().Insert(ccxj); } else { new SZHL_CCXJB().Update(ccxj); } msg.Result = ccxj; }
/// <summary> /// 向服务器发送压缩目录命令 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1">目录ID</param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void COMPRESSFOLDER(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string strCode = P1; int ComId = int.Parse(P2); FT_FolderB.FoldFile Mode = new FT_FolderB.FoldFile(); Mode.FolderID = -1; Mode.Name = "压缩文件"; Mode.SubFileS = new List <FT_File>(); Mode.SubFolder = new List <FT_FolderB.FoldFile>(); foreach (string item in P1.SplitTOList(',')) { int FileID = int.Parse(item.Split('|')[0].ToString()); string strType = item.Split('|')[1].ToString(); if (item.Split('|')[1].ToString() == "file") { FT_File file = new FT_FileB().GetEntity(d => d.ID == FileID); file.YLUrl = ""; Mode.SubFileS.Add(file); } else { List <FT_FolderB.FoldFileItem> ListID = new List <FT_FolderB.FoldFileItem>(); FT_FolderB.FoldFile obj = new FT_FolderB().GetWDTREE(FileID, ref ListID, ComId); Mode.SubFolder.Add(obj); } } IsoDateTimeConverter timeConverter = new IsoDateTimeConverter(); timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; string Result = JsonConvert.SerializeObject(Mode, Newtonsoft.Json.Formatting.Indented, timeConverter).Replace("null", "\"\""); JH_Auth_QY qymodel = new JH_Auth_QYB().GetEntity(d => d.ComId == ComId); //压缩文件 Dictionary <String, String> DATA = new Dictionary <String, String>(); DATA.Add("data", Result); HttpWebResponse ResponseData = CommonHelp.CreatePostHttpResponse(qymodel.FileServerUrl + "zipfolder", DATA, 0, "", null); string strData = CommonHelp.GetResponseString(ResponseData); msg.Result = strData; }
/// <summary> /// 获取能够查看的内部人员共享目录 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETNBSHARELIST(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string strUser = P1; string strSQL = "SELECT FT_Folder.* FROM FT_File_UserAuth LEFT JOIN FT_Folder on FT_File_UserAuth.RefID=FT_Folder.ID WHERE " + SqlHelp.concat("','+AuthUser+','") + " like '%," + UserInfo.User.UserName + ",%' and FT_File_UserAuth.RefType='0'"; if (strUser != "") { strSQL = strSQL + " AND FT_File_UserAuth.CRUser='******' "; } string strSQLFile = "SELECT FT_File.* FROM FT_File_UserAuth LEFT JOIN FT_File on FT_File_UserAuth.RefID=FT_File.ID WHERE " + SqlHelp.concat("','+AuthUser+','") + " like '%," + UserInfo.User.UserName + ",%' and FT_File_UserAuth.RefType='1'"; if (strUser != "") { strSQLFile = strSQLFile + " AND FT_File_UserAuth.CRUser='******' "; } DataTable dtFLODER = new FT_FolderB().GetDTByCommand(strSQL); DataTable dtFile = new FT_FileB().GetDTByCommand(strSQLFile); msg.Result = dtFLODER; msg.Result1 = dtFile; }
public void GETGZBGMODEL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int Id = 0; int.TryParse(P1, out Id); SZHL_GZBG sg = new SZHL_GZBGB().GetEntity(d => d.ID == Id && d.ComId == UserInfo.User.ComId); msg.Result = sg; if (sg != null) { msg.Result3 = new JH_Auth_ZiDianB().GetEntity(d => d.ID == sg.LeiBie).TypeName; } DataTable dtPL = new SZHL_GZBGB().GetDTByCommand(" SELECT * FROM JH_Auth_TL WHERE MSGType='GZBG' AND MSGTLYID='" + P1 + "'"); dtPL.Columns.Add("FileList", Type.GetType("System.Object")); foreach (DataRow dr in dtPL.Rows) { if (dr["MSGisHasFiles"] != null && dr["MSGisHasFiles"].ToString() != "") { int[] fileIds = dr["MSGisHasFiles"].ToString().SplitTOInt(','); dr["FileList"] = new FT_FileB().GetEntities(d => fileIds.Contains(d.ID)); } } msg.Result1 = dtPL; if (!string.IsNullOrEmpty(sg.Files)) { int[] fileIds = sg.Files.SplitTOInt(','); msg.Result2 = new FT_FileB().GetEntities(d => fileIds.Contains(d.ID)); } //更新消息为已读状态 if (sg != null) { new JH_Auth_User_CenterB().ReadMsg(UserInfo, sg.ID, "GZBG"); } }
/// <summary> /// 取消收藏 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void CANCOLLECTITEM(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int DataID = int.Parse(P2); if (P1 == "file")// { FT_File Model = new FT_FileB().GetEntity(d => d.ID == DataID); if (Model.CollectUser.SplitTOList(',').Contains(UserInfo.User.UserName)) { Model.CollectUser = Model.CollectUser.Replace(UserInfo.User.UserName, ",").Replace(",,", ",").TrimEnd(','); new FT_FileB().Update(Model); } } else { FT_Folder Model = new FT_FolderB().GetEntity(d => d.ID == DataID); if (Model.CollectUser.SplitTOList(',').Contains(UserInfo.User.UserName)) { Model.CollectUser = Model.CollectUser.Replace(UserInfo.User.UserName, ",").Replace(",,", ",").TrimEnd(','); new FT_FolderB().Update(Model); } } }
/// <summary> /// 收藏目录或文档 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void COLLECTITEM(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int DataID = int.Parse(P2); if (P1 == "file")// { FT_File Model = new FT_FileB().GetEntity(d => d.ID == DataID); if (string.IsNullOrEmpty(Model.CollectUser) || !Model.CollectUser.SplitTOList(',').Contains(UserInfo.User.UserName)) { Model.CollectUser = (string.IsNullOrEmpty(Model.CollectUser) ? "" : Model.CollectUser.TrimEnd(',') + ",") + UserInfo.User.UserName; new FT_FileB().Update(Model); } } else { FT_Folder Model = new FT_FolderB().GetEntity(d => d.ID == DataID); if (string.IsNullOrEmpty(Model.CollectUser) || !Model.CollectUser.SplitTOList(',').Contains(UserInfo.User.UserName)) { Model.CollectUser = (string.IsNullOrEmpty(Model.CollectUser) ? "" : Model.CollectUser.TrimEnd(',') + ",") + UserInfo.User.UserName; new FT_FolderB().Update(Model); } } }
/// <summary> /// 获取话题BYID /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETHTMODEL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int Id = 0; int.TryParse(P1, out Id); SZHL_TSSQ sg = new SZHL_TSSQB().GetEntity(d => d.ID == Id && d.ComId == UserInfo.User.ComId); msg.Result = sg; if (sg != null) { if (!string.IsNullOrWhiteSpace(sg.Files)) { msg.Result1 = new FT_FileB().GetEntities(" ID in (" + sg.Files + ")"); } if (sg.LeiBie != null && !string.IsNullOrWhiteSpace(sg.LeiBie.ToString())) { var SS = new JH_Auth_ZiDianB().GetEntity(p => p.ID == sg.LeiBie); if (SS != null) { msg.Result2 = SS.TypeName; } } //msg.Result3 = new JH_Auth_TLB().GetEntities(d => d.ComId == UserInfo.User.ComId && d.MSGType == "TSSQ" && d.MSGTLYID == P1 && (d.MsgISShow != "Y" && d.MsgISShow != "N")).ToList(); DataTable dtPL = new SZHL_GZBGB().GetDTByCommand(" SELECT * FROM JH_Auth_TL WHERE MSGType='TSSQ' AND MSGTLYID='" + P1 + "' and MsgISShow!='Y' and MsgISShow!='N')"); dtPL.Columns.Add("FileList", Type.GetType("System.Object")); foreach (DataRow dr in dtPL.Rows) { if (dr["MSGisHasFiles"] != null && dr["MSGisHasFiles"].ToString() != "") { int[] fileIds = dr["MSGisHasFiles"].ToString().SplitTOInt(','); dr["FileList"] = new FT_FileB().GetEntities(d => fileIds.Contains(d.ID)); } } msg.Result3 = dtPL; } }
public void GETZYGLLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string strWhere = " ComId=" + UserInfo.User.ComId; if (P1 != "") { strWhere += string.Format(" And title like '%{0}%'", P1); } if (context.Request["type"] != "" && context.Request["type"] != null) { strWhere += string.Format(" And FolderID = '{0}'", context.Request["type"] ?? ""); } 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 FT_FileB().GetDataPager(" FT_File ", " * ", pagecount, page, " CRDate desc", strWhere, ref total); msg.Result = dt; msg.Result1 = total; }
public void GETZYGLLIST(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string strWhere = " ComId=" + UserInfo.User.ComId; if (P1 != "") { strWhere += string.Format(" And title like '%{0}%'", P1); } if (context.Request("type") != "" && context.Request("type") != null) { strWhere += string.Format(" And FolderID = '{0}'", context.Request("type") ?? ""); } 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; var dt = new FT_FileB().Db.Queryable <FT_File>().Where(strWhere).OrderBy(it => it.CRDate, OrderByType.Desc).ToPageList(page, pagecount, 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 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 GETHTLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string userName = UserInfo.User.UserName; 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 recordCount = 0; string strWhere = string.Format(" sq.ComId={0} ", UserInfo.User.ComId); string strContent = context.Request["Content"] ?? ""; strContent = strContent.TrimEnd(); if (strContent != "") { strWhere += string.Format(" And ( sq.HTNR like '%{0}%' )", strContent); } string leibie = context.Request["lb"] ?? ""; if (leibie != "") { strWhere += string.Format(" And sq.LeiBie='{0}' ", leibie); } int DataID = -1; int.TryParse(context.Request["ID"] ?? "-1", out DataID);//记录Id if (DataID != -1) { string strIsHasDataQX = new JH_Auth_QY_ModelB().ISHASDATAREADQX("TSSQ", DataID, UserInfo); if (strIsHasDataQX == "Y") { strWhere += string.Format(" And sq.ID = '{0}'", DataID); } } if (P1 != "") { switch (P1) { case "0": { //设置usercenter已读 new JH_Auth_User_CenterB().ReadMsg(UserInfo, DataID, "TSSQ"); } break; case "1": //我的 { strWhere += " And sq.CRUser='******'"; } break; case "2": //我评论过的 { //DataTable dtPL = new JH_Auth_TLB().GetDTByCommand(string.Format("SELECT tl.MSGTLYID FROM JH_Auth_TL tl WHERE tl.MSGType='TSSQ' AND tl.MsgISShow <> 'Y' AND tl.CRUser='******'", UserInfo.User.UserName)); string htIDs = new JH_Auth_TLB().GetEntities(d => d.MSGType == "TSSQ" && d.CRUser == UserInfo.User.UserName && (d.MsgISShow != "Y" && d.MsgISShow != "N")).Select(d => d.MSGTLYID).ToList().ListTOString(','); if (!string.IsNullOrWhiteSpace(htIDs)) { strWhere += "And sq.ID IN (" + htIDs + ") "; } else { strWhere += "And sq.ID ='' "; } } break; case "3": //全部 { strWhere += " And (ISNULL(sq.CYR,'') = '' OR ','+sq.CYR+',' like '%," + userName + ",%' )"; } break; } DataTable dt = new SZHL_TSSQB().GetDataPager(@" SZHL_TSSQ sq LEFT JOIN JH_Auth_ZiDian zd ON sq.LeiBie=zd.ID and Class=19", " sq.*,zd.TypeName ", pagecount, page, " sq.CRDate DESC ", strWhere, ref recordCount); #region 附件评论 string Ids = ""; string fileIDs = ""; foreach (DataRow row in dt.Rows) { Ids += row["ID"].ToString() + ","; if (!string.IsNullOrEmpty(row["Files"].ToString())) { fileIDs += row["Files"].ToString() + ","; } } Ids = Ids.TrimEnd(','); fileIDs = fileIDs.TrimEnd(','); if (Ids != "") { List <FT_File> FileList = new List <FT_File>(); DataTable dtPL = new JH_Auth_TLB().GetDTByCommand(string.Format("SELECT tl.* FROM JH_Auth_TL tl WHERE tl.MSGType='TSSQ' AND (ISNULL(tl.MsgISShow,'') <> 'Y' and ISNULL(tl.MsgISShow,'') <> 'N') AND tl.MSGTLYID in ({0}) ORDER BY CRDate ASC", Ids)); DataTable zandt = new JH_Auth_TLB().GetDTByCommand(string.Format("SELECT tl.* FROM JH_Auth_TL tl WHERE tl.MSGType='TSSQ' AND MsgISShow='Y' AND tl.MSGTLYID in ({0})", Ids)); if (!string.IsNullOrEmpty(fileIDs)) { int[] fileId = fileIDs.SplitTOInt(','); FileList = new FT_FileB().GetEntities(d => fileId.Contains(d.ID)).ToList(); } dt.Columns.Add("PLList", Type.GetType("System.Object")); dt.Columns.Add("FileList", Type.GetType("System.Object")); dt.Columns.Add("ZanList", Type.GetType("System.Object")); dt.Columns.Add("IsZan", Type.GetType("System.Object")); foreach (DataRow row in dt.Rows) { DataTable dtPLs = dtPL.FilterTable("MSGTLYID='" + row["ID"] + "'"); dtPLs.Columns.Add("FileList", Type.GetType("System.Object")); foreach (DataRow dr in dtPLs.Rows) { if (dr["MSGisHasFiles"] != null && dr["MSGisHasFiles"].ToString() != "") { int[] fileIds = dr["MSGisHasFiles"].ToString().SplitTOInt(','); dr["FileList"] = new FT_FileB().GetEntities(d => fileIds.Contains(d.ID)); } } row["PLList"] = dtPLs; row["ZanList"] = zandt.FilterTable("MSGTLYID='" + row["ID"] + "'"); row["IsZan"] = zandt.FilterTable(" MSGTLYID='" + row["ID"] + "' and CRUser='******'").Rows.Count > 0 ? "Y" : "N"; if (FileList.Count > 0) { string[] fileIds = row["Files"].ToString().Split(','); row["FileList"] = FileList.Where(d => fileIds.Contains(d.ID.ToString())); } } } #endregion msg.Result = dt; msg.Result1 = recordCount; } }
/// <summary> /// 获取页面html(excel) /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETHTML(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string strWDYM = CommonHelp.GetConfig("WDYM"); FT_File ff = new FT_FileB().GetEntities(p => p.YLCode == P1).FirstOrDefault(); if (ff != null) { //定义局部变量 HttpWebRequest httpWebRequest = null; HttpWebResponse httpWebRespones = null; Stream stream = null; string htmlString = string.Empty; string url = strWDYM + ff.YLPath; //请求页面 try { httpWebRequest = WebRequest.Create(url + ".html") as HttpWebRequest; } //处理异常 catch { msg.ErrorMsg = "建立页面请求时发生错误!"; } httpWebRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; Maxthon 2.0)"; //获取服务器的返回信息 try { httpWebRespones = (HttpWebResponse)httpWebRequest.GetResponse(); stream = httpWebRespones.GetResponseStream(); } //处理异常 catch { msg.ErrorMsg = "接受服务器返回页面时发生错误!"; } StreamReader streamReader = new StreamReader(stream, System.Text.Encoding.UTF8); //读取返回页面 try { htmlString = streamReader.ReadToEnd(); } //处理异常 catch { msg.ErrorMsg = "读取页面数据时发生错误!"; } //释放资源返回结果 streamReader.Close(); stream.Close(); msg.Result = htmlString; msg.Result1 = url; } else { msg.ErrorMsg = "此文件不存在或您没有权限!"; } }
/// <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">上级文件夹ID</param> /// <param name="UserInfo"></param> public void GETLISTDATA(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { //默认找出企业文件夹查看属性为空或者包含当前用户的数据 string itemtype = context.Request("itemtype") ?? ""; //文件或文件夹类型(1:企业文件夹,2:个人文件夹) if (itemtype == "1") //企业文件夹 { int FolderID = int.Parse(P1); // //默认找出企业文件夹查看属性为空或者包含当前用户的数据 if (P2 == "Y") //如果是后台查看企业文件夹 { //msg.Result = new FT_FolderB().GetEntities(" ComId=" + UserInfo.User.ComId + " AND PFolderID=" + FolderID); //msg.Result1 = new FT_FileB().GetEntities("ComId=" + UserInfo.User.ComId + " AND FolderID=" + FolderID); string strSQL = string.Format("SELECT FT_Folder.*,ISNULL(FT_File_UserAuth.AuthUser, '') as AuthUser from FT_Folder LEFT JOIN FT_File_UserAuth on FT_Folder.ID= FT_File_UserAuth.RefID and FT_File_UserAuth.RefType='0' where FT_Folder.ComId='{0}' and FT_Folder.PFolderID='{1}' ", UserInfo.User.ComId, FolderID.ToString()); msg.Result = new FT_FolderB().GetDTByCommand(strSQL); string strSQLFile = string.Format("SELECT FT_File.*,ISNULL(FT_File_UserAuth.AuthUser, '') as AuthUser from FT_File LEFT JOIN FT_File_UserAuth on FT_File.ID= FT_File_UserAuth.RefID and FT_File_UserAuth.RefType='1' where FT_File.ComId='{0}' and FT_File.FolderID='{1}' ", UserInfo.User.ComId, FolderID.ToString()); msg.Result1 = new FT_FileB().GetDTByCommand(strSQLFile); return; } else { string strSQL = string.Format("SELECT FT_Folder.*,ISNULL(FT_File_UserAuth.AuthUser, '') as AuthUser from FT_Folder LEFT JOIN FT_File_UserAuth on FT_Folder.ID= FT_File_UserAuth.RefID and FT_File_UserAuth.RefType='0' where FT_Folder.ComId='{0}' and FT_Folder.PFolderID='{1}' and ( AuthUser is NULL OR ',' + AuthUser + ',' like '%,{2},%' )", UserInfo.User.ComId, FolderID.ToString(), UserInfo.User.UserName); msg.Result = new FT_FolderB().GetDTByCommand(strSQL); string strSQLFile = string.Format("SELECT FT_File.*,ISNULL(FT_File_UserAuth.AuthUser, '') as AuthUser from FT_File LEFT JOIN FT_File_UserAuth on FT_File.ID= FT_File_UserAuth.RefID and FT_File_UserAuth.RefType='1' where FT_File.ComId='{0}' and FT_File.FolderID='{1}' ", UserInfo.User.ComId, FolderID.ToString()); msg.Result1 = new FT_FileB().GetDTByCommand(strSQLFile); return; } } if (itemtype == "2") //个人文件夹 { int FolderID = int.Parse(P1); // string strSQL = string.Format("SELECT FT_Folder.*,ISNULL(FT_File_UserAuth.AuthUser, '') as AuthUser from FT_Folder LEFT JOIN FT_File_UserAuth on FT_Folder.ID= FT_File_UserAuth.RefID and FT_File_UserAuth.RefType='0' where FT_Folder.ComId='{0}' and FT_Folder.PFolderID='{1}' and FT_Folder.CRUser='******'", UserInfo.User.ComId, FolderID.ToString(), UserInfo.User.UserName); msg.Result = new FT_FolderB().GetDTByCommand(strSQL); string strSQLFile = string.Format("SELECT FT_File.*,ISNULL(FT_File_UserAuth.AuthUser, '') as AuthUser from FT_File LEFT JOIN FT_File_UserAuth on FT_File.ID= FT_File_UserAuth.RefID and FT_File_UserAuth.RefType='1' where FT_File.ComId='{0}' and FT_File.FolderID='{1}' and FT_File.CRUser='******' ", UserInfo.User.ComId, FolderID.ToString(), UserInfo.User.UserName); msg.Result1 = new FT_FileB().GetDTByCommand(strSQLFile); return; } if (itemtype == "4") //共享文档 { int FolderID = int.Parse(P1); // msg.Result = new FT_FolderB().GetEntities(d => d.ComId == UserInfo.User.ComId && d.PFolderID == FolderID); msg.Result1 = new FT_FileB().GetEntities(d => d.ComId == UserInfo.User.ComId && d.FolderID == FolderID); return; } if (itemtype == "3")//我的收藏 { string strWhere = string.Format(SqlHelp.concat("','+CollectUser+','") + " like '%," + UserInfo.User.UserName + ",%'"); string strWhere1 = strWhere; if (!string.IsNullOrEmpty(P1)) { strWhere1 = string.Format(" PFolderID=" + P1); } string strSQLFLODER = string.Format(@"select * from FT_Folder where ComId=" + UserInfo.User.ComId + " and {0} order by CRDate desc ", strWhere1); DataTable dtFLODER = new FT_FolderB().GetDTByCommand(strSQLFLODER); string strWhere2 = strWhere; if (!string.IsNullOrEmpty(P1)) { strWhere2 = string.Format(" FolderID=" + P1); } string strSQLFILE = string.Format(@"select * from FT_File where ComId=" + UserInfo.User.ComId + " and {0} order by CRDate desc ", strWhere2); DataTable dtFILE = new FT_FileB().GetDTByCommand(strSQLFILE); msg.Result = dtFLODER; msg.Result1 = dtFILE; return; } }