frmMicroLetterPlatformConfig.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. namespace LYFZ.Software.MainBusiness.OAShopManagement
  10. {
  11. public partial class frmMicroLetterPlatformConfig : LYFZ.Software.UI.OAShopManagement.frmMicroLetterPlatformConfig
  12. {
  13. LYFZ.BLL.BLL_ErpSystemConfigure config = new BLL.BLL_ErpSystemConfigure();
  14. LYFZ.Model.ModelAPPInterface model = new LYFZ.Model.ModelAPPInterface();
  15. public frmMicroLetterPlatformConfig()
  16. {
  17. this.btn_OK.Click += btn_OK_Click;
  18. model = config.GetModelAPPInterface();
  19. tb_AppUrlPath.Text = model.AppUrlPath;
  20. tb_AppID.Text = model.AppEnId;
  21. /* DataSet ds = config.GetSystemConfigure("*", "AppInterface");
  22. if(ds.Tables[0].Rows.Count>0)
  23. {
  24. model = config.GetModel(Convert.ToInt32(ds.Tables[0].Rows[0]["ID"]));
  25. try
  26. {
  27. Newtonsoft.Json.Linq.JObject jobject = (Newtonsoft.Json.Linq.JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(model.Sconfig_Value);
  28. tb_AppUrlPath.Text = jobject.GetValue("AppUrlPath").ToString();
  29. tb_AppID.Text = jobject.GetValue("AppEnId").ToString();
  30. }
  31. catch
  32. {
  33. }
  34. }
  35. else
  36. {
  37. model = new Model.Model_ErpSystemConfigure()
  38. {
  39. Sconfig_Code = "AppInterface",
  40. Sconfig_Name = "App接口配置",
  41. Sconfig_IsEnabled = true,
  42. Sconfig_Remark = "App接口配置",
  43. Sconfig_Order = 1,
  44. Sconfig_Type = "System",
  45. Sconfig_CreateDatetime = DateTime.Now
  46. };
  47. }*/
  48. }
  49. /// <summary>
  50. /// 确定保存
  51. /// </summary>
  52. /// <param name="sender"></param>
  53. /// <param name="e"></param>
  54. void btn_OK_Click(object sender, EventArgs e)
  55. {
  56. /* dynamic dyObject = new System.Dynamic.ExpandoObject();
  57. dyObject.AppUrlPath=tb_AppUrlPath.Text;
  58. dyObject.AppEnId = tb_AppID.Text;
  59. model.Sconfig_Value = Newtonsoft.Json.JsonConvert.SerializeObject(dyObject);
  60. if(model.ID>0)
  61. {
  62. config.Update(model);
  63. }
  64. else
  65. {
  66. config.Add(model);
  67. }*/
  68. config.UpdateAPPInterface(tb_AppUrlPath.Text, tb_AppID.Text);
  69. MessageBoxCustom.Show("保存成功!");
  70. this.Close();
  71. }
  72. }
  73. }