Ejemplo n.º 1
0
        private void btnGetStaff_Click(object sender, EventArgs e)
        {
            string      id = txtStaffID.Text;
            DataProcess dp = new DataProcess();

            dgvListBill.DataSource = dp.ReportStaff(id);
        }
Ejemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            string      id = txtID.Text;
            DataProcess dp = new DataProcess();

            dgvStaff.DataSource = dp.SearchStaff(id);
        }
Ejemplo n.º 3
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            string      id = txtID.Text;
            DataProcess dp = new DataProcess();

            dgvSupplier.DataSource = dp.SearchSupplier(id);
        }
Ejemplo n.º 4
0
        private void btnGetTime_Click(object sender, EventArgs e)
        {
            string      fromDate = dtpFromDate.Value.ToString("yyyy-MM-dd");
            string      toDate   = dtpToDate.Value.ToString("yyyy-MM-dd");
            DataProcess dp       = new DataProcess();

            dgvListBill.DataSource = dp.ReportTime(fromDate, toDate);
        }
Ejemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            string      id = txtID.Text;
            DataProcess dp = new DataProcess();

            dgvListProduct.DataSource    = dp.SearchP(id);
            dgvProductDetails.DataSource = dp.SearchDetailedProduct(id);
        }
Ejemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            string      id = txtID.Text;
            DataProcess dp = new DataProcess();

            dgvListBill.DataSource    = dp.SearchBill(id);
            dgvDetailsBill.DataSource = dp.SearchDetailedBill(id);
        }
Ejemplo n.º 7
0
        private void bntAdd_Click(object sender, EventArgs e)
        {
            string      id   = txtID.Text;
            string      name = txtName.Text;
            string      cmt  = rtbCmt.Text;
            DataProcess dt   = new DataProcess();

            dgvCategory.DataSource = dt.AddCategory(id, name, cmt);
        }
Ejemplo n.º 8
0
        private void btnEdit_Click_1(object sender, EventArgs e)
        {
            string      id   = txtID.Text;
            string      name = txtName.Text;
            string      cmt  = rtbCmt.Text;
            DataProcess dt   = new DataProcess();

            dgvSupplier.DataSource = dt.EditSupplier(id, name, cmt);
        }
Ejemplo n.º 9
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string      user     = txtUser.Text;
            string      pass     = txtPass.Text;
            string      name     = txtName.Text;
            string      power    = cbPower.Text;
            string      sex      = cbSex.Text;
            string      add      = txtAdd.Text;
            string      phone    = txtPhone.Text;
            DateTime    birthday = DateTime.Parse(dtpBirthday.Text);
            string      cmt      = rtbCmt.Text;
            DataProcess dt       = new DataProcess();

            dgvStaff.DataSource = dt.AddStaff(user, pass, name, power, sex, add, phone, birthday, cmt);
        }
Ejemplo n.º 10
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            string      id = txtID.Text;
            DataProcess dt = new DataProcess();

            if (dt.DeleteSupplier(id) == true)
            {
                MessageBox.Show("Delete success!!");
                LoadData();
            }
            else
            {
                MessageBox.Show("Error");
            }
        }
Ejemplo n.º 11
0
        private void FormAddProduct_Click(object sender, EventArgs e)
        {
            DataProcess     dt   = new DataProcess();
            List <Supplier> list = dt.ListSuppliers();

            cbSupplier.DataSource    = list;
            cbSupplier.DisplayMember = "Name";
            cbSupplier.ValueMember   = "ID";
            cbSupplier.SelectedIndex = 0;

            //DataProcess dt = new DataProcess();
            List <Category> list1 = dt.ListCategorys();

            cbCategory.DataSource    = list1;
            cbCategory.DisplayMember = "Name";
            cbCategory.ValueMember   = "ID";
            cbCategory.SelectedIndex = 0;
        }
