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

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

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

            dgvSupplier.DataSource = dp.SearchSupplier(id);
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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");
            }
        }
Esempio 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;
        }
Esempio 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);
            }
        }
Esempio 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;
 }
Esempio 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");
            }
        }
Esempio 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;
            }
        }
Esempio 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!!!!");
            }
        }
Esempio n. 17
0
        private void LoadData()
        {
            DataProcess data = new DataProcess();

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

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

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

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

            dgvCategory.DataSource = data.GetCategory();
        }