| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using HySoft.Common;
- using System.Data;
- using System.Text;
- namespace HySoft.BaseCallCenter.Web.qualitymanage.ajax
- {
- /// <summary>
- /// qcedit 的摘要说明
- /// </summary>
- public class qcedit : IHttpHandler
- {
- public void ProcessRequest(HttpContext context)
- {
- context.Response.ContentType = "text/plain";
- //取得处事类型
- string action = CommonRequest.GetQueryString("action");
- switch (action)
- {
- case "indexlist":
- context.Response.Write(LoadIndexList(context));
- break;
- case "indexlistshow":
- context.Response.Write(LoadIndexListShow(context));
- break;
- case "savedata":
- context.Response.Write(savedata(context));
- break;
- }
- }
- #region 获取数据
- private string LoadIndexList(HttpContext context)
- {
- StringBuilder res = new StringBuilder();
- #region 标题
- res.Append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" align='center'>");
- res.Append("<tr style=\"text-align: center;\"><td style=\"height: 22px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC;");
- res.Append("border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("padding: 3px 3px 3px 3px; text-align: center;\" colspan=\"2\">分类</td>");
- res.Append("<td style=\"height: 22px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC;");
- res.Append("border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("padding: 3px 3px 3px 3px; text-align: center;\">指标</td>");
- res.Append("<td style=\"height: 22px; width:60px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC;");
- res.Append("border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("padding: 3px 3px 3px 3px; text-align: center;\">分值</td>");
- res.Append("<td style=\"height: 22px; width:80px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC;");
- res.Append("border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("padding: 3px 3px 3px 3px; text-align: center;\">评分</td></tr>");
- #endregion
- DataTable dt = new DataTable();
- DataTable dtindex = new DataTable();
- DataTable dtres = new DataTable();
- try
- {
- dt = new BLL.T_QC_IndexCategory().GetList(" F_DeleteFlag=0 order by F_Sort ,F_CategoryId").Tables[0];
- dtindex = new BLL.T_QC_IndexBase().GetList(" F_DeleteFlag=0 order by F_Sort ,F_CategoryId").Tables[0];
- dtres = new BLL.T_QC_IndexRes().GetList(" CallRecordsId=" + CommonRequest.GetQueryString("id") + " ").Tables[0];
- int i = 0;
- int m = 0;
- int indexcount = 0;
- int allscore = 0;
- int childscore = 0;
- int childpf = 0;
- int allpf = 0;
- foreach (DataRow dr in dt.Select("F_ParentId=0"))
- {
- i = 0;
- indexcount = 0;
- childscore = 0;
- childpf = 0;
- string categoryid = dr["F_CategoryId"].ToString().Trim();
- res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\" ");
- res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
- res.Append("<td rowspan=\"#indexcount#\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
- res.Append("" + dr["F_CategoryName"].ToString().Trim() + " </td>");
- foreach (DataRow childdr in dt.Select("F_ParentId=" + categoryid + ""))
- {
- m = 0;
- #region 子分类
- string childcategoryid = childdr["F_CategoryId"].ToString().Trim();
- DataRow[] arrchild=dtindex.Select("F_CategoryId=" + childcategoryid + "");
- indexcount += arrchild.Length;
- if (i == 0)
- {
- res.Append("<td rowspan=\""+arrchild.Length.ToString()+"\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
- res.Append("" + childdr["F_CategoryName"].ToString().Trim() + " </td>");
- }
- else
- {
- res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\" ");
- res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
- res.Append("<td rowspan=\""+arrchild.Length.ToString()+"\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
- res.Append("" + childdr["F_CategoryName"].ToString().Trim() + " </td>");
- }
- #endregion
- foreach (DataRow indexdr in arrchild)
- {
- string indexid = indexdr["F_IndexId"].ToString().Trim();
- string pf = "0";
- try
- {
- childscore += Convert.ToInt32(indexdr["F_Score"].ToString().Trim());
- allscore += Convert.ToInt32(indexdr["F_Score"].ToString().Trim());
- }
- catch
- { }
- try
- {
- pf = dtres.Select("F_IndexId=" + indexid + "")[0]["F_QCScore"].ToString().Trim();
- childpf += Convert.ToInt32(pf);
- allpf += Convert.ToInt32(pf);
- }
- catch
- {
- }
- #region 指标
- if (m == 0)
- {
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
- res.Append("" + indexdr["F_Title"].ToString().Trim() + " </td>");
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
- res.Append("" + indexdr["F_Score"].ToString().Trim() + " </td>");
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
- res.Append(" <input id='txtscore_" + categoryid + "_" + childcategoryid + "_" + indexid + "' name='txtscore' type='text' class='txtInput normal' style='width:50px; color:blue;' onblur=\"SetScore('" + categoryid + "','" + childcategoryid + "','" + indexid + "')\" onkeyup=\"this.value=this.value.replace(/[^\\d]/g,'');\" value='" + pf + "' /></td>");
- res.Append("</tr>");
- }
- else
- {
- res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\" ");
- res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
- res.Append("" + indexdr["F_Title"].ToString().Trim() + " </td>");
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
- res.Append("" + indexdr["F_Score"].ToString().Trim() + " </td>");
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
- res.Append(" <input id='txtscore_" + categoryid + "_" + childcategoryid + "_" + indexid + "' name='txtscore' type='text' class='txtInput normal' style='width:50px; color:blue;' onblur=\"SetScore('" + categoryid + "','" + childcategoryid + "','" + indexid + "')\" onkeyup=\"this.value=this.value.replace(/[^\\d]/g,'');\" value='" + pf + "' /></td>");
- res.Append("</tr>");
- }
- #endregion
- m++;
- }
- i++;
- }
- res = res.Replace("#indexcount#", indexcount.ToString());
- res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\"");
- res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
- res.Append("<td colspan=\"3\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px; background-color: #e4d354;\">");
- res.Append("【" + dr["F_CategoryName"].ToString().Trim() + "】合计: </td>");
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px; background-color: #e4d354;\">");
- res.Append("" + childscore.ToString().Trim() + " </td>");
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px; background-color: #e4d354;\">");
- res.Append("<span id=\"spanscore_" + categoryid + "\" style='color:red; font-weight:bold;'>" + childpf.ToString().Trim() + "</span> </td>");
- res.Append("</tr>");
- }
- res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\"");
- res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
- res.Append("<td colspan=\"3\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 22px; padding-top: 3px; padding-bottom: 3px; background-color: #D5EDFE;\">");
- res.Append("总计: </td>");
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 22px; padding-top: 3px; padding-bottom: 3px; background-color: #D5EDFE;\">");
- res.Append("" + allscore.ToString().Trim() + " </td>");
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 22px; padding-top: 3px; padding-bottom: 3px; background-color: #D5EDFE;\">");
- res.Append("<span id=\"spanallscore\" style='color:red; font-weight:bold;'>" + allpf.ToString().Trim() + "</span> </td>");
- res.Append("</tr>");
- }
- catch (Exception err)
- {
- //res = err.ToString();
- }
- finally
- {
- dtindex.Clear();
- dtindex.Dispose();
- dt.Clear();
- dt.Dispose();
- }
- res.Append("</table>");
- return res.ToString();
- }
- #endregion
- #region 获取数据
- private string LoadIndexListShow(HttpContext context)
- {
- StringBuilder res = new StringBuilder();
- #region 标题
- res.Append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" align='center'>");
- res.Append("<tr style=\"text-align: center;\"><td style=\"height: 22px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC;");
- res.Append("border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("padding: 3px 3px 3px 3px; text-align: center;\" colspan=\"2\">分类</td>");
- res.Append("<td style=\"height: 22px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC;");
- res.Append("border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("padding: 3px 3px 3px 3px; text-align: center;\">指标</td>");
- res.Append("<td style=\"height: 22px; width:60px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC;");
- res.Append("border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("padding: 3px 3px 3px 3px; text-align: center;\">分值</td>");
- res.Append("<td style=\"height: 22px; width:80px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC;");
- res.Append("border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("padding: 3px 3px 3px 3px; text-align: center;\">评分</td></tr>");
- #endregion
- DataTable dt = new DataTable();
- DataTable dtindex = new DataTable();
- DataTable dtres = new DataTable();
- try
- {
- dt = new BLL.T_QC_IndexCategory().GetList(" F_DeleteFlag=0 order by F_Sort ,F_CategoryId").Tables[0];
- dtindex = new BLL.T_QC_IndexBase().GetList(" F_DeleteFlag=0 order by F_Sort ,F_CategoryId").Tables[0];
- dtres = new BLL.T_QC_IndexRes().GetList(" CallRecordsId=" + CommonRequest.GetQueryString("id") + " ").Tables[0];
- int i = 0;
- int m = 0;
- int indexcount = 0;
- int allscore = 0;
- int childscore = 0;
- int childpf=0;
- int allpf = 0;
- foreach (DataRow dr in dt.Select("F_ParentId=0"))
- {
- i = 0;
- indexcount = 0;
- childscore = 0;
- childpf = 0;
- string categoryid = dr["F_CategoryId"].ToString().Trim();
- res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\" ");
- res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
- res.Append("<td rowspan=\"#indexcount#\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
- res.Append("" + dr["F_CategoryName"].ToString().Trim() + " </td>");
- foreach (DataRow childdr in dt.Select("F_ParentId=" + categoryid + ""))
- {
- m = 0;
- #region 子分类
- string childcategoryid = childdr["F_CategoryId"].ToString().Trim();
- DataRow[] arrchild = dtindex.Select("F_CategoryId=" + childcategoryid + "");
- indexcount += arrchild.Length;
- if (i == 0)
- {
- res.Append("<td rowspan=\"" + arrchild.Length.ToString() + "\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
- res.Append("" + childdr["F_CategoryName"].ToString().Trim() + " </td>");
- }
- else
- {
- res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\" ");
- res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
- res.Append("<td rowspan=\"" + arrchild.Length.ToString() + "\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
- res.Append("" + childdr["F_CategoryName"].ToString().Trim() + " </td>");
- }
- #endregion
- foreach (DataRow indexdr in arrchild)
- {
- string indexid = indexdr["F_IndexId"].ToString().Trim();
- string pf = "0";
- try
- {
- childscore += Convert.ToInt32(indexdr["F_Score"].ToString().Trim());
- allscore += Convert.ToInt32(indexdr["F_Score"].ToString().Trim());
- }
- catch
- { }
- try
- {
- pf = dtres.Select("F_IndexId=" + indexid + "")[0]["F_QCScore"].ToString().Trim();
- childpf += Convert.ToInt32(pf);
- allpf += Convert.ToInt32(pf);
- }
- catch
- {
- }
- #region 指标
- if (m == 0)
- {
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
- res.Append("" + indexdr["F_Title"].ToString().Trim() + " </td>");
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
- res.Append("" + indexdr["F_Score"].ToString().Trim() + " </td>");
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
- res.Append(" <input id='txtscore_" + categoryid + "_" + childcategoryid + "_" + indexid + "' name='txtscore' type='text' class='txtInput normal' style='width:50px; color:blue;' onblur=\"SetScore('" + categoryid + "','" + childcategoryid + "','" + indexid + "')\" onkeyup=\"this.value=this.value.replace(/[^\\d]/g,'');\" value='" + pf + "' /></td>");
- res.Append("</tr>");
- }
- else
- {
- res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\" ");
- res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
- res.Append("" + indexdr["F_Title"].ToString().Trim() + " </td>");
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
- res.Append("" + indexdr["F_Score"].ToString().Trim() + " </td>");
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
- res.Append(" <input id='txtscore_" + categoryid + "_" + childcategoryid + "_" + indexid + "' name='txtscore' type='text' class='txtInput normal' style='width:50px; color:blue;' onblur=\"SetScore('" + categoryid + "','" + childcategoryid + "','" + indexid + "')\" onkeyup=\"this.value=this.value.replace(/[^\\d]/g,'');\" value='" + pf + "' /></td>");
- res.Append("</tr>");
- }
- #endregion
- m++;
- }
- i++;
- }
- res = res.Replace("#indexcount#", indexcount.ToString());
- res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\"");
- res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
- res.Append("<td colspan=\"3\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px; background-color: #e4d354;\">");
- res.Append("【" + dr["F_CategoryName"].ToString().Trim() + "】合计: </td>");
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px; background-color: #e4d354;\">");
- res.Append("" + childscore.ToString().Trim() + " </td>");
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px; background-color: #e4d354;\">");
- res.Append("<span id=\"spanscore_" + categoryid + "\" style='color:red; font-weight:bold;'>" + childpf.ToString().Trim() + "</span> </td>");
- res.Append("</tr>");
- }
- res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\"");
- res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
- res.Append("<td colspan=\"3\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 22px; padding-top: 3px; padding-bottom: 3px; background-color: #D5EDFE;\">");
- res.Append("总计: </td>");
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 22px; padding-top: 3px; padding-bottom: 3px; background-color: #D5EDFE;\">");
- res.Append("" + allscore.ToString().Trim() + " </td>");
- res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
- res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
- res.Append("height: 22px; padding-top: 3px; padding-bottom: 3px; background-color: #D5EDFE;\">");
- res.Append("<span id=\"spanallscore\" style='color:red; font-weight:bold;'>" + allpf.ToString().Trim() + "</span> </td>");
- res.Append("</tr>");
- }
- catch (Exception err)
- {
- //res = err.ToString();
- }
- finally
- {
- dtres.Clear();
- dtres.Dispose();
- dtindex.Clear();
- dtindex.Dispose();
- dt.Clear();
- dt.Dispose();
- }
- res.Append("</table>");
- return res.ToString();
- }
- #endregion
- private string savedata(HttpContext context)
- {
- string res = "";
- string type = "0";
- DataTable dt = new DataTable();
- try
- {
- string id = context.Request.Params["id"];
- string userid = context.Request.Params["userid"];
- string username = context.Request.Params["username"];
- string xmlinfo = context.Request.Params["xmlinfo"];
- dt = new BLL.T_QC_IndexRes().GetList(" CallRecordsId=" + id + " ").Tables[0];
- int allscore = 0;
- foreach (string scoreinfo in xmlinfo.Split(';'))
- {
- //判断存在该指标评估则修改,无则添加
- string indexid = scoreinfo.Split(':')[0];
- if (dt.Select(" F_IndexId=" + indexid + " ").Length > 0)
- {
- Model.T_QC_IndexRes model = new Model.T_QC_IndexRes();
- model.F_Id = Convert.ToInt32(dt.Select(" F_IndexId=" + indexid + " ")[0]["F_Id"].ToString());
- model.CallRecordsId = Convert.ToInt32(id);
- try
- {
- model.F_IndexId = Convert.ToInt32(indexid);
- }
- catch
- { }
- try
- {
- model.F_QCScore = Convert.ToInt32(scoreinfo.Split(':')[1]);
- allscore += Convert.ToInt32(scoreinfo.Split(':')[1]);
- }
- catch
- { }
- new BLL.T_QC_IndexRes().Update(model);
- }
- else
- {
- Model.T_QC_IndexRes model = new Model.T_QC_IndexRes();
- model.CallRecordsId = Convert.ToInt32(id);
- try
- {
- model.F_IndexId = Convert.ToInt32(indexid);
- }
- catch
- { }
- try
- {
- model.F_QCScore = Convert.ToInt32(scoreinfo.Split(':')[1]);
- allscore += Convert.ToInt32(scoreinfo.Split(':')[1]);
- }
- catch
- { }
- new BLL.T_QC_IndexRes().Add(model);
- }
- }
- Model.T_Call_CallRecords_QC callmodel = new Model.T_Call_CallRecords_QC();
- callmodel.CallRecordsId = Convert.ToInt32(id);
- callmodel.F_QCState = 1;
- callmodel.F_QCScore = allscore;
- callmodel.F_QCUserId = Convert.ToInt32(userid);
- callmodel.F_QCUserName = username;
- callmodel.F_QCTime = DateTime.Now;
- callmodel.F_QCIsSelect = 0;
- callmodel.F_QCRemark = "";
- if (new BLL.T_Call_CallRecords_QC().UpdateQC(callmodel))
- {
- res = "保存成功";
- type = "1";
- }
- else
- {
- res = "保存质检评分信息失败";
- }
-
- }
- catch (Exception ex)
- {
- res = ex.ToString();
- }
- finally
- {
- dt.Clear();
- dt.Dispose();
- }
- return "" + type + "|" + res + "";
- }
- public bool IsReusable
- {
- get
- {
- return false;
- }
- }
- }
- }
|