private void DieuChinhTonKho_Load(object sender, EventArgs e) { KhoHang.Model.LoadKhoHang load = new Model.LoadKhoHang(); DataTable dt = load.LoadNguyenLieuTheoMaNguyenLieu(ID); lblName.Text = dt.Rows[0][1].ToString(); txtSoLuongTon.Text = dt.Rows[0][2].ToString(); }
public void LoadDonVi() { KhoHang.Model.LoadKhoHang load = new Model.LoadKhoHang(); DataTable dt = load.LoadDonVi(); cbDonVi.DataSource = dt; cbDonVi.DisplayMembers = "TenDonVi"; cbDonVi.ValueMember = "MaDonVi"; }
public void LoadKhoHang() { KhoHang.Model.LoadKhoHang load = new Model.LoadKhoHang(); DataTable dt = load.LoadToanBoNguyenLieu(); dgvViewKhoHang.DataSource = dt; dgvViewKhoHang.Columns[0].Visible = false; dgvViewKhoHang.Columns[4].Visible = false; dtKho = dt; }
private void SuaNhomDanhMucNguyenLieu_Load(object sender, EventArgs e) { KhoHang.Model.LoadKhoHang kho = new Model.LoadKhoHang(); DataTable dt = kho.LoadNhomDanhMucTheoMaNhomDanhMuc(Nhom); textBoxX1.Text = dt.Rows[0][1].ToString(); }
private void dgvViewKhoHang_CellClick(object sender, DataGridViewCellEventArgs e) { try { int MaNguyenLieu = Convert.ToInt32(dgvViewKhoHang.SelectedRows[0].Cells[0].Value.ToString()); lblID.Text = MaNguyenLieu.ToString(); KhoHang.Model.LoadKhoHang load = new Model.LoadKhoHang(); DataTable dt = load.LoadNguyenLieuTheoMaNguyenLieu(MaNguyenLieu); lblName.Text = dt.Rows[0][1].ToString(); txtGia.Text = dt.Rows[0][4].ToString(); txtSoLuong.Text = "1"; checkso(txtGia); TachSo(txtGia); float tien = a * float.Parse(txtSoLuong.Text); txtTien.Text = tien.ToString(); lblDonVi.Text = dt.Rows[0][3].ToString(); } catch (Exception) { } }
public void LoadDataGridViewKhoNguyenLieu() { string s = ""; try { s = advTreeKhoHang.SelectedNode.Name; int MaDanhMuc = Convert.ToInt32(s); MaDanhMucThucDon = MaDanhMuc; KhoHang.Model.LoadKhoHang kho = new KhoHang.Model.LoadKhoHang(); DataTable dt = kho.LoadNguyenLieuTheoDanhMuc(MaDanhMuc); loadDataKho(dt); toolStripMenuItemThemDanhMucNguyenLieu.Enabled = false; toolStripMenuItemSuaTenDanhMucNguyenLieu.Enabled = true; toolStripMenuItemXoaDanhMucNguyenLieu.Enabled = true; toolStripMenuItemThemNguyenLieu.Enabled = true; } catch (Exception) { try { int NhomDanhMuc = Convert.ToInt32(s.Substring(1)); KhoHang.Model.LoadKhoHang kho = new KhoHang.Model.LoadKhoHang(); DataTable dt = kho.LoadNguyenLieuTheoNhomDanhMuc(NhomDanhMuc); loadDataKho(dt); toolStripMenuItemThemNguyenLieu.Enabled = false; toolStripMenuItemThemDanhMucNguyenLieu.Enabled = true; toolStripMenuItemSuaTenDanhMucNguyenLieu.Enabled = true; toolStripMenuItemXoaDanhMucNguyenLieu.Enabled = true; } catch { KhoHang.Model.LoadKhoHang kho = new KhoHang.Model.LoadKhoHang(); DataTable dt = kho.LoadToanBoNguyenLieu(); loadDataKho(dt); toolStripMenuItemThemDanhMucNguyenLieu.Enabled = false; toolStripMenuItemSuaTenDanhMucNguyenLieu.Enabled = false; toolStripMenuItemXoaDanhMucNguyenLieu.Enabled = false; toolStripMenuItemThemNguyenLieu.Enabled = false; } } }
private void LoadTreeViewKhoHang() { advTreeKhoHang.Nodes.Clear(); DevComponents.AdvTree.Node node2 = new DevComponents.AdvTree.Node(); node2.Text = "Tất cả"; DevComponents.AdvTree.Node node3 = new DevComponents.AdvTree.Node(); node3.Text = "Tất cả kho hàng"; node2.Nodes.AddRange(new DevComponents.AdvTree.Node[] { node3 }); node3.Image = global::VietRestaurant2._0.Properties.Resources._001_43; advTreeKhoHang.Nodes.AddRange(new DevComponents.AdvTree.Node[] { node2 }); KhoHang.Model.LoadKhoHang kho = new KhoHang.Model.LoadKhoHang(); DataTable dtNhom = kho.LoadNhomDanhMucNguyenLieu(); int a = dtNhom.Rows.Count; for (int i = 0; i < a; i++) { DevComponents.AdvTree.Node node = new DevComponents.AdvTree.Node(); node.Text = dtNhom.Rows[i]["TenDanhMuc"].ToString(); node.Name = "a" + dtNhom.Rows[i]["MaDanhMuc"].ToString(); DataTable dt = kho.LoadDanhMucTheoNhomNguyenLieu(Convert.ToInt32(dtNhom.Rows[i]["MaDanhMuc"].ToString())); int b = dt.Rows.Count; for (int j = 0; j < b; j++) { DevComponents.AdvTree.Node node1 = new DevComponents.AdvTree.Node(); node1.Text = dt.Rows[j]["TenDanhMuc"].ToString(); node1.Name = dt.Rows[j]["MaDanhMuc"].ToString(); node1.Image = global::VietRestaurant2._0.Properties.Resources._001_43; node.Nodes.AddRange(new DevComponents.AdvTree.Node[] { node1 }); } advTreeKhoHang.Nodes.AddRange(new DevComponents.AdvTree.Node[] { node }); } advTreeKhoHang.ExpandAll(); }
private void checkBoxXThucDon_CheckedChanged(object sender, EventArgs e) { if (checkBoxXThucDon.Checked == true) { panelEx1.Visible = true; KhoHang.Model.LoadKhoHang load = new KhoHang.Model.LoadKhoHang(); DataTable dt = load.LoadDanhMucNhomDanhMucNguyenLieu(); cbDanhMucNguyenLieu.DataSource = dt; cbDanhMucNguyenLieu.ValueMember = "ID"; } else { panelEx1.Visible = false; } }
private void Sửa_Nguyên_Liệu_Load(object sender, EventArgs e) { KhoHang.Model.LoadKhoHang load = new Model.LoadKhoHang(); DataTable dt = load.LoadNguyenLieuTheoMaNguyenLieu(MaNguyenLieu); txtNguyenLieu.Text = dt.Rows[0]["TenNguyenLieu"].ToString(); txtGia.Text = dt.Rows[0]["Gia"].ToString(); cbDonVi.DataSource= load.LoadDonVi(); cbDonVi.ValueMember = "TenDonVi"; cbDonVi.DisplayMembers = "TenDonVi"; cbDonVi.SelectedValue = dt.Rows[0]["DonVi"].ToString(); cbDanhMucNguyenLieu.DataSource = load.LoadDanhMucNguyenLieu(); cbDanhMucNguyenLieu.ValueMember = "MaDanhMuc"; cbDanhMucNguyenLieu.DisplayMembers = "TenDanhMuc"; cbDanhMucNguyenLieu.SelectedValue = dt.Rows[0]["MaDanhMucNguyenLieu"]; }