frmKePianGuanLi.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. using LYFZ.Model;
  2. using LYFZ.Software.MainBusiness.MicroApplet;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Linq;
  7. using System.Text;
  8. namespace LYFZ.Software.MainBusiness.SelfService
  9. {
  10. public class frmKePianGuanLi : LYFZ.Software.SelfService.frmPersonalCenter
  11. {
  12. frmAdminPage frmPage = null;
  13. string gotoUrl = "http://p.lyfz.net/Index.aspx?entid={0}&key={1}";
  14. public frmKePianGuanLi()
  15. {
  16. this.UcNavigationTool.LabTitle = "客片下载管理";
  17. if (Environment.OSVersion.Version.Major >= 6)
  18. {
  19. try
  20. {
  21. frmPage = new frmAdminPage();
  22. this.btnRefresh.Click += btnRefresh_Click;
  23. this.frmPage.ContextMenuHandler.RunContextMenu += ContextMenuHandler_RunContextMenu;
  24. this.Shown += FrmPersonalCenter_Shown;
  25. this.frmPage.LoadHandler.OnLoadEnd += LoadHandler_OnLoadEnd;
  26. this.frmPage.LoadHandler.OnLoadStart += LoadHandler_OnLoadStart;
  27. }
  28. catch
  29. {
  30. MessageBoxCustom.Show("您的系统不支持客片下载管理功能,请使用 Win7 或以上系统。");
  31. this.Enabled = false;
  32. }
  33. }
  34. else
  35. {
  36. MessageBoxCustom.Show("您的系统不支持客片下载管理功能,请使用 Win7 或以上系统。");
  37. this.Enabled = false;
  38. }
  39. }
  40. public ModelAPPInterface AppInterface = new ModelAPPInterface();
  41. public LYFZ.BLL.BLL_ErpSystemConfigure sysConfigBll = new BLL.BLL_ErpSystemConfigure();
  42. private void FrmPersonalCenter_Shown(object sender, EventArgs e)
  43. {
  44. AppInterface = sysConfigBll.GetModelAPPInterface();
  45. // AppInterface.AppEnId = "E6051908401744";
  46. this.LoadMicroAppletPage(AppInterface.AppEnId);
  47. }
  48. void LoadMicroAppletPage(string AppEnId)
  49. {
  50. if (this.plExMainContainer.Controls.Count <= 0)
  51. {
  52. this.frmPage.SetEmbeddedWindows(this.plExMainContainer);
  53. }
  54. string md5Key =LYFZ.WinAPI.SDKSecurity.MD5Encrypt(String.Format("{0}lyfz.net",AppEnId));
  55. string loadUrl = String.Format(gotoUrl, AppEnId, md5Key);
  56. frmPage.LoadUrl(loadUrl);
  57. // frmPage.LoadUrl("http://lyfz.app.local/H5UI/index.html");
  58. // frmPage.LoadUrl("http://res.app.local/H5UI/index.html");
  59. // frmPage.LoadUrl("https://html5test.com/");
  60. // frmPage.LoadUrl("http://www.baidu.com/");
  61. //frmPage.LoadUrl("http://benediktmeurer.de/ARES-6/");
  62. //frmPage.LoadUrl("https://react-md.mlaursen.com/components/pickers/date");
  63. }
  64. private void ContextMenuHandler_RunContextMenu(object sender, Chromium.Event.CfxRunContextMenuEventArgs e)
  65. {
  66. e.SetReturnValue(true);
  67. }
  68. void btnRefresh_Click(object sender, EventArgs e)
  69. {
  70. myRefresh(this.cbDelHuanChun.Checked);
  71. }
  72. void myRefresh(bool isDelHuanChun)
  73. {
  74. if (isDelHuanChun)
  75. {
  76. this.frmPage.Browser.ReloadIgnoreCache();
  77. string md5Key = LYFZ.WinAPI.SDKSecurity.MD5Encrypt(String.Format("{0}lyfz.net", AppInterface.AppEnId));
  78. frmPage.LoadUrl(String.Format(gotoUrl, AppInterface.AppEnId, md5Key));
  79. }
  80. else
  81. {
  82. this.frmPage.Browser.Reload();
  83. }
  84. }
  85. private void LoadHandler_OnLoadStart(object sender, Chromium.Event.CfxOnLoadStartEventArgs e)
  86. {
  87. }
  88. private void LoadHandler_OnLoadEnd(object sender, Chromium.Event.CfxOnLoadEndEventArgs e)
  89. {
  90. }
  91. }
  92. }