市长热线演示版

workordervipshow.aspx.cs 8.4KB

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