市长热线演示版

callplanedit.aspx.cs 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using HySoft.Common;
  8. namespace HySoft.BaseCallCenter.Web.calloutmanage
  9. {
  10. public partial class callplanedit : System.Web.UI.Page
  11. {
  12. protected void Page_Load(object sender, EventArgs e)
  13. {
  14. if (!IsPostBack)
  15. {
  16. if (!string.IsNullOrEmpty(Request.QueryString["id"]))
  17. {
  18. txtId.Value = Request.QueryString["id"].Trim();
  19. InitObj(Request.QueryString["id"].Trim());
  20. }
  21. }
  22. }
  23. void InitObj(string id)
  24. {
  25. try
  26. {
  27. T_CTI_TaskObj = new BLL.T_CTI_Task().GetModel(Convert.ToInt32(id));
  28. }
  29. catch (Exception ex)
  30. {
  31. }
  32. }
  33. private Model.T_CTI_Task T_CTI_TaskObj
  34. {
  35. get
  36. {
  37. Model.T_CTI_Task model = new Model.T_CTI_Task();
  38. if (Request.QueryString["otype"].Trim() == "modify")
  39. {
  40. model.TaskID = Convert.ToInt32(Request.QueryString["id"].Trim());
  41. }
  42. else
  43. {
  44. model.TaskID = 0;
  45. }
  46. model.TaskName = TaskName.Text.Trim();
  47. model.TrunkGroupID = 0;
  48. model.CallType = 1;
  49. model.State = 0;
  50. model.AddTime = DateTime.Now;
  51. model.y_PSort = 2;
  52. model.y_TkModelId = 0;
  53. try
  54. {
  55. model.y_TkModelId = Convert.ToInt32(txtPagerId.Value.Trim());
  56. }
  57. catch (Exception ex)
  58. {
  59. }
  60. model.y_SXH = 0;
  61. model.y_FPCount = 0;
  62. model.y_YJCount = 0;
  63. model.y_HCCount = 0;
  64. model.y_HSCount = 0;
  65. model.y_HTCount = 0;
  66. model.y_HMCount = 0;
  67. model.y_OkCount = 0;
  68. model.y_RFCount = 0;
  69. model.y_ConsCount = 0;
  70. model.y_InvlCount = 0;
  71. model.y_NoAnswerCount = 0;
  72. model.y_ShutDownCount = 0;
  73. return model;
  74. }
  75. set
  76. {
  77. if (value != null)
  78. {
  79. this.txtId.Value = value.TaskID.ToString();
  80. this.TaskName.Text = value.TaskName;
  81. this.txtPagerId.Value = value.y_TkModelId.ToString();
  82. try
  83. {
  84. if (value.y_TkModelId != 0)
  85. {
  86. txtPagerName.Text = new BLL.T_Ask_PagerInfo().GetModel(Convert.ToInt32(value.y_TkModelId.ToString())).F_Title;
  87. }
  88. }
  89. catch (Exception ex)
  90. {
  91. }
  92. }
  93. }
  94. }
  95. protected void btnSubmit_Click(object sender, EventArgs e)
  96. {
  97. try
  98. {
  99. if (Request.QueryString["otype"] == "new")
  100. {
  101. long id=new BLL.T_CTI_Task().Add(T_CTI_TaskObj);
  102. if (id > 0)
  103. {
  104. //生成任务表
  105. MessageBoxToWindow("新增成功", "新增提示", "success");
  106. }
  107. else
  108. {
  109. MessageBoxToWindow("新增失败", "新增提示!", "error");
  110. }
  111. }
  112. if (Request.QueryString["otype"] == "modify")
  113. {
  114. if (new BLL.T_CTI_Task().Update(T_CTI_TaskObj))
  115. {
  116. MessageBoxToWindow("修改成功", "修改提示!", "success");
  117. }
  118. else
  119. {
  120. MessageBoxToWindow("修改失败!", "修改提示!", "error");
  121. }
  122. }
  123. }
  124. catch
  125. {
  126. MessageBoxToWindow("保存失败!", "保存提示!", "error");
  127. }
  128. }
  129. #region 弹出对话框
  130. /// <summary>
  131. /// 弹出对话框
  132. /// </summary>
  133. /// <param name="title"></param>
  134. /// <param name="content"></param>
  135. /// <param name="type"></param>
  136. public void MessageBoxToWindow(string title, string content, string type)
  137. {
  138. string script = "";
  139. switch (type)
  140. {
  141. case "error"://失败
  142. type = "error";
  143. script = "<script type='text/javascript'> $.ligerDialog.alert('" + title + "','" + content + "','" + type + "');</script>";
  144. break;
  145. case "success"://成功
  146. type = "info";
  147. script = "<script type='text/javascript'> $.ligerDialog.alert('" + title + "','" + content + "','" + type + "',CloseThis);</script>";
  148. break;
  149. case "catch"://异常
  150. type = "warning";
  151. script = "<script type='text/javascript'> $.ligerDialog.alert('" + title + "','" + content + "','" + type + "');</script>";
  152. break;
  153. default:
  154. type = "question";
  155. break;
  156. }
  157. ClientScript.RegisterClientScriptBlock(this.GetType(), "", script);
  158. }
  159. #endregion
  160. }
  161. }