frmMain.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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.ManagementService
  10. {
  11. public partial class frmMain : LYFZ.ComponentLibrary.BaseFormRelease
  12. {
  13. public frmMain()
  14. {
  15. /* //验证手机号
  16. string RecipientPhone = "";
  17. string ErrorPhone = LYFZ.WinAPI.CustomPublicMethod.ValidationPhones("13430206042,13790621789,13811204686,15817080482,15818476364,18688613497,18820112855,18825162598", ref RecipientPhone);
  18. string[] phones = RecipientPhone.Split(',');
  19. string tempSMSContent = "您好,玛雅社拍摄前注意事项∶ 1.今天晚上两位清洗好头发,不打发胶; 2.先生剃掉胡须,小姐处理腋下,手毛; 3.小姐穿浅色打底裤(防止走光);穿浅色高跟鞋; 4.需要准备防晒霜,防蚊水,以免晒伤和被蚊虫叮伤; 5.先生带黑色皮鞋,皮带,黑色袜子,喜欢的衬衣和西装可带上。如高跟鞋,皮鞋没有的情况下我们可为亲准备; 6.小姐鞋码数大于39码需自行准备;先生鞋码大于44码需自行准备; 7.如有纪念意义的物品,服装可以带过来拍摄纪念; 8.拍摄当天请不要带陪同; 9.自驾车顾客请提前把车尾箱清空; 10.拍摄前一天晚上请早点休息,拍摄当天保持精神饱满,愉快心情; 11.明天早上8:00准时到玛雅社芳村总店,总店地址∶广州荔湾区芳村大道东200号1850创意园67栋,联系电话是∶81775892为了不影响您的拍摄行程,请务必准时! 12.此信息是系统统一发送,不必回复。祝您幸福愉快回TD退订【玛雅社】";
  20. //代理扣费(条数)
  21. int AgentChargeback = LYFZ.WinAPI.CustomPublicMethod.GetSendSmsCount(ref tempSMSContent, "【玛雅社】");
  22. //此句作用为多处理一次短信内容
  23. LYFZ.WinAPI.CustomPublicMethod.GetSendSmsCount(ref tempSMSContent, "【玛雅社】");
  24. AgentChargeback = AgentChargeback * phones.Length;
  25. if (ErrorPhone != null && ErrorPhone.Trim().Length > 0)
  26. {
  27. AgentChargeback = AgentChargeback * (phones.Length + ErrorPhone.Trim().Split(',').Length);
  28. }
  29. LYFZ.MandaoSmsInterface.HTTPSmsSendReturnInfo sendifno = new LYFZ.MandaoSmsInterface.HTTPSmsSendReturnInfo("081007051150896049", tempSMSContent.Trim().Length, RecipientPhone.Split(',').Length);
  30. MessageBox.Show(sendifno.SendCount.ToString());*/
  31. /* 触发,通知,帐号1:SDK-BBX-010-24581
  32. 密码:6)a51-b)
  33. 特服号:297533
  34. * 920982ae84dce71e51f3d6cd1884a8ee
  35. sn=SDK-BBX-010-24581&pwd=920982AE84DCE71E51F3D6CD1884A8EE
  36. 营销,帐号2:SDK-BBX-010-24582
  37. 密码:1b-e06A-
  38. 特服号:297534 */
  39. //string pwdmd5 = LYFZ.Command.Command_MD5.md5("SDK-BBX-010-24581" + "6)a51-b)").ToUpper();
  40. // string fff = "庆六一微笑宝贝电影主题《奇幻森林》荣耀发布!只需6.1元即可抢先拍摄体验!详情加客服微信了解,微信号:wxbbkefu-02 h【微笑宝贝】";
  41. // string tempSMSContent = fff;
  42. //代理扣费(条数)
  43. // int AgentChargeback = LYFZ.WinAPI.CustomPublicMethod.GetSendSmsCount(ref tempSMSContent, "【微笑宝贝】");
  44. /* LYFZ.Model.Model_SMSAccountInformation sMSAccountInformation = new Model.Model_SMSAccountInformation();
  45. sMSAccountInformation.SingleUid = LYFZ.DAL.DAL_Config.ConfigModel.MandaoAccount;
  46. sMSAccountInformation.SinglePwd = LYFZ.DAL.DAL_Config.ConfigModel.MandaoPassword;
  47. sMSAccountInformation.SingleRechargeRemindbalance = LYFZ.DAL.DAL_Config.ConfigModel.RechargeRemindbalanceMandao;
  48. sMSAccountInformation.SingleRechargeRemindPhone = LYFZ.DAL.DAL_Config.ConfigModel.RechargeRemindPhoneMandao;
  49. sMSAccountInformation.SwitchingCondition = LYFZ.DAL.DAL_Config.ConfigModel.Mandao_SwitchingCondition;
  50. sMSAccountInformation.BulkUid = LYFZ.DAL.DAL_Config.ConfigModel.MandaoAccount_Bulk;
  51. sMSAccountInformation.BulkPwd = LYFZ.DAL.DAL_Config.ConfigModel.MandaoPassword_Bulk;
  52. sMSAccountInformation.BulkRechargeRemindbalance = LYFZ.DAL.DAL_Config.ConfigModel.RechargeRemindbalanceMandao_Bulk;
  53. sMSAccountInformation.BulkRechargeRemindPhone = LYFZ.DAL.DAL_Config.ConfigModel.RechargeRemindPhoneMandao_Bulk;
  54. // bool retbl = LYFZ.MandaoSmsInterface.HTTPSmsInterface.CheckConnect("http://sdk2.entinfo.cn:8061/");
  55. // LYFZ.MandaoSmsInterface.HTTPSmsInterface.SendSmsMessages(sMSAccountInformation.SingleUid, sMSAccountInformation.SinglePwd,"13669511419","我是测试短信,我又来了!【利亚方舟】");
  56. LYFZ.MandaoSmsInterface.HTTPSmsInterface.SendSmsMessagesPOST(sMSAccountInformation.SingleUid, sMSAccountInformation.SinglePwd, "13669511419", "感谢您的参与,稍后客服将致电您并为您介绍详细的优惠券使用情况【利亚方舟】");
  57. */
  58. InitializeComponent();
  59. this.Shown += frmMain_Shown;
  60. this.Load += frmMain_Load;
  61. }
  62. void frmMain_Load(object sender, EventArgs e)
  63. {
  64. // 利亚方舟软件用户管理系统V7.151121
  65. //string vnumber = Application.ProductVersion.Replace(".", "");
  66. this.Text = "利亚方舟软件用户管理系统 V" + Application.ProductVersion;
  67. }
  68. void InitializeShowFrm()
  69. {
  70. this.ShowEmbedChildForm(new frmUserManager());
  71. SetThisButton(this.gbtnUserManager);
  72. this.WindowState = FormWindowState.Maximized;
  73. }
  74. void frmMain_Shown(object sender, EventArgs e)
  75. {
  76. if (LYFZ.DAL.tb_Users.UsersModel == null)
  77. {
  78. frmLogin frm = new frmLogin();
  79. if (frm.ShowDialog() == DialogResult.OK)
  80. {
  81. InitializeShowFrm();
  82. }
  83. else
  84. {
  85. this.Close();
  86. }
  87. }
  88. else {
  89. InitializeShowFrm();
  90. }
  91. }
  92. public void SetThisButton(LYFZ.ComponentLibrary.GlassButton gbtn)
  93. {
  94. foreach (Control control in this.Controls)
  95. {
  96. if (control.GetType().Equals(gbtn.GetType()))
  97. {
  98. LYFZ.ComponentLibrary.GlassButton selectGbtn = (LYFZ.ComponentLibrary.GlassButton)control;
  99. selectGbtn.ThisButton = false;
  100. }
  101. }
  102. gbtn.ThisButton = true;
  103. }
  104. #region 加载显示窗体
  105. /// <summary>
  106. /// 嵌入式显示
  107. /// </summary>
  108. /// <param name="newfrm">要显示的窗体对象</param>
  109. /// <returns></returns>
  110. public void ShowEmbedChildForm(LYFZ.ComponentLibrary.BaseContentsFormMain newfrm)
  111. {
  112. string frmKey = newfrm.Name;
  113. LYFZ.ComponentLibrary.BaseContentsFormMain frm = GetSortedListInForm(frmKey);
  114. if (frm == null)
  115. {
  116. frm = newfrm;
  117. sFormList.Add(frmKey, frm);
  118. ShowEmbedChildForm(frm, this.plFormMainContent.Controls);
  119. }
  120. else
  121. {
  122. frm.Show();
  123. }
  124. }
  125. /// <summary>
  126. /// 嵌入式显示
  127. /// </summary>
  128. /// <param name="frm">要显示的窗体</param>
  129. /// <param name="controls">父控件集合</param>
  130. /// <returns></returns>
  131. public LYFZ.ComponentLibrary.BaseContentsFormMain ShowEmbedChildForm(LYFZ.ComponentLibrary.BaseContentsFormMain frm, System.Windows.Forms.Control.ControlCollection controls)
  132. {
  133. System.GC.Collect();
  134. // frm.Name = "frmContainerMain";
  135. frm.TopLevel = false;
  136. frm.IsShadow = false;
  137. frm.MaximizeBox = false;
  138. frm.MinimizeBox = false;
  139. frm.IsShowCloseBox = false;
  140. frm.TitleBgImageHeight = 0;
  141. frm.BottomBgImageHeight = 0;
  142. frm.IsMaximized = false;
  143. frm.FormMobile = false;
  144. frm.IsUserControlsSize = false;
  145. frm.Dock = System.Windows.Forms.DockStyle.Fill;
  146. frm.IsCustomScrollBar = true;
  147. for (int i = 0; i < controls.Count; i++)
  148. {
  149. controls[i].Dispose();
  150. }
  151. controls.Clear();
  152. controls.Add(frm);
  153. frm.Show();
  154. return frm;
  155. }
  156. /// <summary>
  157. /// 已显示过的所有窗体集合
  158. /// </summary>
  159. private SortedList<string, LYFZ.ComponentLibrary.BaseContentsFormMain> sFormList = new SortedList<string, ComponentLibrary.BaseContentsFormMain>();
  160. /// <summary>
  161. /// 从SortedList集合中获取已显示过的所有窗体
  162. /// </summary>
  163. /// <param name="key"></param>
  164. /// <returns></returns>
  165. public LYFZ.ComponentLibrary.BaseContentsFormMain GetSortedListInForm(string key)
  166. {
  167. try
  168. {
  169. LYFZ.ComponentLibrary.BaseContentsFormMain frm = sFormList[key];
  170. if (frm.IsDisposed)
  171. {
  172. frm = null;
  173. sFormList.Remove(key);
  174. }
  175. return frm;
  176. }
  177. catch
  178. {
  179. return null;
  180. }
  181. }
  182. #endregion
  183. private void gbtnUserManager_Click(object sender, EventArgs e)
  184. {
  185. this.ShowEmbedChildForm(new frmUserManager());
  186. SetThisButton(this.gbtnUserManager);
  187. }
  188. private void gbtnSMSManagement_Click(object sender, EventArgs e)
  189. {
  190. this.ShowEmbedChildForm(new frmSMSManager());
  191. SetThisButton(this.gbtnSMSManagement);
  192. }
  193. private void gbtnTerminalConnect_Click(object sender, EventArgs e)
  194. {
  195. this.ShowEmbedChildForm(new frmTerminalConnect());
  196. SetThisButton(this.gbtnTerminalConnect);
  197. }
  198. private void gbtnLogs_Click(object sender, EventArgs e)
  199. {
  200. this.ShowEmbedChildForm(new frmSystemLogs());
  201. SetThisButton(this.gbtnLogs);
  202. }
  203. private void gbtnSystem_Click(object sender, EventArgs e)
  204. {
  205. this.ShowEmbedChildForm(new frmSystemSetting());
  206. SetThisButton(this.gbtnSystem);
  207. }
  208. private void gbtnSMSFilter_Click(object sender, EventArgs e)
  209. {
  210. this.ShowEmbedChildForm(new frmFilterMobileNumber());
  211. SetThisButton(this.gbtnSMSFilter);
  212. }
  213. }
  214. }