public void LoadForm() { gridMonAn.DataSource = MonAn_BUS.DocMonAn(mode, maNH); DataTable dt = MonAn_BUS.DocMonAn(mode, maNH); if (dt.Rows.Count > 0) { ArrayMaMon = new int[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; ArrayMaMon[i] = (int)dr[0]; } } cbbChiTietTK.Properties.Items.Clear(); DataTable dt1 = MonAn_BUS.LayLoaiMon(); if (dt1.Rows.Count > 0) { ArrayLoaiMon = new string[dt.Rows.Count]; for (int i = 0; i < dt1.Rows.Count; i++) { DataRow dr = dt1.Rows[i]; cbbChiTietTK.Properties.Items.Add(dr[1]); ArrayLoaiMon[i] = dr[0].ToString(); } } }
private void UCtrl_QLNhaHang_QLThucDon_Load(object sender, EventArgs e) { gridLoaiMonAn.DataSource = LoaiMonAn_BUS.DocLoaiMonAn(); gridMonAn.DataSource = MonAn_BUS.DocMonAn(mode, maNH); DataTable dt = MonAn_BUS.DocMonAn(mode, maNH); if (dt.Rows.Count > 0) { ArrayMaMon = new int[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; ArrayMaMon[i] = (int)dr[0]; } } DataTable dt1 = MonAn_BUS.LayLoaiMon(); if (dt1.Rows.Count > 0) { ArrayLoaiMon = new string[dt.Rows.Count]; for (int i = 0; i < dt1.Rows.Count; i++) { DataRow dr = dt1.Rows[i]; cbbChiTietTK.Properties.Items.Add(dr[1]); ArrayLoaiMon[i] = dr[0].ToString(); } } }
public void ThemMonAn() { Form_ThemMonAn openf = new Form_ThemMonAn(); openf.Mode = mode; if (openf.ShowDialog() == DialogResult.OK) { int flag = MonAn_BUS.ThemMonAn(mode, openf.MonAn, maNH); if (flag == 0) { DevExpress.XtraEditors.XtraMessageBox.Show("Thêm Món ăn không thành công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { DevExpress.XtraEditors.XtraMessageBox.Show("Thêm Món ăn thành công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } gridMonAn.DataSource = MonAn_BUS.DocMonAn(mode, maNH); } }
private void btnRefresh_Click(object sender, EventArgs e) { gridMonAn.DataSource = MonAn_BUS.DocMonAn(mode, maNH); LoadForm(); }