Beispiel #1
0
        private void button7_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "")
            {
                try
                {
                    string path = Application.StartupPath + "\\ConfigServer.reg";
                    string data = lic.FileReadWrite.ReadFile(path);
                    if (data != string.Empty)
                    {
                        string[] parts = data.Split('@');
                        ipServer   = parts[0];
                        portServer = Convert.ToInt32(parts[1]);
                    }

                    if (serviceGet.LoginBySwipe(textBox1.Text, StaticClass.storeId) == 0)
                    {
                        string tmp = "";
                        if (StaticClass.thongTinNV["EmpName"].ToString() == "")
                        {
                            tmp = textBox1.Text;
                        }
                        else
                        {
                            tmp = StaticClass.thongTinNV["EmpName"].ToString();
                        }
                        LoginThread = new Thread(BeginLogin);
                        LoginThread.Start(tmp);
                        StaticClass.taxRate = getGui.GetTaxRate(StaticClass.storeId).Rows[0];
                        Utilities.Utils.WriteLogFile(StaticClass.cashierId + "\t Dang nhap");
                        layout           = new FrmLayout(tmp);
                        layout.formLogin = this;
                        layout.ShowDialog();
                    }
                    else
                    {
                        panel2.Visible = true;
                        panel1.Visible = false;
                        panel2.BringToFront();
                        textBox2.Focus();
                    }
                }
                catch (Exception)
                {
                    panel2.Visible = true;
                    panel1.Visible = false;
                    panel2.BringToFront();
                    textBox2.Focus();
                }
            }
        }
Beispiel #2
0
 private void creTextBox2_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 13)
     {
         Service.ServiceGet serviceGet = new ServiceGet();
         if (serviceGet.checkAdminPass(creTextBox2.Text, StaticClass.storeId))
         {
             Success             = true;
             StaticClass.isAdmin = true;
             DialogResult        = DialogResult.OK;
         }
         if (serviceGet.LoginBySwipe(creTextBox2.Text, StaticClass.storeId) == 0)
         {
             Success      = true;
             DialogResult = DialogResult.OK;
         }
         creTextBox1.SelectAll();
         creTextBox1.Focus();
     }
 }