Esempio n. 1
0
 private void btnCapNhat_Click_1(object sender, EventArgs e)
 {
     try
     {
         MemoryStream ms = new MemoryStream();
         ptbAnh.Image.Save(ms, ptbAnh.Image.RawFormat);
         byte[] b = ms.GetBuffer();
         ms.Close();
         Coffee.XuLyThucDon x = new Coffee.XuLyThucDon();
         x.CapNhatMon(txtMaMon.Text, txtTenMon.Text, cbLoai.Text, txtGia.Text, b, ref err);
         MessageBox.Show("Đã Cập Nhật Xong!!!");
     }
     catch
     {
         MessageBox.Show("Lỗi Rồi!!!");
     }
 }
Esempio n. 2
0
 private void btnThem_Click_1(object sender, EventArgs e)
 {
     try
     {
         if (img.Length > 1)
         {
             Coffee.XuLyThucDon x = new Coffee.XuLyThucDon();
             x.ThemMon(txtMaMon.Text, txtTenMon.Text, txtGia.Text, cbLoai.Text, bytes, ref err);
             MessageBox.Show("Đã Thêm Xong!!!");
         }
         else
         {
             MessageBox.Show("Thiếu Ảnh");
         }
     }
     catch
     {
         MessageBox.Show("Lỗi rồi !!!");
     }
 }