using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Data;
using System.IO;
using HySoft.DBUtility;
namespace HySoft.BaseCallCenter.Web.workordermanage.workorder
{
public partial class workordershow : System.Web.UI.Page
{
public string workorderid = "0";
public string workintanceid = "0";
public string html = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (!string.IsNullOrEmpty(Request.QueryString["id"]))
{
workorderid = Request.QueryString["id"].Trim();
Model.T_Wo_WorkOrderBase order = new BLL.T_Wo_WorkOrderBase().GetModel(Convert.ToInt32(workorderid));
if (order != null)
{
workintanceid = order.F_INSTANCEID.ToString();
//绑定工单客户信息
BindCustomerInfo(order.F_CUSTOMERID.ToString());
//绑定工单基本信息
BindWorkOrderBaseInfo(workintanceid);
html = GetFlowList();
}
}
}
}
private void BindCustomerInfo(string customerid)
{
//绑定工单客户信息
int cid = Convert.ToInt32(customerid);
if (cid > 0)
{
Model.T_Cus_CustomerBase tccb = new BLL.T_Cus_CustomerBase().GetModel(cid);
if (tccb != null)
{
if (tccb.F_CustomerName != null)
txtCustomerName.Text = tccb.F_CustomerName.ToString();
//if (tccb.F_CustomerNature != null)
// txtCustomerNature.Text = tccb.F_CustomerNature.ToString();
if (tccb.F_CustomerCode != null)
txtCustomerCode.Text = tccb.F_CustomerCode.ToString();
////if (tccb.F_ServiceDept != null)
//// txtServiceDept.Text = tccb.F_ServiceDept.ToString();
////if (tccb.F_CustomerClass != null)
//// txtCustomerClass.Text = tccb.F_CustomerClass.ToString();
////if (tccb.F_AfterSaleName != null)
//// txtAfterSaleName.Text = tccb.F_AfterSaleName.ToString();
////if (tccb.F_QualityGuaranteeEndTime != null)
//// txtQualityGuaranteeEndTime.Text = tccb.F_QualityGuaranteeEndTime.ToString();
if (tccb.F_Province != null)
txtProvince.Text = tccb.F_Province.ToString();
if (tccb.F_City != null)
txtProvince.Text += "-" + tccb.F_City.ToString();
//if (tccb.F_SystemType != null)
// txtSystemType.Text = tccb.F_SystemType.ToString();
}
}
}
private void BindWorkOrderBaseInfo(string instanceid)
{
DataTable dt = DbHelperSQL.Query("select * from V_WorkOrderBase where F_INSTANCEID=" + instanceid).Tables[0];
Model.T_Wo_WorkOrderBase order = new BLL.T_Wo_WorkOrderBase().DataTableToList(dt)[0];
if (order != null)
{
if (order.F_WORKORDERLEVELID != null)
{
DataTable dt1 = new BLL.T_Sys_DictionaryValue().GetList("F_DictionaryValueId='" + order.F_WORKORDERLEVELID + "'").Tables[0];
if (dt1.Rows.Count > 0)
{
txtWorkOrderType.Text = dt1.Rows[0]["F_Name"].ToString();
}
}
if (order.F_CODE != null)
txtWorkOrderNum.Text = order.F_CODE;
if (order.F_TypeName != null)
txtCallInType.Text = order.F_TypeName;
if (order.F_CREATEDATE != null)
txtCreateTime.Text = order.F_CREATEDATE.ToString();
if (order.F_Name != null)
txtWorkOrderState.Text = order.F_Name;
//if (order.F_REPAIRLEVELNAME != null)
// txtWorkOrderClass.Text = order.F_REPAIRLEVELNAME;
if (order.F_REPAIRMANNAME != null)
txtCallInName.Text = order.F_REPAIRMANNAME;
if (order.F_REPAIRMANPHONE != null)
txtCallInPhone.Text = order.F_REPAIRMANPHONE;
if (order.F_USERNAME != null)
txtCreateName.Text = order.F_USERNAME;
}
}
#region 根据工单流节点输出HTML
private string GetNoteHtml(int historyid)
{
StringBuilder res = new StringBuilder();
return res.ToString();
}
#endregion
#region 拼接工作流程列表
///
| 操作时间: | "); // res.Append("" + dt.Rows[i]["F_OPTDATE"].ToString().Trim() + " | "); // res.Append("操作人: | "); // res.Append("" + dt.Rows[i]["F_UserName"].ToString().Trim() + " | "); // res.Append("耗时: | "); // res.Append("" + dt.Rows[i]["F_ELAPSEDTIME"].ToString().Trim() + " | "); // res.Append("
|---|