Example #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();
     }
 }
Example #2
0
/*
        internal void SearchCustomer(Thread thread, HotelForm hotelForm)
        {
            this.hotelForm = hotelForm;
            int port = 1;
            port = InitCommExt();//初始化
            if (0 == port)
            {
                throw new Exception("连接读卡器失败...");
            }
            thread = new Thread(new ThreadStart(ReadCard));
            thread.IsBackground = false;
            thread.Start();
        }
        */

        internal void ReadCustomer(Thread thread, HotelForm hotelForm)
        {
            this.hotelForm = hotelForm;
            int port = 1;
            port = InitCommExt();//初始化
            if (0 == port)
            {
                throw new Exception("连接读卡器失败...");
            }
            thread = new Thread(new ThreadStart(ReadCardHotel));
            //thread.IsBackground = true;
            thread.Start();
        }