//--------------Hiển thị món ăn theo từng nhóm------------------------------- private void btn_Click(object sender, EventArgs e) { flplistMonAn.Controls.Clear(); string tenNhomMonAn = ((sender as Button).Tag as NhomMonAn_DTO).TenNhomMonAn; listMonAn = MonAn_DAO.LoadMonAn(); for (int i = 0; i < listMonAn.Count; i++) { string s = listMonAn[i].TenNhomMon; if (s == tenNhomMonAn) { Guna.UI.WinForms.GunaAdvenceTileButton gunaBtn = new Guna.UI.WinForms.GunaAdvenceTileButton() { Width = 116, Height = 154 }; gunaBtn.Image = listMonAn[i].IMAGE; gunaBtn.BaseColor = Color.LightGray; gunaBtn.ImageSize = new Size(107, 90); gunaBtn.Font = new System.Drawing.Font("Arial", 10, FontStyle.Bold); gunaBtn.Name = listMonAn[i].TenMonAn; gunaBtn.Text = listMonAn[i].TenMonAn + Environment.NewLine + listMonAn[i].Gia + " Đồng"; gunaBtn.DoubleClick += btn_DoubleClick; gunaBtn.Tag = listMonAn[i]; flplistMonAn.Controls.Add(gunaBtn); } } }
private void loadMonAn() { listMonAn = MonAn_DAO.LoadMonAn(); for (int i = 0; i < listMonAn.Count; i++) { Guna.UI.WinForms.GunaAdvenceTileButton gunaBtn = new Guna.UI.WinForms.GunaAdvenceTileButton() { Width = 116, Height = 154 }; gunaBtn.Image = listMonAn[i].IMAGE; gunaBtn.BaseColor = Color.LightGray; gunaBtn.ImageSize = new Size(107, 90); gunaBtn.Font = new Font("Arial", 10, FontStyle.Bold); gunaBtn.Text = listMonAn[i].TenMonAn + Environment.NewLine + listMonAn[i].Gia + " Đồng"; gunaBtn.DoubleClick += btn_DoubleClick; gunaBtn.Tag = listMonAn[i]; flplistMonAn.Controls.Add(gunaBtn); } }
public static int layIDMonAn(string tenMonAn) { return(MonAn_DAO.layIDMonAn(tenMonAn)); }
public static bool XoaMonAn(MonAn_DTO monAn) { return(MonAn_DAO.XoaMonAn(monAn)); }
public static bool SuaMonAn(MonAn_DTO monAn) { return(MonAn_DAO.SuaMonAn(monAn)); }
public static bool ThemMonAn(MonAn_DTO monAn) { return(MonAn_DAO.ThemMonAn(monAn)); }
public static List <MonAn_DTO> LoadMonAn() { return(MonAn_DAO.LoadMonAn()); }
private void dtgrvDanhSachMonAn_Click(object sender, EventArgs e) { try { drMonAn = dtgrvDanhSachMonAn.SelectedRows[0]; } catch (Exception) { return; } cbNhomMon.Text = drMonAn.Cells["TenNhomMon"].Value.ToString(); txtTenMonAn.Text = drMonAn.Cells["TenMonAn"].Value.ToString(); txtDonViTinh.Text = drMonAn.Cells["DonViTinh"].Value.ToString(); txtDonGia.Text = drMonAn.Cells["Gia"].Value.ToString(); pictureBox1.Image = DataProvider.LoadImage(DataProvider.OpenConnection(), $"select Image from MonAn where ID='{MonAn_DAO.layIDMonAn(txtTenMonAn.Text)}'"); }
//public static DataTable DocMonAn_Commit() //{ // return MonAn_DAO.DocMonAn_Commit(); //} public static int ThemMonAn(int mode, MonAn_DTO monAn, string maNH) { return(MonAn_DAO.ThemMonAn(mode, monAn, maNH)); }
public static DataTable TimTheoLoai(int mode, string maLoai, string MaNH, ref int sl) { return(MonAn_DAO.TimTheoLoai(mode, maLoai, MaNH, ref sl)); }
public static DataTable SelectMonAnTheoLoai(String maloai, String manh) { MonAn_DAO dao = new MonAn_DAO(); return(dao.SelectMonAnTheoLoai(maloai, manh)); }
/////////////-------------------------------------------------- //public static int CapNhatMonAn_Commmit(MonAn_DTO MonAn, int maMonAn) //{ // return MonAn_DAO.CapNhatMonAn_Commit(MonAn, maMonAn); //} //----------------------------------------------------------------- public static int XoaMonAn(int mode, int maMonAn) { return(MonAn_DAO.XoaMonAn(mode, maMonAn)); }
public static int CapNhatMonAn(int mode, MonAn_DTO MonAn, int maMonAn, string maNH) { return(MonAn_DAO.CapNhatMonAn(mode, MonAn, maMonAn)); }
public static DataTable LayNhaHang() { return(MonAn_DAO.LayNhaHang()); }
public static DataTable LayLoaiMon() { return(MonAn_DAO.LayLoaiMon()); }
public static List <MonAn_DTO> TimMonAn(string tenMonAn) { return(MonAn_DAO.TimMonAn(tenMonAn)); }
public static List <MonAn_DTO> LocMonAnTheoNhom(string tenNhomMon) { return(MonAn_DAO.LocNhomMonAn(tenNhomMon)); }
public static DataTable DocMonAn(int mode, string maNH) { return(MonAn_DAO.DocMonAn(mode, maNH)); }