Exemple #1
0
 private void LoginBtn_Click(object sender, EventArgs e)
 {
     string account = this.LoginAccount.Text.Trim();
     string passwd = this.LoginPWD.Text.Trim();
     Manager user = CheckUser(account, passwd);
     Form show = null;
      if (user == null)//用户或密码错误
     {
         MessageBox.Show(this, "用户不存在或者密码错误", "错误信息");
     }
     else
     {
         int type = user.Type;
         if (type == 0)//系统用户
         {
             show = new SupperForm();
             ((SupperForm)show).User = user;
         }
         else if (type == 1)//培训部管理员
         {
             show = new TrainForm(user);
         }
         else if (type == 2)//招待所管理员
         {
             show = new HotelForm(user);
         }
     }
     if (show != null)
     {
         show.Show();
         this.Hide();
     }
 }
Exemple #2
0
 internal void ReadCustomer(Thread readRun, TrainForm trainForm)
 {
     this.trainForm = trainForm;
     int port = 1;
     port = InitCommExt();//初始化
     if (0 == port)
     {
         throw new Exception("连接读卡器失败...");
     }
     readRun = new Thread(new ThreadStart(ReadCardTrain));
     //thread.IsBackground = true;
     readRun.Start();
 }