private void getDateModel(int intCID) { cModel = ccBll.GetCall_CustomerEntity(intCID); if (intCID > 0) { intCounts = WBll.GetCall_WorkBillCounts(CID); } strForUser = PublicMethod.UserInfoList(cModel.CC_Owner); int intCount = 0; DataTable dt = WBll.GetCall_WorkBillList("CWB_CCID=" + CID, 1, 1, "CWB_ID desc", out intCount); if (dt.Rows.Count > 0) { DateTime dtime = DateTime.MinValue; DateTime.TryParse(dt.Rows[0]["CWB_CreateTime"].ToString().Trim(), out dtime); strLastServiceTime = dtime.ToString("yyyy-MM-dd HH:mm"); } }
private void DataBind() { Call_WorkBillTO sto = new Call_WorkBillTO(); #region 条件 if (!string.IsNullOrEmpty(Request["code"])) { sto.CWB_Code = Request["code"].ToString().Trim();//存 客户名称 } if (!string.IsNullOrEmpty(Request["cname"])) { sto.CWB_Remark = Request["cname"].ToString().Trim();//存 客户名称 } if (!string.IsNullOrEmpty(Request["uname"])) { sto.CWB_Solution = Request["uname"].ToString().Trim();//存 用户名称 } else { sto.CWB_Solution = strLoginUserName; } if (!string.IsNullOrEmpty(Request["stime"])) { DateTime dtStime = Convert.ToDateTime("1980-01-01"); DateTime.TryParse(Request["stime"].ToString().Trim(), out dtStime); sto.CWB_CreateTime = dtStime;//保存操作开始时间 } if (!string.IsNullOrEmpty(Request["etime"])) { DateTime dtEtime = Convert.ToDateTime("2250-01-01"); DateTime.TryParse(Request["etime"].ToString().Trim(), out dtEtime); sto.CWB_OperationTime = dtEtime;//保存操作结束时间 } if (!string.IsNullOrEmpty(Request["Owner"])) //存 客户所属工程师 { sto.CWB_Description = Request["Owner"].ToString().Trim(); } if (!string.IsNullOrEmpty(Request["sltType"])) { sto.CWB_Type = Convert.ToInt16(Request["sltType"].ToString().Trim()); intSelected = sto.CWB_Type; } if (!string.IsNullOrEmpty(Request["status"])) { int intStatus = 0; int.TryParse(Request["status"].ToString().Trim(), out intStatus); sto.CWB_Status = intStatus; intSelected = sto.CWB_Type; } #endregion if (!string.IsNullOrEmpty(Request.QueryString["pageIndex"])) { int.TryParse(Request.QueryString["pageIndex"], out pageIndex); } HYTD.BLL.Call_WorkBillBLL bll = new HYTD.BLL.Call_WorkBillBLL(); DataTable dt = bll.GetCall_WorkBillList(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 = "WorkBillList.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.Format("<a href=\"javascript:;\" name=\"NewWorkBill\" onclick=\"NewWorkBill({0})\" >新建</a> ", dr["CC_ID"]); strEdit = string.Format("<a href=\"javascript:;\" name=\"EditWorkBill\" onclick=\"EditWorkBill({0})\">修改</a>", dr["CWB_ID"].ToString()); if (dr["CWB_Status"].ToString() != ((int)PublicEnum.CallWorkBillStatus.Visited).ToString()) { strEdit += string.Format(" <a href=\"javascript:;\" name=\"EditWorkBill\" onclick=\"HuifangWorkBill({0})\">回访</a>", dr["CWB_ID"].ToString()); } sbContent.AppendFormat("<tbody>"); if (dr["CWB_Status"].ToString() == "服务中") { sbContent.AppendFormat("<tr style=\"color:red;\">"); } else { sbContent.AppendFormat("<tr>"); } sbContent.AppendFormat("<td class=\"num\" title=\"{0}\"><a href=\"javascript:;\" onclick=\"ShowWorkBill({1})\">{0}</a></td>", dr["CWB_Code"].ToString(), dr["CWB_ID"].ToString()); 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["CWB_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["CWB_OperationTime"].ToString())); sbContent.AppendFormat("<td class=\"num\" title=\"{0}\">{0} ({1})</td>", dr["CWB_Status"].ToString(), dr["MYDStatus"].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; //} }
public void toList(string strMessage, string strErrorCode, string UserName, string UserTel) { try { int intCustomerID = 0;//strList[0] //strUserName.Split(new[] { "cdc" }, StringSplitOptions.None); //string[] strList = System.Text.RegularExpressions.Regex.Split(strUserName, @"$#$", System.Text.RegularExpressions.RegexOptions.IgnoreCase); string[] strList = strMessage.Split(new[] { "$$" }, StringSplitOptions.None); string strLoginName = string.Empty; string strProductID = "000000"; SqlParameter[] parameters = { new SqlParameter("@CustomerID", SqlDbType.Int), new SqlParameter("@ProductID", SqlDbType.VarChar, 50), new SqlParameter("@ErrorMessage", SqlDbType.VarChar, 8000), new SqlParameter("@LoginName", SqlDbType.VarChar, 50), new SqlParameter("@isSuccessfull", SqlDbType.Int), new SqlParameter("@ErrorCode", SqlDbType.VarChar, 50), new SqlParameter("@IP", SqlDbType.VarChar, 50), new SqlParameter("@UserName", SqlDbType.VarChar, 50), new SqlParameter("@UserTel", SqlDbType.VarChar, 50) }; if (strList.Length > 3) { string strCustomerID = string.Empty; try { strCustomerID = DESEncrypt.Decrypt_DES(strList[0]); } catch (Exception ex) { } int.TryParse(strCustomerID, out intCustomerID); if (intCustomerID < 1) { try { strCustomerID = DESEncrypt.Decrypt_DES_Old(strList[0]); } catch (Exception ex) { } int.TryParse(strCustomerID, out intCustomerID); } int intSuccess = 0; int.TryParse(strList[3], out intSuccess); parameters[0].Value = intCustomerID; parameters[1].Value = strList[1]; parameters[2].Value = strMessage.Replace("'", "”").Replace("-", "——"); parameters[3].Value = strList[2]; parameters[4].Value = intSuccess; parameters[5].Value = strErrorCode; parameters[6].Value = getIP(strList[4]); parameters[7].Value = UserName; parameters[8].Value = UserTel; strLoginName = strList[2].Trim(); strProductID = strList[1].Trim(); } else { parameters[0].Value = -1; parameters[1].Value = "0000"; parameters[2].Value = "Error"; parameters[3].Value = strMessage; parameters[4].Value = 0; parameters[5].Value = "无"; parameters[7].Value = UserName; parameters[8].Value = UserTel; } DataSet ds = SqlHelperService.RunProcedure("UP_ActiveProductInfo_ADD", parameters, "ds"); if (!string.IsNullOrEmpty(UserName) && !string.IsNullOrEmpty(UserTel)) { HYTD.BLL.Call_WorkBillBLL wbll = new HYTD.BLL.Call_WorkBillBLL(); List <Models.Call_WorkBill> wModelList = wbll.GetCall_WorkBillList(intCustomerID, strProductID, strLoginName); if (wModelList != null && wModelList.Count < 1) { string strMessageNew = strMessage; if (strMessage.IndexOf("验证成功") > -1) { strMessageNew = strMessage.Substring(strMessage.IndexOf("验证成功") + 4); } CreateWorkBill(intCustomerID, strProductID, strLoginName, UserName, UserTel, strMessageNew); } } } catch (Exception ex) { WebLog.WriteLog(string.Format("添加数据库报错:{0}", ex.Message + ex.HelpLink + ex.InnerException + ex.Source + ex.StackTrace + ex.TargetSite), "Error"); } }
private void DataBind() { Call_WorkBillTO sto = new Call_WorkBillTO(); #region 条件 StringBuilder sb = new StringBuilder(); sb.AppendFormat(" CWB_Status in(29,30) "); if (!string.IsNullOrEmpty(Request["code"])) { sb.AppendFormat(" and CWB_Code like '%{0}%' ", StringHelper.SQLFilter(Request["code"].ToString().Trim())); } if (!string.IsNullOrEmpty(Request["cname"])) { sb.AppendFormat(" and CC_Name like '%{0}%' ", StringHelper.SQLFilter(Request["cname"].ToString().Trim())); } if (!string.IsNullOrEmpty(Request["uname"])) { sb.AppendFormat(" and d.UserName like '%{0}%' ", StringHelper.SQLFilter(Request["uname"].ToString().Trim())); } else { sto.CWB_Solution = strLoginUserName; } sb.AppendFormat(" and CWB_OperationTime < '{0}' ", DateTime.Now.ToString("yyyy-MM-dd")); if (!string.IsNullOrEmpty(Request["stime"])) { DateTime dtStime = Convert.ToDateTime("1980-01-01"); DateTime.TryParse(Request["stime"].ToString().Trim(), out dtStime); sb.AppendFormat(" and CWB_CreateTime >= '{0}' ", dtStime.ToString("yyyy-MM-dd")); } if (!string.IsNullOrEmpty(Request["etime"])) { DateTime dtEtime = Convert.ToDateTime("2250-01-01"); DateTime.TryParse(Request["etime"].ToString().Trim(), out dtEtime); sb.AppendFormat(" and CWB_CreateTime < '{0}' ", dtEtime.AddDays(1).ToString("yyyy-MM-dd")); } if (!string.IsNullOrEmpty(Request["status"])) { int intstatus = 0; int.TryParse(Request["status"].ToString().Trim(), out intstatus); if (intstatus > 0) { sb.AppendFormat(" and CWB_MYDStatus = {0} ", intstatus); } } #endregion if (!string.IsNullOrEmpty(Request.QueryString["pageIndex"])) { int.TryParse(Request.QueryString["pageIndex"], out pageIndex); } HYTD.BLL.Call_WorkBillBLL bll = new HYTD.BLL.Call_WorkBillBLL(); DataTable dt = bll.GetCall_WorkBillList(sb.ToString(), 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 = "SatisfactionList.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.Format("<a href=\"javascript:;\" name=\"NewWorkBill\" onclick=\"NewWorkBill({0})\" >新建</a> ", dr["CC_ID"]); if (dr["CWB_Status"].ToString() != ((int)PublicEnum.CallWorkBillStatus.Visited).ToString()) { strEdit = string.Format(" <a href=\"javascript:;\" name=\"EditWorkBill\" onclick=\"HuifangWorkBill({0})\">满意度</a>", dr["CWB_ID"].ToString()); } sbContent.AppendFormat("<tbody>"); if (dr["MYDStatus"].ToString() == "待调查") { sbContent.AppendFormat("<tr style=\"color:red;\">"); } else { sbContent.AppendFormat("<tr>"); } //sbContent.AppendFormat("<tr>"); sbContent.AppendFormat("<td class=\"num\" title=\"{0}\"><a href=\"javascript:;\" onclick=\"ShowWorkBill({1})\">{0}</a></td>", dr["CWB_Code"].ToString(), dr["CWB_ID"].ToString()); 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["CWB_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["CWB_OperationTime"].ToString())); sbContent.AppendFormat("<td class=\"num\" title=\"{0}\">{0} </td>", dr["MYDStatus"].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; //} }