14b200dc50575457f6a155a56911889cd5d89d8a.svn-base 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using System.Threading;
  7. using Core.Mes.ClientFrameWork;
  8. using Core.Mes.IBaseInterface;
  9. namespace Core.Mes.ClientManager
  10. {
  11. /// <summary>
  12. /// FrmPasswd 的摘要说明。
  13. /// </summary>
  14. public class FrmPasswd : System.Windows.Forms.Form
  15. {
  16. #region "Construct "
  17. private System.Windows.Forms.TextBox textBox1;
  18. private System.Windows.Forms.TextBox textBox2;
  19. private System.Windows.Forms.TextBox textBox3;
  20. private System.Windows.Forms.TextBox textBox4;
  21. private System.Windows.Forms.Button button1;
  22. private System.Windows.Forms.Button button2;
  23. private System.Windows.Forms.Label label1;
  24. private System.Windows.Forms.Label label2;
  25. private System.Windows.Forms.Label label3;
  26. private System.Windows.Forms.Label label4;
  27. /// <summary>
  28. /// 必需的设计器变量。
  29. /// </summary>
  30. private System.ComponentModel.Container components = null;
  31. public FrmPasswd()
  32. {
  33. //
  34. // Windows 窗体设计器支持所必需的
  35. //
  36. InitializeComponent();
  37. //
  38. // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
  39. //
  40. }
  41. /// <summary>
  42. /// 清理所有正在使用的资源。
  43. /// </summary>
  44. protected override void Dispose( bool disposing )
  45. {
  46. if( disposing )
  47. {
  48. if(components != null)
  49. {
  50. components.Dispose();
  51. }
  52. }
  53. base.Dispose( disposing );
  54. }
  55. #region Windows 窗体设计器生成的代码
  56. /// <summary>
  57. /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  58. /// 此方法的内容。
  59. /// </summary>
  60. private void InitializeComponent()
  61. {
  62. this.textBox1 = new System.Windows.Forms.TextBox();
  63. this.textBox2 = new System.Windows.Forms.TextBox();
  64. this.textBox3 = new System.Windows.Forms.TextBox();
  65. this.textBox4 = new System.Windows.Forms.TextBox();
  66. this.button1 = new System.Windows.Forms.Button();
  67. this.button2 = new System.Windows.Forms.Button();
  68. this.label1 = new System.Windows.Forms.Label();
  69. this.label2 = new System.Windows.Forms.Label();
  70. this.label3 = new System.Windows.Forms.Label();
  71. this.label4 = new System.Windows.Forms.Label();
  72. this.SuspendLayout();
  73. //
  74. // textBox1
  75. //
  76. this.textBox1.Location = new System.Drawing.Point(64, 14);
  77. this.textBox1.Name = "textBox1";
  78. this.textBox1.Size = new System.Drawing.Size(112, 21);
  79. this.textBox1.TabIndex = 0;
  80. this.textBox1.Text = "";
  81. //
  82. // textBox2
  83. //
  84. this.textBox2.Location = new System.Drawing.Point(64, 43);
  85. this.textBox2.Name = "textBox2";
  86. this.textBox2.PasswordChar = '*';
  87. this.textBox2.Size = new System.Drawing.Size(112, 21);
  88. this.textBox2.TabIndex = 1;
  89. this.textBox2.Text = "";
  90. //
  91. // textBox3
  92. //
  93. this.textBox3.Location = new System.Drawing.Point(64, 72);
  94. this.textBox3.Name = "textBox3";
  95. this.textBox3.PasswordChar = '*';
  96. this.textBox3.Size = new System.Drawing.Size(112, 21);
  97. this.textBox3.TabIndex = 2;
  98. this.textBox3.Text = "";
  99. //
  100. // textBox4
  101. //
  102. this.textBox4.Location = new System.Drawing.Point(64, 101);
  103. this.textBox4.Name = "textBox4";
  104. this.textBox4.PasswordChar = '*';
  105. this.textBox4.Size = new System.Drawing.Size(112, 21);
  106. this.textBox4.TabIndex = 3;
  107. this.textBox4.Text = "";
  108. //
  109. // button1
  110. //
  111. this.button1.Location = new System.Drawing.Point(16, 136);
  112. this.button1.Name = "button1";
  113. this.button1.TabIndex = 4;
  114. this.button1.Text = "修改";
  115. this.button1.Click += new System.EventHandler(this.button1_Click);
  116. //
  117. // button2
  118. //
  119. this.button2.Location = new System.Drawing.Point(101, 136);
  120. this.button2.Name = "button2";
  121. this.button2.TabIndex = 5;
  122. this.button2.Text = "关闭";
  123. this.button2.Click += new System.EventHandler(this.button2_Click);
  124. //
  125. // label1
  126. //
  127. this.label1.AutoSize = true;
  128. this.label1.Location = new System.Drawing.Point(16, 16);
  129. this.label1.Name = "label1";
  130. this.label1.Size = new System.Drawing.Size(42, 17);
  131. this.label1.TabIndex = 6;
  132. this.label1.Text = "用户名";
  133. //
  134. // label2
  135. //
  136. this.label2.AutoSize = true;
  137. this.label2.Location = new System.Drawing.Point(16, 45);
  138. this.label2.Name = "label2";
  139. this.label2.Size = new System.Drawing.Size(42, 17);
  140. this.label2.TabIndex = 7;
  141. this.label2.Text = "旧密码";
  142. //
  143. // label3
  144. //
  145. this.label3.AutoSize = true;
  146. this.label3.Location = new System.Drawing.Point(16, 74);
  147. this.label3.Name = "label3";
  148. this.label3.Size = new System.Drawing.Size(42, 17);
  149. this.label3.TabIndex = 8;
  150. this.label3.Text = "新密码";
  151. //
  152. // label4
  153. //
  154. this.label4.AutoSize = true;
  155. this.label4.Location = new System.Drawing.Point(4, 103);
  156. this.label4.Name = "label4";
  157. this.label4.Size = new System.Drawing.Size(54, 17);
  158. this.label4.TabIndex = 9;
  159. this.label4.Text = "确认密码";
  160. //
  161. // FrmPasswd
  162. //
  163. this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
  164. this.ClientSize = new System.Drawing.Size(192, 173);
  165. this.Controls.Add(this.label4);
  166. this.Controls.Add(this.label3);
  167. this.Controls.Add(this.label2);
  168. this.Controls.Add(this.label1);
  169. this.Controls.Add(this.button2);
  170. this.Controls.Add(this.button1);
  171. this.Controls.Add(this.textBox4);
  172. this.Controls.Add(this.textBox3);
  173. this.Controls.Add(this.textBox2);
  174. this.Controls.Add(this.textBox1);
  175. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  176. this.MaximizeBox = false;
  177. this.MinimizeBox = false;
  178. this.Name = "FrmPasswd";
  179. this.ShowInTaskbar = false;
  180. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
  181. this.Text = "修改密码";
  182. this.Load += new System.EventHandler(this.FrmPasswd_Load);
  183. this.ResumeLayout(false);
  184. }
  185. #endregion
  186. #endregion
  187. #region " Valiable "
  188. public string strUserID = "";
  189. public bool _remoteFlag = false;
  190. #endregion
  191. #region " Init "
  192. private void FrmPasswd_Load(object sender, System.EventArgs e)
  193. {
  194. this.textBox1.Text = ClientCommon._UserInfo.LoginID;
  195. }
  196. #endregion
  197. #region " Button Events "
  198. private void button1_Click(object sender, System.EventArgs e)
  199. {
  200. if (this.textBox3.Text.Trim() != this.textBox4.Text.Trim())
  201. {
  202. MessageBox.Show("两次输入的新密码不一致,请重新设定。","提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
  203. return;
  204. }
  205. string strOut = "";
  206. string loginID = this.textBox1.Text.Trim();
  207. string passwd = this.textBox2.Text.Trim();
  208. string passwdNew = this.textBox3.Text.Trim();
  209. try
  210. {
  211. object obj = ClientCommon._RemotingHelp.ExecuteMethod("ServerCommon","Core.Mes.ServerCommon.UserInfoManager","ChangePasswd",
  212. new object[]{loginID, passwd, passwdNew}, out strOut);
  213. if (strOut != "") throw new Exception(strOut);
  214. if (Convert.ToInt32(obj)>0)
  215. {
  216. MessageBox.Show("密码修改成功!","提示",MessageBoxButtons.OK, MessageBoxIcon.Information);
  217. this.Close();
  218. return;
  219. }
  220. else
  221. {
  222. MessageBox.Show("密码修改失败!","提示",MessageBoxButtons.OK, MessageBoxIcon.Information);
  223. }
  224. }
  225. catch (Exception ex)
  226. {
  227. MessageBox.Show("密码修改失败!\n" + ex.Message,"提示",MessageBoxButtons.OK, MessageBoxIcon.Information);
  228. }
  229. }
  230. private void button2_Click(object sender, System.EventArgs e)
  231. {
  232. this.Close();
  233. }
  234. #endregion
  235. }
  236. }