FrmChangeGroup.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. using Core.Mes.Client.Comm.Server;
  10. using CoreFS.CA06;
  11. namespace Core.StlMes.Client.ZGMil.Popup
  12. {
  13. public partial class FrmChangeGroup : FrmBase
  14. {
  15. OpeBase _ob = null;
  16. public FrmChangeGroup(OpeBase ob)
  17. {
  18. InitializeComponent();
  19. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
  20. _ob = ob;
  21. }
  22. public string _UserID //用户名 用于传值
  23. {
  24. get { return txtUserID.Text; }
  25. }
  26. public string _PassWord //密码 用于传值
  27. {
  28. get { return txtPassWord.Text; }
  29. }
  30. private void BtnOK()
  31. {
  32. DataTable dt = ServerHelper.GetData("com.steering.mes.zgmil.coup.FeedSawResult.getUser", new object[] { txtUserID.Text, txtPassWord.Text }, _ob);
  33. if (dt.Rows.Count > 0)
  34. {
  35. this.DialogResult = DialogResult.OK;
  36. }
  37. else
  38. {
  39. MessageBox.Show("用户名,密码错误。");
  40. return;
  41. }
  42. }
  43. private void btnCommit_Click(object sender, EventArgs e)
  44. {
  45. BtnOK();
  46. }
  47. private void btnCancel_Click(object sender, EventArgs e)
  48. {
  49. this.Close();
  50. }
  51. //回车事件
  52. private void txtUserID_KeyPress(object sender, KeyPressEventArgs e)
  53. {
  54. if (e.KeyChar == (char)13)
  55. {
  56. this.SelectNextControl(this.ActiveControl, true, true, true, true);
  57. }
  58. }
  59. //回车事件
  60. private void txtPassWord_KeyPress(object sender, KeyPressEventArgs e)
  61. {
  62. if (e.KeyChar == (char)13)
  63. {
  64. BtnOK();
  65. }
  66. }
  67. }
  68. }