private void buttonX1_Click(object sender, EventArgs e)
 {
     if (textBoxX1.Text != "")
     {
         KhoHang.Model.InsertKho kho = new Model.InsertKho();
         kho.InsertNhomDanhMuc(textBoxX1.Text);
     }
     else
     {
         MessageBox.Show("Bạn chưa điền");
     }
 }
 private void buttonX1_Click(object sender, EventArgs e)
 {
     if (textBoxX1.Text != "")
     {
         KhoHang.Model.InsertKho kho = new Model.InsertKho();
         kho.InsertDanhMucNguyenLieu(textBoxX1.Text,nhom);
         this.Close();
     }
     else
     {
         MessageBox.Show("Bạn chưa điền");
     }
 }
        private void btnOk_Click(object sender, EventArgs e)
        {
            if(txtName.Text!=""&& txtGia.Text!="")
            {
             if (!checkBoxX1.Checked)
            {
                 TachSo(txtGia);
                KhoHang.Model.InsertKho kho = new Model.InsertKho();
                kho.InsertNguyenLieu(txtName.Text, cbDonVi.Text, a,MaDanhMuc);
                this.Close();
            }
            else
            {
                if (txtGiaThucDon.Text != "")
                {
                    TachSo(txtGia);
                    KhoHang.Model.InsertKho kho = new Model.InsertKho();
                    kho.InsertNguyenLieu(txtName.Text, cbDonVi.Text, a, MaDanhMuc);
                    ThucDon.InsertThucDon thucdon = new ThucDon.InsertThucDon();
                    TachSo(txtGiaThucDon);
                    int MaDanhMucThucDon = Convert.ToInt32(cbDanhMucThucDon.SelectedValue.ToString());
                    string Anh = "";
                    thucdon.InsertMonAn(txtName.Text, cbDonVi.Text, a,Anh,MaDanhMucThucDon);
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Bạn điền giá của sản phẩm");
                }

            }
            }else
            {
                MessageBox.Show("Bạn điền đầy đủ thông tin");
            }
        }
 private void btnLuu_Click(object sender, EventArgs e)
 {
     if (dtTam.Rows.Count > 0)
     {
         checkso(txtTongTien);
         float TongTien = a;
         KhoHang.Model.InsertKho insert = new Model.InsertKho();
         insert.InserVaoKho(dtTam, a, txtGhiChu.Text);
         this.Close();
     }
     else
     {
         MessageBox.Show("Chưa có dữ liệu");
     }
 }
Beispiel #5
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            try
            {
                ThucDon.InsertThucDon thucdon = new ThucDon.InsertThucDon();
                if(txtThucDon.Text!=""&& txtGiaBan.Text!="")
                {
                string TenMonAn = txtThucDon.Text;
                string DonVi = comboTreeDonVi.Text;
                checkso(txtGiaBan);
                float Gia = a;
                string Anh = path;
                int MaDanhMucThucDon = Convert.ToInt32(comboTreeDanhMuc.SelectedValue.ToString());
                if (checkBoxXThucDon.Checked)
                {
                    checkso(txtGiaNguyenLieu);
                   float GiaNguyenLieu = a;
                    int MaDanhMucNguyenLieu = Convert.ToInt32(cbDanhMucNguyenLieu.SelectedValue.ToString());
                  KhoHang.Model.InsertKho insert = new KhoHang.Model.InsertKho();
                    thucdon.InsertMonAn(TenMonAn, DonVi, Gia, Anh, MaDanhMucThucDon);
                   insert.InsertNguyenLieu(TenMonAn, DonVi, Gia, MaDanhMucNguyenLieu);

                }
                else
                {
                    thucdon.InsertMonAn(TenMonAn, DonVi, Gia, Anh, MaDanhMucThucDon);
                }

                this.Close();
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }