UU跑腿标准版

sysconfigedit.aspx.cs 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 System.Data;
  8. using HySoft.Common;
  9. namespace HySoft.BaseCallCenter.Web.sysmanage
  10. {
  11. public partial class sysconfigedit : System.Web.UI.Page
  12. {
  13. protected void Page_Load(object sender, EventArgs e)
  14. {
  15. if (!IsPostBack)
  16. {
  17. if (Request.QueryString["getPuction"].ToString() == "Edit")
  18. {
  19. getOrderInformerEdit(Request.QueryString["singleFlage"].ToString());
  20. }
  21. }
  22. }
  23. /// <summary>
  24. /// 初始化信息
  25. /// </summary>
  26. private void getOrderInformerEdit(string Flage)
  27. {
  28. DataTable dt = new DataTable();
  29. DataTable dtItems = new DataTable();
  30. string sql = "select * from T_Sys_SystemConfig where F_ParamId=" + Flage + "";
  31. dt = DBUtility.DbHelperSQL.Query(sql).Tables[0];
  32. if (dt.Rows.Count > 0)
  33. {
  34. F_ParamCode.Text = dt.Rows[0]["F_ParamCode"].ToString();
  35. F_ParamValue.Text = dt.Rows[0]["F_ParamValue"].ToString();
  36. F_ParamDes.Text = dt.Rows[0]["F_ParamDes"].ToString();
  37. }
  38. }
  39. /// <summary>
  40. /// 保存订单信息。
  41. /// </summary>
  42. /// <param name="sender"></param>
  43. /// <param name="e"></param>
  44. protected void btnSubmit_Click(object sender, EventArgs e)
  45. {
  46. HySoft.BaseCallCenter.Model.T_Sys_SystemConfig orderModel = new Model.T_Sys_SystemConfig();
  47. HySoft.BaseCallCenter.BLL.T_Sys_SystemConfig orderBll = new BLL.T_Sys_SystemConfig();
  48. try
  49. {
  50. orderModel.F_ParamCode = F_ParamCode.Text.Trim();
  51. orderModel.F_ParamValue = F_ParamValue.Text.Trim();
  52. orderModel.F_ParamDes = F_ParamDes.Text.Trim();
  53. orderModel.F_State = 0;
  54. if (Request.QueryString["getPuction"] == "Add")
  55. {
  56. int count = orderBll.Add(orderModel);
  57. if (count > 0)
  58. {
  59. MessageBoxToWindow("新增成功", "新增提示", "success");
  60. }
  61. else
  62. {
  63. MessageBoxToWindow("新增失败", "新增提示!", "error");
  64. }
  65. }
  66. if (Request.QueryString["getPuction"] == "Edit")
  67. {
  68. orderModel.F_ParamId = Convert.ToInt32(Request.QueryString["singleFlage"]);
  69. if (orderBll.Update(orderModel))
  70. {
  71. MessageBoxToWindow("修改成功", "修改提示!", "success");
  72. }
  73. else
  74. {
  75. MessageBoxToWindow("修改失败", "修改提示!", "error");
  76. }
  77. }
  78. }
  79. catch
  80. {
  81. MessageBoxToWindow("新增失败", "新增提示!", "error");
  82. }
  83. }
  84. #region 弹出对话框
  85. /// <summary>
  86. /// 弹出对话框
  87. /// </summary>
  88. /// <param name="title"></param>
  89. /// <param name="content"></param>
  90. /// <param name="type"></param>
  91. public void MessageBoxToWindow(string title, string content, string type)
  92. {
  93. string script = "";
  94. switch (type)
  95. {
  96. case "error"://失败
  97. type = "error";
  98. script = "<script type='text/javascript'> $.ligerDialog.alert('" + title + "','" + content + "','" + type + "');</script>";
  99. break;
  100. case "success"://成功
  101. type = "info";
  102. script = "<script type='text/javascript'> $.ligerDialog.alert('" + title + "','" + content + "','" + type + "',CloseThis);</script>";
  103. break;
  104. case "catch"://异常
  105. type = "warning";
  106. script = "<script type='text/javascript'> $.ligerDialog.alert('" + title + "','" + content + "','" + type + "');</script>";
  107. break;
  108. default:
  109. type = "question";
  110. break;
  111. }
  112. ClientScript.RegisterClientScriptBlock(this.GetType(), "", script);
  113. }
  114. #endregion
  115. }
  116. }