Exemplo n.º 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();
                }
            }
        }
Exemplo n.º 2
0
        private void button46_Click(object sender, EventArgs e)
        {
            int check = serviceGet.Login(textBox1.Text, textBox2.Text, "1001");

            if (check == 0)
            {
                MessageBox.Show("Đăng nhập sai mã nhân viên !");
                this.FrmLogin_Load(null, null);
                textBox1.Focus();
            }
            else if (check == 1)
            {
                MessageBox.Show("Password không đúng !");
                this.FrmLogin_Load(null, null);
            }
            else if (check == 2)
            {
                //StaticClass.cashierId = textBox1.Text;
                string tmp = "";
                if (StaticClass.thongTinNV["EmpName"].ToString() == "")
                {
                    tmp = textBox1.Text;
                }
                else
                {
                    tmp = StaticClass.thongTinNV["EmpName"].ToString();
                }
                StaticClass.taxRate = getGui.GetTaxRate(StaticClass.storeId).Rows[0];
                layout           = new FrmLayout(tmp);
                layout.formLogin = this;
                layout.ShowDialog();
            }
        }
Exemplo n.º 3
0
        private void FrmSetupTax_Load(object sender, EventArgs e)
        {
            Services.get_GUI a       = new get_GUI();
            DataTable        taxRate = a.GetTaxRate(StaticClass.storeId);

            creTextBox1.Text = String.Format("{0:0.##}", (Convert.ToDecimal(taxRate.Rows[0]["Tax1_Rate"]) * 100));
            creTextBox2.Text = String.Format("{0:0.##}", (Convert.ToDecimal(taxRate.Rows[0]["Tax2_Rate"]) * 100));
            creTextBox3.Text = String.Format("{0:0.##}", (Convert.ToDecimal(taxRate.Rows[0]["Tax3_Rate"]) * 100));
        }