市长热线演示版

qcedit.ashx.cs 33KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using HySoft.Common;
  6. using System.Data;
  7. using System.Text;
  8. namespace HySoft.BaseCallCenter.Web.qualitymanage.ajax
  9. {
  10. /// <summary>
  11. /// qcedit 的摘要说明
  12. /// </summary>
  13. public class qcedit : IHttpHandler
  14. {
  15. public void ProcessRequest(HttpContext context)
  16. {
  17. context.Response.ContentType = "text/plain";
  18. //取得处事类型
  19. string action = CommonRequest.GetQueryString("action");
  20. switch (action)
  21. {
  22. case "indexlist":
  23. context.Response.Write(LoadIndexList(context));
  24. break;
  25. case "indexlistshow":
  26. context.Response.Write(LoadIndexListShow(context));
  27. break;
  28. case "savedata":
  29. context.Response.Write(savedata(context));
  30. break;
  31. }
  32. }
  33. #region 获取数据
  34. private string LoadIndexList(HttpContext context)
  35. {
  36. StringBuilder res = new StringBuilder();
  37. #region 标题
  38. res.Append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" align='center'>");
  39. res.Append("<tr style=\"text-align: center;\"><td style=\"height: 22px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC;");
  40. res.Append("border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  41. res.Append("padding: 3px 3px 3px 3px; text-align: center;\" colspan=\"2\">分类</td>");
  42. res.Append("<td style=\"height: 22px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC;");
  43. res.Append("border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  44. res.Append("padding: 3px 3px 3px 3px; text-align: center;\">指标</td>");
  45. res.Append("<td style=\"height: 22px; width:60px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC;");
  46. res.Append("border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  47. res.Append("padding: 3px 3px 3px 3px; text-align: center;\">分值</td>");
  48. res.Append("<td style=\"height: 22px; width:80px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC;");
  49. res.Append("border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  50. res.Append("padding: 3px 3px 3px 3px; text-align: center;\">评分</td></tr>");
  51. #endregion
  52. DataTable dt = new DataTable();
  53. DataTable dtindex = new DataTable();
  54. DataTable dtres = new DataTable();
  55. try
  56. {
  57. dt = new BLL.T_QC_IndexCategory().GetList(" F_DeleteFlag=0 order by F_Sort ,F_CategoryId").Tables[0];
  58. dtindex = new BLL.T_QC_IndexBase().GetList(" F_DeleteFlag=0 order by F_Sort ,F_CategoryId").Tables[0];
  59. dtres = new BLL.T_QC_IndexRes().GetList(" CallRecordsId=" + CommonRequest.GetQueryString("id") + " ").Tables[0];
  60. int i = 0;
  61. int m = 0;
  62. int indexcount = 0;
  63. int allscore = 0;
  64. int childscore = 0;
  65. int childpf = 0;
  66. int allpf = 0;
  67. foreach (DataRow dr in dt.Select("F_ParentId=0"))
  68. {
  69. i = 0;
  70. indexcount = 0;
  71. childscore = 0;
  72. childpf = 0;
  73. string categoryid = dr["F_CategoryId"].ToString().Trim();
  74. res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\" ");
  75. res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
  76. res.Append("<td rowspan=\"#indexcount#\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  77. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  78. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
  79. res.Append("" + dr["F_CategoryName"].ToString().Trim() + "&nbsp;</td>");
  80. foreach (DataRow childdr in dt.Select("F_ParentId=" + categoryid + ""))
  81. {
  82. m = 0;
  83. #region 子分类
  84. string childcategoryid = childdr["F_CategoryId"].ToString().Trim();
  85. DataRow[] arrchild=dtindex.Select("F_CategoryId=" + childcategoryid + "");
  86. indexcount += arrchild.Length;
  87. if (i == 0)
  88. {
  89. res.Append("<td rowspan=\""+arrchild.Length.ToString()+"\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  90. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  91. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
  92. res.Append("" + childdr["F_CategoryName"].ToString().Trim() + "&nbsp;</td>");
  93. }
  94. else
  95. {
  96. res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\" ");
  97. res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
  98. res.Append("<td rowspan=\""+arrchild.Length.ToString()+"\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  99. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  100. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
  101. res.Append("" + childdr["F_CategoryName"].ToString().Trim() + "&nbsp;</td>");
  102. }
  103. #endregion
  104. foreach (DataRow indexdr in arrchild)
  105. {
  106. string indexid = indexdr["F_IndexId"].ToString().Trim();
  107. string pf = "0";
  108. try
  109. {
  110. childscore += Convert.ToInt32(indexdr["F_Score"].ToString().Trim());
  111. allscore += Convert.ToInt32(indexdr["F_Score"].ToString().Trim());
  112. }
  113. catch
  114. { }
  115. try
  116. {
  117. pf = dtres.Select("F_IndexId=" + indexid + "")[0]["F_QCScore"].ToString().Trim();
  118. childpf += Convert.ToInt32(pf);
  119. allpf += Convert.ToInt32(pf);
  120. }
  121. catch
  122. {
  123. }
  124. #region 指标
  125. if (m == 0)
  126. {
  127. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  128. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  129. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
  130. res.Append("" + indexdr["F_Title"].ToString().Trim() + "&nbsp;</td>");
  131. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  132. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  133. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
  134. res.Append("" + indexdr["F_Score"].ToString().Trim() + "&nbsp;</td>");
  135. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  136. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  137. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
  138. res.Append("&nbsp;<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>");
  139. res.Append("</tr>");
  140. }
  141. else
  142. {
  143. res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\" ");
  144. res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
  145. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  146. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  147. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
  148. res.Append("" + indexdr["F_Title"].ToString().Trim() + "&nbsp;</td>");
  149. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  150. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  151. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
  152. res.Append("" + indexdr["F_Score"].ToString().Trim() + "&nbsp;</td>");
  153. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  154. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  155. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
  156. res.Append("&nbsp;<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>");
  157. res.Append("</tr>");
  158. }
  159. #endregion
  160. m++;
  161. }
  162. i++;
  163. }
  164. res = res.Replace("#indexcount#", indexcount.ToString());
  165. res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\"");
  166. res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
  167. res.Append("<td colspan=\"3\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  168. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  169. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px; background-color: #e4d354;\">");
  170. res.Append("【" + dr["F_CategoryName"].ToString().Trim() + "】合计:&nbsp;</td>");
  171. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  172. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  173. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px; background-color: #e4d354;\">");
  174. res.Append("" + childscore.ToString().Trim() + "&nbsp;</td>");
  175. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  176. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  177. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px; background-color: #e4d354;\">");
  178. res.Append("<span id=\"spanscore_" + categoryid + "\" style='color:red; font-weight:bold;'>" + childpf.ToString().Trim() + "</span>&nbsp;</td>");
  179. res.Append("</tr>");
  180. }
  181. res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\"");
  182. res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
  183. res.Append("<td colspan=\"3\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  184. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  185. res.Append("height: 22px; padding-top: 3px; padding-bottom: 3px; background-color: #D5EDFE;\">");
  186. res.Append("总计:&nbsp;</td>");
  187. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  188. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  189. res.Append("height: 22px; padding-top: 3px; padding-bottom: 3px; background-color: #D5EDFE;\">");
  190. res.Append("" + allscore.ToString().Trim() + "&nbsp;</td>");
  191. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  192. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  193. res.Append("height: 22px; padding-top: 3px; padding-bottom: 3px; background-color: #D5EDFE;\">");
  194. res.Append("<span id=\"spanallscore\" style='color:red; font-weight:bold;'>" + allpf.ToString().Trim() + "</span>&nbsp;</td>");
  195. res.Append("</tr>");
  196. }
  197. catch (Exception err)
  198. {
  199. //res = err.ToString();
  200. }
  201. finally
  202. {
  203. dtindex.Clear();
  204. dtindex.Dispose();
  205. dt.Clear();
  206. dt.Dispose();
  207. }
  208. res.Append("</table>");
  209. return res.ToString();
  210. }
  211. #endregion
  212. #region 获取数据
  213. private string LoadIndexListShow(HttpContext context)
  214. {
  215. StringBuilder res = new StringBuilder();
  216. #region 标题
  217. res.Append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" align='center'>");
  218. res.Append("<tr style=\"text-align: center;\"><td style=\"height: 22px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC;");
  219. res.Append("border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  220. res.Append("padding: 3px 3px 3px 3px; text-align: center;\" colspan=\"2\">分类</td>");
  221. res.Append("<td style=\"height: 22px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC;");
  222. res.Append("border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  223. res.Append("padding: 3px 3px 3px 3px; text-align: center;\">指标</td>");
  224. res.Append("<td style=\"height: 22px; width:60px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC;");
  225. res.Append("border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  226. res.Append("padding: 3px 3px 3px 3px; text-align: center;\">分值</td>");
  227. res.Append("<td style=\"height: 22px; width:80px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC;");
  228. res.Append("border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  229. res.Append("padding: 3px 3px 3px 3px; text-align: center;\">评分</td></tr>");
  230. #endregion
  231. DataTable dt = new DataTable();
  232. DataTable dtindex = new DataTable();
  233. DataTable dtres = new DataTable();
  234. try
  235. {
  236. dt = new BLL.T_QC_IndexCategory().GetList(" F_DeleteFlag=0 order by F_Sort ,F_CategoryId").Tables[0];
  237. dtindex = new BLL.T_QC_IndexBase().GetList(" F_DeleteFlag=0 order by F_Sort ,F_CategoryId").Tables[0];
  238. dtres = new BLL.T_QC_IndexRes().GetList(" CallRecordsId=" + CommonRequest.GetQueryString("id") + " ").Tables[0];
  239. int i = 0;
  240. int m = 0;
  241. int indexcount = 0;
  242. int allscore = 0;
  243. int childscore = 0;
  244. int childpf=0;
  245. int allpf = 0;
  246. foreach (DataRow dr in dt.Select("F_ParentId=0"))
  247. {
  248. i = 0;
  249. indexcount = 0;
  250. childscore = 0;
  251. childpf = 0;
  252. string categoryid = dr["F_CategoryId"].ToString().Trim();
  253. res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\" ");
  254. res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
  255. res.Append("<td rowspan=\"#indexcount#\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  256. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  257. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
  258. res.Append("" + dr["F_CategoryName"].ToString().Trim() + "&nbsp;</td>");
  259. foreach (DataRow childdr in dt.Select("F_ParentId=" + categoryid + ""))
  260. {
  261. m = 0;
  262. #region 子分类
  263. string childcategoryid = childdr["F_CategoryId"].ToString().Trim();
  264. DataRow[] arrchild = dtindex.Select("F_CategoryId=" + childcategoryid + "");
  265. indexcount += arrchild.Length;
  266. if (i == 0)
  267. {
  268. res.Append("<td rowspan=\"" + arrchild.Length.ToString() + "\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  269. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  270. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
  271. res.Append("" + childdr["F_CategoryName"].ToString().Trim() + "&nbsp;</td>");
  272. }
  273. else
  274. {
  275. res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\" ");
  276. res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
  277. res.Append("<td rowspan=\"" + arrchild.Length.ToString() + "\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  278. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  279. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
  280. res.Append("" + childdr["F_CategoryName"].ToString().Trim() + "&nbsp;</td>");
  281. }
  282. #endregion
  283. foreach (DataRow indexdr in arrchild)
  284. {
  285. string indexid = indexdr["F_IndexId"].ToString().Trim();
  286. string pf = "0";
  287. try
  288. {
  289. childscore += Convert.ToInt32(indexdr["F_Score"].ToString().Trim());
  290. allscore += Convert.ToInt32(indexdr["F_Score"].ToString().Trim());
  291. }
  292. catch
  293. { }
  294. try
  295. {
  296. pf = dtres.Select("F_IndexId=" + indexid + "")[0]["F_QCScore"].ToString().Trim();
  297. childpf += Convert.ToInt32(pf);
  298. allpf += Convert.ToInt32(pf);
  299. }
  300. catch
  301. {
  302. }
  303. #region 指标
  304. if (m == 0)
  305. {
  306. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  307. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  308. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
  309. res.Append("" + indexdr["F_Title"].ToString().Trim() + "&nbsp;</td>");
  310. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  311. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  312. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
  313. res.Append("" + indexdr["F_Score"].ToString().Trim() + "&nbsp;</td>");
  314. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  315. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  316. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
  317. res.Append("&nbsp;<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>");
  318. res.Append("</tr>");
  319. }
  320. else
  321. {
  322. res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\" ");
  323. res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
  324. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  325. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  326. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
  327. res.Append("" + indexdr["F_Title"].ToString().Trim() + "&nbsp;</td>");
  328. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  329. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  330. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
  331. res.Append("" + indexdr["F_Score"].ToString().Trim() + "&nbsp;</td>");
  332. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  333. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  334. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px;\">");
  335. res.Append("&nbsp;<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>");
  336. res.Append("</tr>");
  337. }
  338. #endregion
  339. m++;
  340. }
  341. i++;
  342. }
  343. res = res.Replace("#indexcount#", indexcount.ToString());
  344. res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\"");
  345. res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
  346. res.Append("<td colspan=\"3\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  347. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  348. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px; background-color: #e4d354;\">");
  349. res.Append("【" + dr["F_CategoryName"].ToString().Trim() + "】合计:&nbsp;</td>");
  350. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  351. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  352. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px; background-color: #e4d354;\">");
  353. res.Append("" + childscore.ToString().Trim() + "&nbsp;</td>");
  354. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  355. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  356. res.Append("height: 18px; padding-top: 3px; padding-bottom: 3px; background-color: #e4d354;\">");
  357. res.Append("<span id=\"spanscore_" + categoryid + "\" style='color:red; font-weight:bold;'>" + childpf.ToString().Trim() + "</span>&nbsp;</td>");
  358. res.Append("</tr>");
  359. }
  360. res.Append("<tr align=\"center\" valign=\"middle\" onmouseover=\"this.style.backgroundColor='#F6F6F6'\"");
  361. res.Append("onmouseout=\"this.style.backgroundColor='#ffffff'\" bgcolor=\"#ffffff\">");
  362. res.Append("<td colspan=\"3\" style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  363. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  364. res.Append("height: 22px; padding-top: 3px; padding-bottom: 3px; background-color: #D5EDFE;\">");
  365. res.Append("总计:&nbsp;</td>");
  366. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  367. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  368. res.Append("height: 22px; padding-top: 3px; padding-bottom: 3px; background-color: #D5EDFE;\">");
  369. res.Append("" + allscore.ToString().Trim() + "&nbsp;</td>");
  370. res.Append("<td style=\"vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;");
  371. res.Append("border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;");
  372. res.Append("height: 22px; padding-top: 3px; padding-bottom: 3px; background-color: #D5EDFE;\">");
  373. res.Append("<span id=\"spanallscore\" style='color:red; font-weight:bold;'>" + allpf.ToString().Trim() + "</span>&nbsp;</td>");
  374. res.Append("</tr>");
  375. }
  376. catch (Exception err)
  377. {
  378. //res = err.ToString();
  379. }
  380. finally
  381. {
  382. dtres.Clear();
  383. dtres.Dispose();
  384. dtindex.Clear();
  385. dtindex.Dispose();
  386. dt.Clear();
  387. dt.Dispose();
  388. }
  389. res.Append("</table>");
  390. return res.ToString();
  391. }
  392. #endregion
  393. private string savedata(HttpContext context)
  394. {
  395. string res = "";
  396. string type = "0";
  397. DataTable dt = new DataTable();
  398. try
  399. {
  400. string id = context.Request.Params["id"];
  401. string userid = context.Request.Params["userid"];
  402. string username = context.Request.Params["username"];
  403. string xmlinfo = context.Request.Params["xmlinfo"];
  404. dt = new BLL.T_QC_IndexRes().GetList(" CallRecordsId=" + id + " ").Tables[0];
  405. int allscore = 0;
  406. foreach (string scoreinfo in xmlinfo.Split(';'))
  407. {
  408. //判断存在该指标评估则修改,无则添加
  409. string indexid = scoreinfo.Split(':')[0];
  410. if (dt.Select(" F_IndexId=" + indexid + " ").Length > 0)
  411. {
  412. Model.T_QC_IndexRes model = new Model.T_QC_IndexRes();
  413. model.F_Id = Convert.ToInt32(dt.Select(" F_IndexId=" + indexid + " ")[0]["F_Id"].ToString());
  414. model.CallRecordsId = Convert.ToInt32(id);
  415. try
  416. {
  417. model.F_IndexId = Convert.ToInt32(indexid);
  418. }
  419. catch
  420. { }
  421. try
  422. {
  423. model.F_QCScore = Convert.ToInt32(scoreinfo.Split(':')[1]);
  424. allscore += Convert.ToInt32(scoreinfo.Split(':')[1]);
  425. }
  426. catch
  427. { }
  428. new BLL.T_QC_IndexRes().Update(model);
  429. }
  430. else
  431. {
  432. Model.T_QC_IndexRes model = new Model.T_QC_IndexRes();
  433. model.CallRecordsId = Convert.ToInt32(id);
  434. try
  435. {
  436. model.F_IndexId = Convert.ToInt32(indexid);
  437. }
  438. catch
  439. { }
  440. try
  441. {
  442. model.F_QCScore = Convert.ToInt32(scoreinfo.Split(':')[1]);
  443. allscore += Convert.ToInt32(scoreinfo.Split(':')[1]);
  444. }
  445. catch
  446. { }
  447. new BLL.T_QC_IndexRes().Add(model);
  448. }
  449. }
  450. Model.T_Call_CallRecords_QC callmodel = new Model.T_Call_CallRecords_QC();
  451. callmodel.CallRecordsId = Convert.ToInt32(id);
  452. callmodel.F_QCState = 1;
  453. callmodel.F_QCScore = allscore;
  454. callmodel.F_QCUserId = Convert.ToInt32(userid);
  455. callmodel.F_QCUserName = username;
  456. callmodel.F_QCTime = DateTime.Now;
  457. callmodel.F_QCIsSelect = 0;
  458. callmodel.F_QCRemark = "";
  459. if (new BLL.T_Call_CallRecords_QC().UpdateQC(callmodel))
  460. {
  461. res = "保存成功";
  462. type = "1";
  463. }
  464. else
  465. {
  466. res = "保存质检评分信息失败";
  467. }
  468. }
  469. catch (Exception ex)
  470. {
  471. res = ex.ToString();
  472. }
  473. finally
  474. {
  475. dt.Clear();
  476. dt.Dispose();
  477. }
  478. return "" + type + "|" + res + "";
  479. }
  480. public bool IsReusable
  481. {
  482. get
  483. {
  484. return false;
  485. }
  486. }
  487. }
  488. }