鹤壁电销版 自用

customerlabelmodify.aspx.cs 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. namespace HySoft.BaseCallCenter.Web.customermanage
  8. {
  9. public partial class customerlabelmodify : System.Web.UI.Page
  10. {
  11. private BLL.T_Sys_DictionaryValue dicBLL = new BLL.T_Sys_DictionaryValue();
  12. protected void Page_Load(object sender, EventArgs e)
  13. {
  14. if (!IsPostBack)
  15. {
  16. var action = Common.CommonRequest.GetString("action");
  17. switch (action)
  18. {
  19. case "edit":
  20. Modify();
  21. break;
  22. default:
  23. break;
  24. }
  25. }
  26. }
  27. private void Modify()
  28. {
  29. var labelId = Common.CommonRequest.GetInt("labelId", 0);
  30. if (labelId > 0)
  31. {
  32. var label = new BLL.T_Sys_DictionaryValue().GetModel(labelId);
  33. this.hiddLabelId.Value = label.F_DictionaryValueId.ToString();
  34. this.txtLabelName.Text = label.F_Name;
  35. }
  36. }
  37. protected void btnSubmit_Click(object sender, EventArgs e)
  38. {
  39. var labelId = 0;
  40. var labelSort = 0;
  41. int.TryParse(hiddLabelId.Value, out labelId);
  42. var labelName = txtLabelName.Text;
  43. var labelDescription = txtLabelDescription.Text;
  44. int.TryParse(txtLabelSort.Text, out labelSort);
  45. if (labelId > 0)
  46. {
  47. var model = dicBLL.GetModel(labelId);
  48. model.F_Name = labelName;
  49. dicBLL.Update(model);
  50. }
  51. else
  52. {
  53. dicBLL.Add(new Model.T_Sys_DictionaryValue
  54. {
  55. F_Name = labelName,
  56. F_DictionaryFlag = "KHBQ",
  57. F_Describe = labelDescription,
  58. F_State = "1",
  59. F_Sort = labelSort,
  60. F_ValueCode = ""
  61. });
  62. }
  63. }
  64. }
  65. }