Пример #1
0
        //--------------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);
                }
            }
        }
Пример #2
0
 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);
     }
 }
Пример #3
0
 public static int layIDMonAn(string tenMonAn)
 {
     return(MonAn_DAO.layIDMonAn(tenMonAn));
 }
Пример #4
0
 public static bool XoaMonAn(MonAn_DTO monAn)
 {
     return(MonAn_DAO.XoaMonAn(monAn));
 }
Пример #5
0
 public static bool SuaMonAn(MonAn_DTO monAn)
 {
     return(MonAn_DAO.SuaMonAn(monAn));
 }
Пример #6
0
 public static bool ThemMonAn(MonAn_DTO monAn)
 {
     return(MonAn_DAO.ThemMonAn(monAn));
 }
Пример #7
0
 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)}'");
        }
Пример #9
0
        //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));
        }
Пример #10
0
 public static DataTable TimTheoLoai(int mode, string maLoai, string MaNH, ref int sl)
 {
     return(MonAn_DAO.TimTheoLoai(mode, maLoai, MaNH, ref sl));
 }
Пример #11
0
        public static DataTable SelectMonAnTheoLoai(String maloai, String manh)
        {
            MonAn_DAO dao = new MonAn_DAO();

            return(dao.SelectMonAnTheoLoai(maloai, manh));
        }
Пример #12
0
 /////////////--------------------------------------------------
 //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));
 }
Пример #13
0
 public static int CapNhatMonAn(int mode, MonAn_DTO MonAn, int maMonAn, string maNH)
 {
     return(MonAn_DAO.CapNhatMonAn(mode, MonAn, maMonAn));
 }
Пример #14
0
 public static DataTable LayNhaHang()
 {
     return(MonAn_DAO.LayNhaHang());
 }
Пример #15
0
 public static DataTable LayLoaiMon()
 {
     return(MonAn_DAO.LayLoaiMon());
 }
Пример #16
0
 public static List <MonAn_DTO> TimMonAn(string tenMonAn)
 {
     return(MonAn_DAO.TimMonAn(tenMonAn));
 }
Пример #17
0
 public static List <MonAn_DTO> LocMonAnTheoNhom(string tenNhomMon)
 {
     return(MonAn_DAO.LocNhomMonAn(tenNhomMon));
 }
Пример #18
0
 public static DataTable DocMonAn(int mode, string maNH)
 {
     return(MonAn_DAO.DocMonAn(mode, maNH));
 }