private void BindData() { HYTD.BLL.Call_VisitBillBLL VBll = new HYTD.BLL.Call_VisitBillBLL(); HYTD.BLL.Call_CustomerBLL CBll = new HYTD.BLL.Call_CustomerBLL(); HYTD.BLL.Call_WorkBillBLL WBll = new HYTD.BLL.Call_WorkBillBLL(); Call_WorkBill wbModel = new Call_WorkBill(); if (VID > 0) { //获取工单信息 vModel = VBll.GetCall_VisitBillEntity(VID); WID = vModel.CVB_CWB_ID; } else if (WID > 0) { wbModel = WBll.GetCall_WorkBillEntity(WID); vModel.CVB_CallInEmail = wbModel.CWB_CallInEmail; vModel.CVB_CallInTel = wbModel.CWB_CallInTel; vModel.CVB_CallInUserName = wbModel.CWB_CallInUserName; vModel.CVB_CallType = wbModel.CWB_CallType; vModel.CVB_CCID = wbModel.CWB_CCID; vModel.CVB_Creater = wbModel.CWB_Creater; vModel.CVB_CreateTime = wbModel.CWB_CreateTime; vModel.CVB_Description = wbModel.CWB_Description; vModel.CVB_ForUser = wbModel.CWB_ForUser; vModel.CVB_OperationTime = wbModel.CWB_OperationTime; vModel.CVB_OperationUser = wbModel.CWB_OperationUser; vModel.CVB_Remark = wbModel.CWB_Remark; vModel.CVB_ServiceType = wbModel.CWB_ServiceType; vModel.CVB_SoftType = wbModel.CWB_SoftType; vModel.CVB_Solution = wbModel.CWB_Solution; vModel.CVB_Status = wbModel.CWB_Status; vModel.CVB_Type = wbModel.CWB_Type; } if (vModel == null) { vModel = new Call_VisitBill(); } CID = vModel.CVB_CCID; intWorkBill = vModel.CVB_Type; if (vModel.CVB_ServiceType != null) { intServiceType = vModel.CVB_ServiceType.Value; } if (vModel.CVB_SoftType != null) { intSoftWare = vModel.CVB_SoftType.Value; } if (vModel.CVB_CallType != null) { intConsultType = vModel.CVB_CallType.Value; } if (vModel.CVB_Status != null) { intStatus = vModel.CVB_Status.Value; } UserInfoBLL userBll = new UserInfoBLL(); strUserName = userBll.GetUserInfoEntityByUserCode(vModel.CVB_Creater); strCreateTime = getDateToString(vModel.CVB_CreateTime); if (vModel.CVB_OperationTime != null) { strOptionTime = getDateToString(vModel.CVB_OperationTime.Value); } else { strOptionTime = getDateToString(DateTime.Now); } intCreater = vModel.CVB_Creater; if (vModel.CVB_ForUser != null && vModel.CVB_ForUser.Value > 0) { intForUser = vModel.CVB_ForUser.Value; } if (vModel.CVB_VisitTime != null) { strVisitTime = getDateToString(vModel.CVB_VisitTime.Value); } else { strVisitTime = getDateToString(DateTime.Now); } //else //{ // strUserName = CurrentUserInfo.UserName; // strOptionTime = getDateToString(DateTime.Now); // strCreateTime = strOptionTime; // intCreater = Convert.ToInt32(CurrentUserInfo.UserCode); // intForUser = intCreater; //} //获取客户信息 cModel = CBll.GetCall_CustomerEntity(CID); if (cModel == null) { cModel = new Call_Customer(); } strUserName = CurrentUserInfo.UserName; }
private void DataBind() { Call_VisitBillTO sto = new Call_VisitBillTO(); #region 条件 if (!string.IsNullOrEmpty(Request["cname"])) { sto.CVB_Remark = Request["cname"].ToString().Trim();//存客户名称 } if (!string.IsNullOrEmpty(Request["uname"])) { sto.CVB_Solution = Request["uname"].ToString().Trim();//存用户名称 } else { sto.CVB_Solution = strLoginUserName; } if (!string.IsNullOrEmpty(Request["Owner"])) //存 客户所属工程师 { sto.CVB_Description = Request["Owner"].ToString().Trim(); } if (!string.IsNullOrEmpty(Request["stime"])) { DateTime dtStime = Convert.ToDateTime("1980-01-01"); DateTime.TryParse(Request["stime"].ToString().Trim(), out dtStime); sto.CVB_CreateTime = dtStime;//保存操作开始时间 } if (!string.IsNullOrEmpty(Request["etime"])) { DateTime dtEtime = Convert.ToDateTime("2250-01-01"); DateTime.TryParse(Request["etime"].ToString().Trim(), out dtEtime); sto.CVB_OperationTime = dtEtime;//保存操作结束时间 } if (!string.IsNullOrEmpty(Request["sltType"])) { sto.CVB_Type = Convert.ToInt16(Request["sltType"].ToString().Trim()); intSelected = sto.CVB_Type; } #endregion if (!string.IsNullOrEmpty(Request.QueryString["pageIndex"])) { int.TryParse(Request.QueryString["pageIndex"], out pageIndex); } HYTD.BLL.Call_VisitBillBLL bll = new HYTD.BLL.Call_VisitBillBLL(); DataTable dt = bll.GetCall_VisitBillList(sto, pageIndex, pageSize, "", out rowCount); //分页 string getUrl = ""; if (Request.Url.Query.Length > 0 && Request.Url.Query.IndexOf("pageIndex") > -1 && Request.Url.Query.IndexOf("&") > -1) { getUrl = Request.Url.Query.Substring(Request.Url.Query.IndexOf("&")); } else if (Request.Url.Query.Length > 0) { getUrl = Request.Url.Query.Substring(1); } string url = "VisitBillList.aspx?pageIndex={0}&" + getUrl.Trim('&'); strtt = DividePage.Pager(pageSize, rowCount, pageIndex, url); if (dt.Rows.Count > 0) { StringBuilder sbContent = new StringBuilder(); string strNew = string.Empty; string strEdit = string.Empty; foreach (DataRow dr in dt.Rows) { strNew = string.Empty;; strEdit = string.Format("<a href=\"#\" name=\"EditWorkBill\" onclick=\"EditWorkBill({0},{1})\">修改</a>", dr["CVB_ID"].ToString(), dr["CVB_CWB_ID"].ToString()); sbContent.AppendFormat("<tbody>"); sbContent.AppendFormat("<tr>"); sbContent.AppendFormat("<td class=\"num\" title=\"{0}\">{0} </td>", dr["C_Name"].ToString()); sbContent.AppendFormat("<td class=\"by\" style=\"width:120px;\" title=\"{0}\">{0} </td>", dr["CC_Name"]); sbContent.AppendFormat("<td class=\"num\" title=\"{0}\">{0} </td>", dr["CWB_CallInUserName"]); sbContent.AppendFormat("<td class=\"num\" title=\"{0}\">{0} </td>", dr["CWB_CallInTel"]); sbContent.AppendFormat("<td class=\"num\" title=\"{0}\">{0} </td>", dr["CreateUserName"]); sbContent.AppendFormat("<td class=\"num\" style=\"width:100px;\" title=\"{0}\">{0} </td>", getDataFormate(dr["CVB_CreateTime"].ToString())); sbContent.AppendFormat("<td class=\"num\" title=\"{0}\">{0} </td>", dr["ServiceUserName"]); sbContent.AppendFormat("<td class=\"num\" style=\"width:100px;\" title=\"{0}\">{0} </td>", getDataFormate(dr["CVB_OperationTime"].ToString())); sbContent.AppendFormat("<td class=\"num\" title=\"{0}\">{0} </td>", dr["CVB_Status"].ToString()); sbContent.AppendFormat("<td class=\"num\" title=\"{0}\">{0} </td>", "服务记录"); sbContent.AppendFormat("<td class=\"num\">{0} </td>", strNew + strEdit); sbContent.AppendFormat("</tr>"); sbContent.AppendFormat("</tbody>"); } script = sbContent.ToString(); } else { script = "没有搜索到相关内容!"; } //获取当前页 //if (rowCount % pageSize == 0) //{ // pageNum = rowCount / pageSize; //} //else //{ // pageNum = (rowCount / pageSize) + 1; //} }