Ejemplo n.º 12
0
        private void bntLogin_Click(object sender, EventArgs e)
        {
            string      u    = txtUser.Text;
            string      p    = txtPass.Text;
            DataProcess dt   = new DataProcess();
            Staff       temp = dt.CheckLogin(u, p);

            if (temp != null)
            {
                this.Account = temp;
                MessageBox.Show(this, "Logged in successfully", "Result", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Hide();
            }
            else
            {
                MessageBox.Show(this, "Login failed", "Result", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 13
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (addFlag)
     {
         SetEditable(false);
         btnEdit.Text = "Save";
     }
     else
     {
         string      id    = txtID.Text;
         string      p_in  = txtPIn.Text;
         string      p_out = txtPOut.Text;
         string      cmt   = rtbCmt.Text;
         DataProcess dt    = new DataProcess();
         dgvListProduct.DataSource = dt.EditProduct(id, p_in, p_out, cmt);
         btnEdit.Text = "Edit";
     }
     addFlag = !addFlag;
 }
Ejemplo n.º 14
0
        private void btnMakeBill_Click(object sender, EventArgs e)
        {
            string      b_id      = txtBillID.Text;
            string      s_id      = CurrentAccount;
            string      cus_name  = txtNameC.Text;
            string      cus_phone = txtPhoneC.Text;
            string      email     = txtEmailC.Text;
            string      add       = rtbAddC.Text;
            string      cmt       = rtbCmt.Text;
            DataProcess dt        = new DataProcess();

            if (dt.AddBill(b_id, s_id, cus_name, cus_phone, email, add, TotalAmount, cmt, cart))
            {
                MessageBox.Show("Order Success");
            }
            else
            {
                MessageBox.Show("Error");
            }
        }
Ejemplo n.º 15
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            string      id = txtProductID.Text;
            DataProcess dt = new DataProcess();
            Product     p  = dt.SearchProduct(id);

            if (p == null)
            {
                MessageBox.Show("Product not found");
                btnAddToBill.Enabled = false;
                btnMakeBill.Enabled  = false;
            }
            else
            {
                txtNameP.Text        = p.Name;
                txtPriceP.Text       = p.POut.ToString();
                btnAddToBill.Enabled = true;
                btnMakeBill.Enabled  = true;
            }
        }
Ejemplo n.º 16
0
        private void btAdd_Click(object sender, EventArgs e)
        {
            string      id       = txtID.Text;
            string      name     = txtName.Text;
            string      supplier = (cbSupplier.SelectedItem as Supplier).ID;
            string      category = (cbCategory.SelectedItem as Category).ID;
            float       p_in     = float.Parse(txtPIn.Text);
            float       p_out    = float.Parse(txtPOut.Text);
            string      img      = System.IO.Path.GetFileName(openFileDialog1.FileName);
            string      cmt      = rtbCmt.Text;
            DataProcess dt       = new DataProcess();

            if (dt.AddProduct(id, name, supplier, category, p_in, p_out, img, cmt) == true)
            {
                string path = Application.StartupPath.Substring(0, Application.StartupPath.Length - 10);
                System.IO.File.Copy(openFileDialog1.FileName, path + "\\image\\" + img);
                MessageBox.Show("Add successful product");
                LoadData();
            }
            else
            {
                MessageBox.Show("Error!!!!");
            }
        }
Ejemplo n.º 17
0
        private void LoadData()
        {
            DataProcess data = new DataProcess();

            dgvListBill.DataSource = data.ShowBill();
        }
Ejemplo n.º 18
0
        private void LoadData()
        {
            DataProcess data = new DataProcess();

            dgvSupplier.DataSource = data.GetSupplier();
        }
Ejemplo n.º 19
0
        private void LoadData()
        {
            DataProcess data = new DataProcess();

            dgvListProduct.DataSource = data.ShowProducts();
        }
Ejemplo n.º 20
0
        private void LoadData()
        {
            DataProcess data = new DataProcess();

            dgvStaff.DataSource = data.ShowStaff();
        }
Ejemplo n.º 21
0
        private void LoadData()
        {
            DataProcess data = new DataProcess();

            dgvCategory.DataSource = data.GetCategory();
        }