Ejemplo n.º 1
0
        private void button60_Click(object sender, EventArgs e)
        {
            FrmLayout formchuyen = new FrmLayout(StaticClass.cashierId);

            formchuyen.isTransfer  = true;
            formchuyen.formBanHang = this;
            formchuyen.ShowDialog();
        }
Ejemplo n.º 2
0
 public FrmLayout(string userName)
 {
     m_Instance = this;
     InitializeComponent();
     label1.Text = userName;
     pageIndex = 1;
     selectedSection = 0;
    
 }
Ejemplo n.º 3
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();
                }
            }
        }
Ejemplo n.º 4
0
        private void button46_Click(object sender, EventArgs e)
        {
            int check = serviceGet.Login(textBox1.Text, textBox2.Text, "1001");

            if (check == 0)
            {
                Alert.Show("Đăng nhập sai mã nhân\n viên !", Color.Red);
                this.FrmLogin_Load(null, null);
                textBox1.Focus();
            }
            else if (check == 1)
            {
                Alert.Show("Password không đúng !", Color.Red);
                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();
                }
                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();
                textBox1.Focus();
            }
            else if (check == 3)
            {
                Alert.Show("Tài khoản đã bị vô hiệu.", Color.Red);
                this.FrmLogin_Load(null, null);
                textBox1.Focus();
            }
        }
Ejemplo n.º 5
0
 public FrmLayout()
 {
     InitializeComponent();
     pageIndex = 1;
     selectedSection = 0;
     sections = new ArrayList();
     m_Instance = this;
     for (int i = 1; i < 8; i++)
     {
         sections.Add(i.ToString());
         ArrayList tmp = new ArrayList();
         button aa = new button(100,100,50,50);
         aa.Text = i.ToString();
         tmp.Add(aa);
         PanelLayout panel = new PanelLayout(tmp,i.ToString());
         listPanel.Add(i.ToString(),panel);
         this.Controls.Add((PanelLayout)listPanel[i.ToString()]);
     }
 }
Ejemplo n.º 6
0
 private void button64_Click(object sender, EventArgs e)
 {
     if(Employee.CheckGrant(StaticClass.storeId,StaticClass.cashierId,Employee.CFA_TRANSFER_TABLE))
     {
         FrmLayout formchuyen = new FrmLayout(StaticClass.cashierId);
         formchuyen.isTransfer = true;
         formchuyen.formBanHang = this;
         formchuyen.ShowDialog();
     }
     
 }
Ejemplo n.º 7
0
 public static FrmLayout GetInstance()
 {
     if (m_Instance == null)
         m_Instance = new FrmLayout();
     return m_Instance;
 }
Ejemplo n.º 8
0
        private void button46_Click(object sender, EventArgs e)
        {

            int check = serviceGet.Login(textBox1.Text, textBox2.Text, "1001");
            if(check == 0)
            {
                Alert.Show("Đăng nhập sai mã nhân\n viên !",Color.Red);
                this.FrmLogin_Load(null,null);
                textBox1.Focus();
            }
            else if(check == 1)
            {
                Alert.Show("Password không đúng !",Color.Red);
                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();
                }
                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();
                textBox1.Focus();
            }
            else if(check == 3)
            {
                Alert.Show("Tài khoản đã bị vô hiệu.", Color.Red);
                this.FrmLogin_Load(null, null);
                textBox1.Focus();
            }
            

        }
Ejemplo n.º 9
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();
                }

            }
            
        }
Ejemplo n.º 10
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();
     }
 }
Ejemplo n.º 11
0
 private void button60_Click(object sender, EventArgs e)
 {
     FrmLayout formchuyen = new FrmLayout(StaticClass.cashierId);
     formchuyen.isTransfer = true;
     formchuyen.formBanHang = this;
     formchuyen.ShowDialog();
 }
Ejemplo n.º 12
0
 public void updateForm(byte t)
 {
     FrmLayout.GetInstance().RefreshForm();
 }