市长热线演示版

workordershow.aspx.cs 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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 System.Text;
  8. using System.Data;
  9. using System.IO;
  10. using HySoft.DBUtility;
  11. namespace HySoft.BaseCallCenter.Web.workordermanage.workorder
  12. {
  13. public partial class workordershow : System.Web.UI.Page
  14. {
  15. public string workorderid = "0";
  16. public string workintanceid = "0";
  17. public string html = "";
  18. protected void Page_Load(object sender, EventArgs e)
  19. {
  20. if (!Page.IsPostBack)
  21. {
  22. if (!string.IsNullOrEmpty(Request.QueryString["id"]))
  23. {
  24. workorderid = Request.QueryString["id"].Trim();
  25. Model.T_Wo_WorkOrderBase order = new BLL.T_Wo_WorkOrderBase().GetModel(Convert.ToInt32(workorderid));
  26. if (order != null)
  27. {
  28. workintanceid = order.F_INSTANCEID.ToString();
  29. //绑定工单客户信息
  30. BindCustomerInfo(order.F_CUSTOMERID.ToString());
  31. //绑定工单基本信息
  32. BindWorkOrderBaseInfo(workintanceid);
  33. html = GetFlowList();
  34. }
  35. }
  36. }
  37. }
  38. private void BindCustomerInfo(string customerid)
  39. {
  40. //绑定工单客户信息
  41. int cid = Convert.ToInt32(customerid);
  42. if (cid > 0)
  43. {
  44. Model.T_Cus_CustomerBase tccb = new BLL.T_Cus_CustomerBase().GetModel(cid);
  45. if (tccb != null)
  46. {
  47. if (tccb.F_CustomerName != null)
  48. txtCustomerName.Text = tccb.F_CustomerName.ToString();
  49. //if (tccb.F_CustomerNature != null)
  50. // txtCustomerNature.Text = tccb.F_CustomerNature.ToString();
  51. if (tccb.F_CustomerCode != null)
  52. txtCustomerCode.Text = tccb.F_CustomerCode.ToString();
  53. ////if (tccb.F_ServiceDept != null)
  54. //// txtServiceDept.Text = tccb.F_ServiceDept.ToString();
  55. ////if (tccb.F_CustomerClass != null)
  56. //// txtCustomerClass.Text = tccb.F_CustomerClass.ToString();
  57. ////if (tccb.F_AfterSaleName != null)
  58. //// txtAfterSaleName.Text = tccb.F_AfterSaleName.ToString();
  59. ////if (tccb.F_QualityGuaranteeEndTime != null)
  60. //// txtQualityGuaranteeEndTime.Text = tccb.F_QualityGuaranteeEndTime.ToString();
  61. if (tccb.F_Province != null)
  62. txtProvince.Text = tccb.F_Province.ToString();
  63. if (tccb.F_City != null)
  64. txtProvince.Text += "-" + tccb.F_City.ToString();
  65. //if (tccb.F_SystemType != null)
  66. // txtSystemType.Text = tccb.F_SystemType.ToString();
  67. }
  68. }
  69. }
  70. private void BindWorkOrderBaseInfo(string instanceid)
  71. {
  72. DataTable dt = DbHelperSQL.Query("select * from V_WorkOrderBase where F_INSTANCEID=" + instanceid).Tables[0];
  73. Model.T_Wo_WorkOrderBase order = new BLL.T_Wo_WorkOrderBase().DataTableToList(dt)[0];
  74. if (order != null)
  75. {
  76. if (order.F_WORKORDERLEVELID != null)
  77. {
  78. DataTable dt1 = new BLL.T_Sys_DictionaryValue().GetList("F_DictionaryValueId='" + order.F_WORKORDERLEVELID + "'").Tables[0];
  79. if (dt1.Rows.Count > 0)
  80. {
  81. txtWorkOrderType.Text = dt1.Rows[0]["F_Name"].ToString();
  82. }
  83. }
  84. if (order.F_CODE != null)
  85. txtWorkOrderNum.Text = order.F_CODE;
  86. if (order.F_TypeName != null)
  87. txtCallInType.Text = order.F_TypeName;
  88. if (order.F_CREATEDATE != null)
  89. txtCreateTime.Text = order.F_CREATEDATE.ToString();
  90. if (order.F_Name != null)
  91. txtWorkOrderState.Text = order.F_Name;
  92. //if (order.F_REPAIRLEVELNAME != null)
  93. // txtWorkOrderClass.Text = order.F_REPAIRLEVELNAME;
  94. if (order.F_REPAIRMANNAME != null)
  95. txtCallInName.Text = order.F_REPAIRMANNAME;
  96. if (order.F_REPAIRMANPHONE != null)
  97. txtCallInPhone.Text = order.F_REPAIRMANPHONE;
  98. if (order.F_USERNAME != null)
  99. txtCreateName.Text = order.F_USERNAME;
  100. }
  101. }
  102. #region 根据工单流节点输出HTML
  103. private string GetNoteHtml(int historyid)
  104. {
  105. StringBuilder res = new StringBuilder();
  106. return res.ToString();
  107. }
  108. #endregion
  109. #region 拼接工作流程列表
  110. /// <summary>
  111. /// 拼接工作流程列表
  112. /// </summary>
  113. /// <returns></returns>
  114. protected string GetFlowList()
  115. {
  116. StringBuilder res = new StringBuilder();
  117. DataTable dt=new DataTable();
  118. try
  119. {
  120. string sql = "SELECT * FROM dbo.T_Wo_WorkOrderHistory INNER JOIN dbo.T_Wo_WorkOrderBase "
  121. + "ON dbo.T_Wo_WorkOrderHistory.F_INSTANCEID = dbo.T_Wo_WorkOrderBase.F_INSTANCEID "
  122. + "INNER JOIN dbo.T_Wo_WorkOrderHistoryInfo ON dbo.T_Wo_WorkOrderHistory.F_HISTORYID = dbo.T_Wo_WorkOrderHistoryInfo.F_HISTORYID "
  123. + "WHERE F_INSTANCEID=" + workintanceid.Trim();
  124. dt = new BLL.T_Wo_WorkOrderHistory().GetListView("F_INSTANCEID=" + workintanceid.Trim() + " ORDER BY F_OPTDATE ASC").Tables[0];
  125. //dt = DbHelperSQL.Query(sql).Tables[0];
  126. if (dt != null)
  127. {
  128. hfFlowCount.Value = dt.Rows.Count.ToString();
  129. string ctrl = "~/workordermanage/_controls/ctl_workorderhistrory.ascx";
  130. Control uc_rep = LoadControl(ctrl);
  131. Repeater rptItems = (Repeater)uc_rep.FindControl("rptitems");
  132. rptItems.DataSource = dt;
  133. rptItems.DataBind();
  134. StringWriter sw = new StringWriter(res);
  135. HtmlTextWriter htw = new HtmlTextWriter(sw);
  136. rptItems.RenderControl(htw);
  137. #region
  138. //for (int i = 0; i < dt.Rows.Count; i++)
  139. //{
  140. // res.Append("<div id=\"divOrderFlow" + i.ToString() + "\">");
  141. // res.Append("<input id=\"hfFlowTitle" + i.ToString() + "\" value=\"" + dt.Rows[i]["F_StateName"].ToString().Trim() + ":" + dt.Rows[i]["F_UserName"].ToString().Trim() + "-" + dt.Rows[i]["F_Name"].ToString().Trim() + "\" style=\"display: none;\" />");
  142. // int height = 100;
  143. // res.Append("<table class=\"form_table\" style=\"width: 100%;\">");
  144. // res.Append("<colgroup><col width=\"100\" /><col /><col width=\"100\" /><col /><col width=\"100\" /><col /></colgroup>");
  145. // res.Append("<tr style=\"height:25px;\">");
  146. // res.Append("<th style=\"height:25px; padding:0px 8px 0px 0px;\">操作时间:</th>");
  147. // res.Append("<td style=\"height:25px; padding:2px 0px 0px 8px;\">&nbsp;" + dt.Rows[i]["F_OPTDATE"].ToString().Trim() + "</td>");
  148. // res.Append("<th style=\"height:25px; padding:0px 8px 0px 0px;\">操作人:</th>");
  149. // res.Append("<td style=\"height:25px; padding:2px 0px 0px 8px;\">&nbsp;" + dt.Rows[i]["F_UserName"].ToString().Trim() + "</td>");
  150. // res.Append("<th style=\"height:25px; padding:0px 8px 0px 0px;\">耗时:</th>");
  151. // res.Append("<td style=\"height:25px; padding:2px 0px 0px 8px;\">&nbsp;" + dt.Rows[i]["F_ELAPSEDTIME"].ToString().Trim() + "</td>");
  152. // res.Append("</tr>");
  153. // res.Append("</table>");
  154. // res.Append("<input id=\"hfFlowHeight" + i.ToString() + "\" value=\"" + height.ToString() + "\" style=\"display: none;\" />");
  155. // res.Append("</div>");
  156. //}
  157. #endregion
  158. }
  159. }
  160. catch (Exception ex)
  161. {
  162. }
  163. finally
  164. {
  165. }
  166. return res.ToString();
  167. }
  168. #endregion
  169. }
  170. }