UU跑腿标准版

default.aspx.cs 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using HySoft.Common;
  8. using System.Text;
  9. using System.Web.Services;
  10. namespace HySoft.BaseCallCenter.Web
  11. {
  12. public partial class _default : System.Web.UI.Page
  13. {
  14. private List<Model.T_Sys_ModuleFunctions> moduleFunList = new List<Model.T_Sys_ModuleFunctions>();
  15. protected void Page_Load(object sender, EventArgs e)
  16. {
  17. Response.Expires = -1;
  18. if (!this.IsPostBack)
  19. {
  20. try
  21. {
  22. //检查用户是否已经登录,没有则跳转到登陆页面
  23. LoginUser p_LoginUser = new LoginUser(this.Context);
  24. UserID.Value = p_LoginUser.UserID.ToString();
  25. if (p_LoginUser.UserID == 0)
  26. {
  27. HdIswin.Value = "false";
  28. Response.Redirect("login.aspx", false);
  29. }
  30. else
  31. {
  32. if (p_LoginUser.SeatFlag == "True" || p_LoginUser.SeatFlag == "1")
  33. {
  34. HdIswin.Value = "true";
  35. //ClientScript.RegisterClientScriptBlock(this.GetType(), "", "$.ligerDialog.waitting('电话服务连接中...');");
  36. }
  37. else
  38. {
  39. HdIswin.Value = "false";
  40. }
  41. GetUserInfo();
  42. moduleFunList = new BLL.T_Sys_ModuleFunctions().GetModelList(" F_StateFlag=1 and F_FunctionId in (SELECT F_FunctionId FROM T_Sys_RoleFunction where F_RoleId =" + p_LoginUser.RoleId.ToString() + ")");
  43. this.HdModuleFunIdCount.Value = moduleFunList.Where(mf => mf.F_ParentId == 0).ToList().Count.ToString();
  44. }
  45. }
  46. catch (Exception ex)
  47. {
  48. SysLog.WriteLog(ex);
  49. }
  50. }
  51. }
  52. #region 拼接功能列表
  53. /// <summary>
  54. /// 拼接功能列表
  55. /// </summary>
  56. /// <returns></returns>
  57. protected string GetFunTree()
  58. {
  59. StringBuilder res = new StringBuilder();
  60. string roleId = "";
  61. int i = 1;
  62. try
  63. {
  64. LoginUser p_LoginUser = new LoginUser(this.Context);
  65. if (p_LoginUser.UserID == 0)
  66. {
  67. HdIswin.Value = "false";
  68. Response.Redirect("login.aspx", false);
  69. }
  70. else
  71. {
  72. roleId = p_LoginUser.RoleId.ToString();
  73. moduleFunList.Where(mf => mf.F_ParentId == 0).OrderBy(mm => mm.F_Sort).ToList().ForEach(mff =>
  74. {
  75. res.Append("<div title='<span class=\"" + mff.F_ImgUrl + "\"></span>" + mff.F_Name + "' iconcss='" + mff.F_ImgUrl + "'>");
  76. res.Append("<ul id='tree" + i + "' style='margin-top: 3px; width: 100%;'>");
  77. i++;
  78. moduleFunList.Where(ms => ms.F_ParentId == mff.F_FunctionId).OrderBy(mmm => mmm.F_Sort).ToList().ForEach(msf =>
  79. {
  80. if (msf.F_SysFlag)
  81. {
  82. res.Append("<li style='width: 100%;' id='" + msf.F_FunctionCode.Trim() + "' url='outsysurl.aspx?outurl=" + HttpUtility.UrlEncode(msf.F_OptUrl.Trim()) + "' text='" + msf.F_Name + "'>");
  83. }
  84. else
  85. {
  86. res.Append("<li style='width: 100%;' id='" + msf.F_FunctionCode.Trim() + "' url='" + msf.F_OptUrl + "' text='" + msf.F_Name + "'>");
  87. }
  88. res.Append("<span>");
  89. res.Append(msf.F_Name);
  90. res.Append("</span>");
  91. GetChildren(moduleFunList, res, msf);
  92. res.Append("</li>");
  93. });
  94. res.Append("</ul></div>");
  95. });
  96. }
  97. }
  98. catch (Exception ex)
  99. {
  100. //SysLog.WriteLog(new Exception("[" + DateTime.Now + "]系统导航->读取角色系统功能列表,异常:" + ex.Message));
  101. Response.Redirect("login.aspx");
  102. }
  103. return res.ToString();
  104. }
  105. public void GetChildren(List<Model.T_Sys_ModuleFunctions> modelFunList, StringBuilder sb, Model.T_Sys_ModuleFunctions modelFun)
  106. {
  107. try
  108. {
  109. if (modelFunList.Exists(m => m.F_ParentId == modelFun.F_FunctionId))
  110. {
  111. sb.Append("<ul id='tree" + modelFun.F_FunctionId + "' style='margin-top: 3px; width: 100%;'>");
  112. modelFunList.Where(ms => ms.F_ParentId == modelFun.F_FunctionId).OrderBy(mm => mm.F_Sort).ToList().ForEach(msf =>
  113. {
  114. sb.Append("<li style='width: 100%;' id='" + msf.F_FunctionCode.Trim() + "' url='" + msf.F_OptUrl + "' text='" + msf.F_Name + "'>");
  115. sb.Append("<span>");
  116. sb.Append(msf.F_Name);
  117. sb.Append("</span>");
  118. GetChildren(modelFunList, sb, msf);
  119. sb.Append("</li>");
  120. });
  121. sb.Append("</ul>");
  122. }
  123. }
  124. catch (Exception ex)
  125. {
  126. //SysLog.WriteLog(new Exception("[" + DateTime.Now + "]系统导航->循环功能子菜单,异常:" + ex.Message));
  127. Response.Redirect("login.aspx");
  128. }
  129. }
  130. #endregion
  131. #region 获取登陆坐席的信息
  132. /// <summary>
  133. /// 获取登陆坐席的信息
  134. /// </summary>
  135. private void GetUserInfo()
  136. {
  137. try
  138. {
  139. LoginUser p_User = new LoginUser(this.Context);
  140. if (p_User != null)
  141. {
  142. Model.T_Sys_UserAccount p_LoginUser = new BLL.T_Sys_UserAccount().GetModel(p_User.UserID);
  143. if (p_LoginUser != null)
  144. {
  145. this.lblAgentCode.Text = p_LoginUser.F_UserCode;//用户工号
  146. this.lblAgentName.Text = p_LoginUser.F_UserName;//用户姓名
  147. txtAgentName.Value = p_LoginUser.F_UserName;
  148. this.lblAgentExt.Text = p_User.ExtNo;//分机号
  149. hfUserId.Value = p_LoginUser.F_UserId.ToString();
  150. //--------------------------------------------
  151. txtLabourNo.Value = p_LoginUser.F_WorkNumber.ToString();
  152. txtPhoneID.Value = p_LoginUser.F_UserCode.ToString();
  153. this.txtPhoneNum.Value = p_User.ExtNo;
  154. txtLabourwork.Value = p_LoginUser.F_UserCode;
  155. txtIsAgent.Value = p_User.SeatFlag.ToString().ToLower();
  156. txtAgentRight.Value = p_User.SeatRight;
  157. txtAgentId.Value = p_LoginUser.F_UserId.ToString();
  158. SeatType.Value = p_User.SeatRight;
  159. //2017-02-14 clq 临时修改
  160. txtAgentGroup.Value = p_User.GroupID.ToString();
  161. //if (p_LoginUser.F_HJType == 1)
  162. //{
  163. // txtAgentGroup.Value = "2001";//呼出组
  164. //}
  165. //else
  166. //{
  167. // txtAgentGroup.Value = "1001";//呼入组
  168. //}
  169. string pasword = p_LoginUser.F_Password;
  170. //if (p_User.ExtNo.Trim() == "")
  171. //{
  172. // HdIswin.Value = "false";
  173. //}
  174. if (!string.IsNullOrEmpty(pasword))
  175. {
  176. pwd.Value = pasword;
  177. passwd.Value = pasword;
  178. }
  179. BLL.T_Sys_SystemConfig bll_T_Sys_SystemConfig = new BLL.T_Sys_SystemConfig();
  180. string CTIserverIP = bll_T_Sys_SystemConfig.GetParamValueByParamCode("AcdServerIp");//CTIIP
  181. if (!string.IsNullOrEmpty(CTIserverIP))
  182. {
  183. this.txtMostlyAddress.Value = CTIserverIP;
  184. this.txtSubordinationAddress.Value = CTIserverIP;
  185. }
  186. try
  187. {
  188. string CTIserverPort = bll_T_Sys_SystemConfig.GetParamValueByParamCode("AcdServerPort");//CTIIP
  189. if (!string.IsNullOrEmpty(CTIserverPort))
  190. {
  191. this.txtServerPort.Value = CTIserverPort;
  192. }
  193. }
  194. catch
  195. { }
  196. }
  197. }
  198. }
  199. catch (Exception ex)
  200. {
  201. SysLog.WriteLog(ex);
  202. }
  203. }
  204. #endregion
  205. protected void lbtnExit_Click(object sender, EventArgs e)
  206. {
  207. try
  208. {
  209. CookieUtil.RemoveAllCookies();
  210. }
  211. catch { }
  212. Response.Redirect("login.aspx");
  213. }
  214. [WebMethod]
  215. public static string Get(string id)
  216. {
  217. string panduan = "0";
  218. try
  219. {
  220. System.Data.DataTable dt = DBUtility.DbHelperSQL.Query("select * from V_WorkOrderBase where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderTask where F_LOSEFLAG=0 and F_OWNERID="+id+") and F_WORKORDERSTATEID!=0").Tables[0];
  221. panduan = dt.Rows.Count.ToString();
  222. }
  223. catch { return panduan; }
  224. return panduan;
  225. }
  226. }
  227. }