/// <summary> /// 会议日历视图 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETHYGLVIEW(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string strSql = string.Format("SELECT hygl.ID,hygl.intProcessStanceid,hygl.FQUser,'['+room.Name+']'+hygl.Title+' '+CONVERT(VARCHAR(5),hygl.StartTime,8)+'~'+CONVERT(VARCHAR(5),hygl.EndTime,8) title,hygl.StartTime start,hygl.EndTime [end],CASE when dbo.fn_PDStatus(hygl.intProcessStanceid)='已审批' then 1 when dbo.fn_PDStatus(hygl.intProcessStanceid)='-1' then 1 when dbo.fn_PDStatus(hygl.intProcessStanceid)='正在审批' then 0 end SHStatus from SZHL_HYGL hygl INNER join SZHL_HYGL_ROOM room on hygl.RoomID=room.ID where ( dbo.fn_PDStatus(hygl.intProcessStanceid)='已审批' or dbo.fn_PDStatus(hygl.intProcessStanceid)='正在审批' or dbo.fn_PDStatus(hygl.intProcessStanceid)='-1' ) and hygl.ComId=" + UserInfo.User.ComId); if (P1 != "0") { strSql += string.Format(" and hygl.RoomID={0} ", P1); } msg.Result = new SZHL_YCGLB().GetDTByCommand(strSql); }
/// <summary> /// 获取日志列表 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1">日志类型</param> /// <param name="P2">查询条件</param> /// <param name="strUserName"></param> public void GETGZBGUSERLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string userName = UserInfo.User.UserName; string strUserName = context.Request["username"] ?? "";//经费报销统计中的查看列表需要的参数 if (!string.IsNullOrEmpty(strUserName)) { userName = strUserName; } string strWhere = string.Format(" bg.ComId={0} ", UserInfo.User.ComId); strWhere += string.Format("and bg.CRUser='******'", userName); if (P1 != "")//分类 { strWhere += string.Format("And bg.LeiBie={0}", P1); } if (P2 != "")//内容查询 { strWhere += string.Format(" And (bg.RBContent like '%{0}%' OR bg.CRUserName like '%{0}%' OR bg.BranchName like '%{0}%' )", P2); } int month = 0; int.TryParse(context.Request["month"] ?? "1", out 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 bg.RBDate BETWEEN '{0}' and '{1}'", strTime, endTime); string strSql = string.Format(" Select bg.BranchName,bg.RBContent,bg.RBJSR,bg.RBWCQK,bg.RBDate,bg.LeiBie,bg.CRUser,bg.CRDate,bg.ID,bg.Files,bg.CRUserName,zd.TypeName from SZHL_GZBG bg inner join JH_Auth_ZiDian zd on LeiBie= zd.ID and Class=6 Where {0} order by bg.CRDate desc", strWhere); msg.Result = new SZHL_GZBGB().GetDTByCommand(strSql); }
/// <summary> /// 导出工作报告 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void EXPORTGZBG(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { GETGZBGLIST(context, msg, P1, P2, UserInfo); DataTable dt = msg.Result; string sqlCol = "BranchName|部门,TypeName|类型,RBDate|日期,RBContent|报告内容,TypeName|类型,CRUserName|姓名,RBWCQK|完成情况"; CommonHelp ch = new CommonHelp(); DataTable dt2 = dt.DelTableCol(sqlCol); foreach (DataRow dr in dt2.Rows) { try { dr["报告内容"] = CommonHelp.RemoveHtml(dr["报告内容"].ToString()); dr["完成情况"] = CommonHelp.RemoveHtml(dr["完成情况"].ToString()); } catch (Exception) { } } msg.ErrorMsg = ch.ExportToExcel("工作报告", dt2); }
/// <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.TrimEnd('/') + "/" + qymodel.QYCode + "/document/zipfolder", DATA, 0, "", null); string strData = CommonHelp.GetResponseString(ResponseData); msg.Result = strData; }
/// <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 = "此文件不存在或您没有权限!"; } }
public void GETSHAREINFO(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int ID = 0; int.TryParse(P1, out ID); if (ID > 0) { FT_File_Share Model = new FT_File_ShareB().GetEntity(d => d.ID == ID); if (Model.SharePasd == P2 || Model.ShareType == "0")//公开链接或者输入提取码正确 { string strSql = string.Format(@"SELECT qy.QYName,qy.LogoID,share.CRUserName,share.RefType,share.ShareDueDate,share.CRDate,CASE WHEN share.RefType='file' then f.Name+'.'+f.FileExtendName WHEN share.RefType='wj' THEN folder.Name END Name ,CASE WHEN share.RefType='file' then f.ID WHEN share.RefType='wj' THEN folder.ID END ID ,f.FileExtendName,f.FileSize,share.ComId,f.ISYL,f.FileMD5,qy.FileServerUrl,f.YLUrl from FT_File_Share share INNER join JH_Auth_QY qy on share.ComId=qy.ComId LEFT join FT_File f on share.RefID=f.ID and share.ComId=f.ComId and share.RefType='file' LEFT join FT_Folder folder on share.RefID=folder.ID and share.RefType='wj' where share.ID={0} and share.IsDel!='Y'", ID); DataTable dt = new FT_File_ShareB().GetDTByCommand(strSql); if (dt.Rows.Count > 0) { DateTime dueDate = DateTime.Now; if (DateTime.TryParse(dt.Rows[0]["ShareDueDate"].ToString(), out dueDate) && dueDate > DateTime.Now) { msg.Result = dt; } else { msg.ErrorMsg = "分享已过期"; } } else { msg.ErrorMsg = "分享已取消"; } } else { msg.Result = 1; msg.ErrorMsg = "提取码有误,请重新输入"; } } }
//分享页面根据文件夹Id获取文件列表 public void GETFILELIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int FolderID = int.Parse(P1);// int ComId = int.Parse(P2); msg.Result = new FT_FolderB().GetEntities(d => d.ComId == ComId && d.PFolderID == FolderID); msg.Result1 = new FT_FileB().GetEntities(d => d.ComId == ComId && d.FolderID == FolderID); return; }
//添加修改数据集 public void ADDBIDBSET(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { var tt = JsonConvert.DeserializeObject <BI_DB_Set>(P1); if (tt.ID == 0) { tt.CRUser = UserInfo.User.UserName; tt.CRDate = DateTime.Now; new BI_DB_SetB().Insert(tt); } else { tt.UPDate = DateTime.Now; new BI_DB_SetB().Update(tt); } msg.Result = tt; }
//删除数据集 public void DELBIDBSET(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { try { int ID = int.Parse(P1); new BI_DB_SetB().Delete(d => d.ID == ID); new BI_DB_DimB().Delete(d => d.STID == ID); } catch (Exception ex) { msg.ErrorMsg = ex.Message; } }
/// <summary> /// 仪表盘页面使用数据集数据 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETYBDATASET(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { try { DataTable dt = new BI_DB_SetB().GetDTByCommand("select * from BI_DB_Set ORDER BY ID DESC"); dt.Columns.Add("wd", Type.GetType("System.Object")); dt.Columns.Add("dl", Type.GetType("System.Object")); for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["wd"] = new BI_DB_SetB().GetDTByCommand("select * from BI_DB_Dim WHERE STID='" + dt.Rows[i]["ID"].ToString() + "' AND Dimension='1' ORDER BY ColumnName"); dt.Rows[i]["dl"] = new BI_DB_SetB().GetDTByCommand("select * from BI_DB_Dim WHERE STID='" + dt.Rows[i]["ID"].ToString() + "' AND Dimension='2' ORDER BY ColumnName"); } msg.Result = dt; } catch (Exception ex) { msg.ErrorMsg = ex.Message; } }
//获取数据集 public void GETBIDBSETLIST(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string userName = UserInfo.User.UserName; string strWhere = " 1=1 "; 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 BI_DB_SetB().GetDataPager(" BI_DB_Set T left join BI_DB_Source S on T.SID=S.ID ", " T.*,S.Name AS SJY,S.DBType ", pagecount, page, " T.CRDate desc ", strWhere, ref total); msg.Result = dt; msg.Result1 = total; msg.Result2 = new BI_DB_SourceB().GetEntities(d => d.DBType == "SQLSERVER"); }
/// <summary> /// 会议发送提醒信息 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void SENDWXMSG_TX(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { var tx = JsonConvert.DeserializeObject <SZHL_TXSX>(P1); int msgid = Int32.Parse(tx.MsgID); UserInfo = new JH_Auth_UserB().GetUserInfo(tx.ComId.Value, tx.CRUser); var model = new SZHL_HYGLB().GetEntity(p => p.ID == msgid && p.ComId == UserInfo.User.ComId); if (model != null) { var rm = new SZHL_HYGL_ROOMB().GetEntity(p => p.ID == model.RoomID && p.ComId == UserInfo.User.ComId); Article ar0 = new Article(); ar0.Title = "会议提醒"; ar0.Description = "发起人:" + UserInfo.User.UserRealName + "\r\n您有会议[" + model.Title + "],会议室[" + rm.Name + "],将于" + model.StartTime.Value.ToString("yyyy-MM-dd HH:mm") + "开始,请及时参加"; ar0.Url = model.ID.ToString(); List <Article> al = new List <Article>(); al.Add(ar0); string jsr = string.Empty; if (!string.IsNullOrEmpty(model.FQUser)) { jsr = model.FQUser; } if (!string.IsNullOrEmpty(model.CYUser)) { if (!string.IsNullOrEmpty(jsr)) { jsr = jsr + "," + model.CYUser; } else { jsr = model.CYUser; } } if (!string.IsNullOrEmpty(model.ZCUser)) { if (!string.IsNullOrEmpty(jsr)) { jsr = jsr + "," + model.ZCUser; } else { jsr = model.ZCUser; } } if (!string.IsNullOrEmpty(model.JLUser)) { if (!string.IsNullOrEmpty(jsr)) { jsr = jsr + "," + model.JLUser; } else { jsr = model.JLUser; } } if (!string.IsNullOrEmpty(model.SXUser)) { if (!string.IsNullOrEmpty(jsr)) { jsr = jsr + "," + model.SXUser; } else { jsr = model.SXUser; } } ////发送消息 string content = ar0.Description; new JH_Auth_User_CenterB().SendMsg(UserInfo, "HYGL", content, model.ID.ToString(), jsr, "B", model.intProcessStanceid, tx.ISCS); if (!string.IsNullOrEmpty(jsr)) { WXHelp wx = new WXHelp(UserInfo.QYinfo); wx.SendTH(al, "HYGL", "A", jsr); } } }
/// <summary> /// 会议管理发送消息 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void SENDWXMSG(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { var tx = JsonConvert.DeserializeObject <SZHL_TXSX>(P1); int msgid = Int32.Parse(tx.MsgID); UserInfo = new JH_Auth_UserB().GetUserInfo(tx.ComId.Value, tx.CRUser); var model = new SZHL_HYGLB().GetEntity(p => p.ID == msgid && p.ComId == UserInfo.User.ComId); if (model != null) { var user = new JH_Auth_UserB().GetUserByUserName(model.ComId.Value, model.CRUser); var rm = new SZHL_HYGL_ROOMB().GetEntity(p => p.ID == model.RoomID && p.ComId == UserInfo.User.ComId); Article ar0 = new Article(); ar0.Title = "会议通知"; ar0.Description = "发起人:" + user.UserRealName + "\r\n您有新的会议[" + model.Title + "],会议室[" + rm.Name + "],请尽快查看吧"; ar0.Url = model.ID.ToString(); List <Article> al = new List <Article>(); al.Add(ar0); string jsr = string.Empty; if (!string.IsNullOrEmpty(model.FQUser)) { jsr = model.FQUser; } if (!string.IsNullOrEmpty(model.CYUser)) { if (!string.IsNullOrEmpty(jsr)) { jsr = jsr + "," + model.CYUser; } else { jsr = model.CYUser; } } if (!string.IsNullOrEmpty(model.ZCUser)) { if (!string.IsNullOrEmpty(jsr)) { jsr = jsr + "," + model.ZCUser; } else { jsr = model.ZCUser; } } if (!string.IsNullOrEmpty(model.JLUser)) { if (!string.IsNullOrEmpty(jsr)) { jsr = jsr + "," + model.JLUser; } else { jsr = model.JLUser; } } if (!string.IsNullOrEmpty(model.SXUser)) { if (!string.IsNullOrEmpty(jsr)) { jsr = jsr + "," + model.SXUser; } else { jsr = model.SXUser; } } UserInfo = new JH_Auth_UserB().GetUserInfo(model.ComId.Value, model.CRUser); if (!string.IsNullOrEmpty(jsr)) { //发送消息 string content = user.UserRealName + "邀请您参加会议:" + model.Title; new JH_Auth_User_CenterB().SendMsg(UserInfo, "HYGL", content, model.ID.ToString(), jsr, "B", model.intProcessStanceid, tx.ISCS); WXHelp wx = new WXHelp(UserInfo.QYinfo); wx.SendTH(al, "HYGL", "A", jsr); } if (model.TXSJ > 0) { DateTime dt = model.StartTime.ToDateTime().AddMinutes(-model.TXSJ.Value); SZHL_TXSX tx1 = new SZHL_TXSX(); tx1.ComId = model.ComId; tx1.APIName = "HYGL"; tx1.MsgID = model.ID.ToString(); tx1.FunName = "SENDWXMSG_TX"; tx1.Date = dt.ToString("yyyy-MM-dd HH:mm:ss"); tx1.CRUser = model.CRUser; tx1.CRDate = DateTime.Now; TXSX.TXSXAPI.AddALERT(tx1); //时间为发送时间 //TXSX.TXSXAPI.AddALERT(UserInfo.User.ComId.Value, "HYGL", "SENDWXMSG_TX", model.ID.ToString(), 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 GETRYLIST_PAGE(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int page = 0; int.TryParse(context.Request.QueryString["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; }
public void FINDPASSWORD(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { //string userpass = context.Request["pass"]; //if (P1 == "1") //{ // string ComId = context.Request["ComId"]; // int qyId = 0; // int.TryParse(ComId, out qyId); // JH_Auth_QY qymodel = new JH_Auth_QYB().GetEntity(d => d.ComId == qyId); // if (qymodel != null) // { // JH_Auth_User userInfo = new JH_Auth_UserB().GetEntity(d => d.mobphone == P2 && d.ComId == qymodel.ComId); // userInfo.UserPass = CommonHelp.GetMD5(userpass); // new JH_Auth_UserB().Update(userInfo); // msg.Result = qymodel.QYCode; // } //} //else //{ // JH_Auth_User userInfo = new JH_Auth_UserB().GetEntity(d => d.mobphone == P2); // userInfo.UserPass = CommonHelp.GetMD5(userpass); // new JH_Auth_UserB().Update(userInfo); //} }
public void GETBIDBSET(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { try { int ID = int.Parse(P1); msg.Result = new BI_DB_SetB().GetEntity(d => d.ID == ID); msg.Result1 = new BI_DB_DimB().GetEntities(d => d.STID == ID && d.Dimension == "1"); msg.Result2 = new BI_DB_DimB().GetEntities(d => d.STID == ID && d.Dimension == "2"); } catch (Exception ex) { msg.ErrorMsg = ex.Message; } }
/// <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) { 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 UPBIDSET(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { try { string WD = context.Request["WD"] ?? ""; string DL = context.Request["DL"] ?? ""; var tt = JsonConvert.DeserializeObject <BI_DB_Set>(P1); tt.UPDate = DateTime.Now; new BI_DB_SetB().Update(tt); List <BI_DB_Dim> ListWD = JsonConvert.DeserializeObject <List <BI_DB_Dim> >(WD); List <BI_DB_Dim> ListDL = JsonConvert.DeserializeObject <List <BI_DB_Dim> >(DL); new BI_DB_DimB().Delete(D => D.STID == tt.ID); ListWD.ForEach(D => D.CRDate = DateTime.Now); ListWD.ForEach(D => D.CRUser = UserInfo.User.UserName); ListDL.ForEach(D => D.CRDate = DateTime.Now); ListDL.ForEach(D => D.CRUser = UserInfo.User.UserName); new BI_DB_DimB().Insert(ListWD); new BI_DB_DimB().Insert(ListDL); } catch (Exception ex) { msg.ErrorMsg = ex.Message; } }
public void CHECKREGISTERPHONE(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { var qy2 = new JH_Auth_QYB().GetEntities(p => p.Mobile == P1.Trim()); if (qy2.Count() > 0) { 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 SENDCHKMSG(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { //if (!string.IsNullOrEmpty(P1)) //{ // string code = CommonHelp.numcode(4); // try // { // string type = context.Request["type"] ?? ""; // string content = ""; // switch (type) // { // case "changeadmin": // content = "您更换超级管理员的验证码为:" + code + ",如非本人操作,请忽略本短信"; // break; // default: // content = "注册验证码:" + code + ",如非本人操作,请忽略本短信"; // break; // } // CommonHelp.SendSMS(P1, content, 0); // msg.Result = CommonHelp.GetMD5(code); // } // catch // { // 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 ISPUBLIC(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int ID = int.Parse(P1);// FT_File_Share Model = new FT_File_ShareB().GetEntity(d => d.ID == ID && d.IsDel != "Y"); msg.Result = Model.ShareType; }
/// <summary> /// 验证企业名称 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void YZQYMC(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { if (!string.IsNullOrEmpty(P1)) { var qy = new JH_Auth_QYB().GetEntity(p => p.QYName == P1); if (qy != null) { msg.ErrorMsg = "企业名称已存在"; } } }
public void REGISTERYSOLD(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { JH_Auth_QY QY = new JH_Auth_QYB().GetEntity(d => d.ComId == 10334); QY.CRDate = DateTime.Now.AddYears(-2); QY.QYProfile = QY.FileServerUrl; QY.FileServerUrl = ""; QY.IsUseWX = "N"; new JH_Auth_QYB().Update(QY); msg.Result = QY; }
/// <summary> /// 获取企业信息 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETQYINFO(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string qycode = context.Request["qycode"]; //string qycode = "2072782222"; JH_Auth_QY Qyinfo = new JH_Auth_QYB().GetEntity(d => d.QYCode == qycode); if (Qyinfo == null) { msg.ErrorMsg = "没有找到该企业"; } else { msg.Result = Qyinfo; //WXHelp wx = new WXHelp(Qyinfo); //var list = wx.GetAppList().agentlist.Select(p => new { id = p.agentid, info = wx.GetAPPinfo(Int32.Parse(p.agentid)) }); //wx.WX_WxCreateMenuNew(138, "GZBG"); //msg.Result1 = list; } }
public void REGISTERYS(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string strXM = P2; string strPhone = P1; JH_Auth_User user1 = new JH_Auth_UserB().GetUserByUserName(10334, P1); if (user1 != null) { msg.ErrorMsg = "用户已存在"; return; } JH_Auth_User user = new JH_Auth_User(); user.UserName = strPhone; user.mobphone = strPhone; user.UserRealName = P2; user.UserPass = CommonHelp.GetMD5("abc123"); user.ComId = 10334; user.BranchCode = 1728; user.CRDate = DateTime.Now; user.CRUser = "******"; user.logindate = DateTime.Now; user.IsUse = "Y"; if (!new JH_Auth_UserB().Insert(user)) { msg.ErrorMsg = "添加用户失败"; } else { JH_Auth_QY QY = new JH_Auth_QYB().GetEntity(d => d.ComId == 10334); WXHelp wx = new WXHelp(QY); wx.WX_CreateUser(user); //添加默认员工角色 JH_Auth_UserRole Model = new JH_Auth_UserRole(); Model.UserName = user.UserName; Model.RoleCode = 1219; Model.ComId = user.ComId; new JH_Auth_UserRoleB().Insert(Model); } }
public void CHECKPHONE(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { //string ComId = context.Request["comId"] ?? ""; //int id = 0; //int.TryParse(ComId, out id); //if (id > 0) //{ // List<JH_Auth_User> userList = new JH_Auth_UserB().GetEntities(d => d.mobphone == P2 && d.ComId == id).ToList(); // JH_Auth_User user = new JH_Auth_UserB().GetEntity(d => d.mobphone == P2 && d.ComId == id); // if (userList.Count != 1) // { // msg.ErrorMsg = "此手机号无效"; // } //} //else //{ // List<JH_Auth_User> userList = new JH_Auth_UserB().GetEntities(d => d.mobphone == P2).ToList(); // if (userList.Count == 0) // { // msg.ErrorMsg = "此手机号无效"; // } // else if (userList.Count > 1) // { // msg.ErrorMsg = "-1"; // } //} }
public void ProcessRequest(HttpContext context, ref Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { MethodInfo methodInfo = typeof(GZBGManage).GetMethod(msg.Action.ToUpper()); GZBGManage model = new GZBGManage(); methodInfo.FastInvoke(model, new object[] { context, msg, P1, P2, UserInfo }); }
//找回密码验证二级域名 public void FINDYZQYYM(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { //if (!string.IsNullOrEmpty(P1)) //{ // if (P1.ToLower() == "www" || P1.ToLower() == "saas") //www及saas不让用户注册 // { // msg.ErrorMsg = "二级域名无效"; // return; // } // var qy = new JH_Auth_QYB().GetEntity(p => p.QYCode == P1); // if (qy == null) // { // msg.ErrorMsg = "二级域名不存在"; // } // else // { // msg.Result = qy.ComId; // } //} }
/// <summary> /// 添加工作日志 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="strUserName"></param> public void ADDGZBG(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { SZHL_GZBG GZBG = JsonConvert.DeserializeObject <SZHL_GZBG>(P1); if (GZBG == null) { msg.ErrorMsg = "添加失败"; return; } if (string.IsNullOrWhiteSpace(GZBG.RBContent)) { msg.ErrorMsg = "日报内容不能为空"; return; } if (GZBG.LeiBie == null) { msg.ErrorMsg = "日报类型不能为空"; return; } if (P2 != "") // 处理微信上传的图片 { string fids = new FT_FileB().ProcessWxIMG(P2, "GZBG", UserInfo); if (!string.IsNullOrEmpty(GZBG.Files)) { GZBG.Files += "," + fids; } else { GZBG.Files = fids; } } if (GZBG.ID == 0) { GZBG.CRDate = DateTime.Now; GZBG.CRUser = UserInfo.User.UserName; GZBG.CRUserName = UserInfo.User.UserRealName; GZBG.BranchName = UserInfo.BranchInfo.DeptName; GZBG.ComId = UserInfo.User.ComId; new SZHL_GZBGB().Insert(GZBG); //发送消息给传送人 if (!string.IsNullOrEmpty(GZBG.ChaoSongUser)) { SZHL_TXSX CSTX = new SZHL_TXSX(); CSTX.Date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); CSTX.APIName = "GZBG"; CSTX.ComId = UserInfo.User.ComId; CSTX.FunName = "SENDGZBG"; CSTX.CRUserRealName = UserInfo.User.UserRealName; CSTX.MsgID = GZBG.ID.ToString(); CSTX.TXContent = UserInfo.User.UserRealName + "抄送一个工作报告,请您查阅"; CSTX.ISCS = "Y"; CSTX.TXUser = GZBG.ChaoSongUser; CSTX.TXMode = "GZBG"; CSTX.CRUser = UserInfo.User.UserName; TXSX.TXSXAPI.AddALERT(CSTX); //时间为发送时间 } } else { new SZHL_GZBGB().Update(GZBG); } msg.Result = 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 UPDATEHYJL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int Id = int.Parse(P1); string jlfiles = context.Request.Params["JLFiles"]; var hy = new SZHL_HYGLB().GetEntity(p => p.ComId == UserInfo.User.ComId && p.ID == Id); if (hy != null) { hy.HYJL = P2; hy.JLFiles = jlfiles; new SZHL_HYGLB().Update(hy); } }