Example #1
0
        private void btnSaleHist_Click(object sender, EventArgs e)
        {
            POS           fpos = new POS();
            formSoldItems frm  = new formSoldItems(fpos);

            frm.ShowDialog();
        }
Example #2
0
 public formSoldItems(POS frm)
 {
     InitializeComponent();
     cn        = new SqlConnection(dbCon.MyConnection());
     dt1.Value = DateTime.Now;
     dt2.Value = DateTime.Now;
     LoadRecords();
     LoadCashier();
     fpos = frm;
 }
Example #3
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            bool   found = false;
            string _username = "", _role = "", _name = "";

            cn.Open();
            cm = new SqlCommand("select * from tblUser where username = @username and password = @password", cn);
            cm.Parameters.AddWithValue("@username", txtUsername.Text);
            cm.Parameters.AddWithValue("@password", txtPass.Text);
            dr = cm.ExecuteReader();
            dr.Read();
            if (dr.HasRows)
            {
                found     = true;
                _username = dr["username"].ToString();
                _role     = dr["role"].ToString();
                _name     = dr["name"].ToString();
            }
            else
            {
                found = false;
            }

            if (found == true)
            {
                if (_role == "Cashier")
                {
                    MessageBox.Show("Welcome " + _name + "!", "Access Granted", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    txtPass.Clear();
                    txtUsername.Clear();
                    this.Hide();
                    POS frm = new POS();
                    frm.lblName.Text = _name + " | " + _role;
                    frm.ShowDialog();
                }
                else
                {
                    MessageBox.Show("Welcome " + _name + "!", "Access Granted", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    txtPass.Clear();
                    txtUsername.Clear();
                    this.Hide();
                    Form1 frm = new Form1();
                    frm.lblName.Text = _name;
                    frm.lblRole.Text = _role;
                    frm.ShowDialog();
                }
            }
            else
            {
                MessageBox.Show("Invalid username or password", "Access Denied", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            dr.Close();
            cn.Close();
        }
Example #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            POS frm = new POS();

            frm.ShowDialog();
        }
Example #5
0
 public formDiscount(POS frm)
 {
     InitializeComponent();
     cn   = new SqlConnection(dbCon.MyConnection());
     fpos = frm;
 }
Example #6
0
 public formRecieptPOS(POS frm)
 {
     InitializeComponent();
     cn   = new SqlConnection(dbCon.MyConnection());
     fpos = frm;
 }
Example #7
0
 public formQty(POS frmpos)
 {
     InitializeComponent();
     cn   = new SqlConnection(dbCon.MyConnection());
     fpos = frmpos;
 }