public frmQuanLyLoaiNguyenLieu()
 {
     InitializeComponent();
     txtMaLoaiNguyenLieu.Text = CServices.taoMa <LoaiNguyenLieu>(CLoaiNguyenLieu_BUS.toListAll());
     loaiNguyenLieuSeclect    = new LoaiNguyenLieu();
     hienThiDSLoaiNhanVien(CLoaiNguyenLieu_BUS.toList());
     isEnabledThongTin(false);
 }
        private void btnSua_Click(object sender, RoutedEventArgs e)
        {
            LoaiNguyenLieu loaiNguyenLieu = new LoaiNguyenLieu();

            loaiNguyenLieu.maLoaiNguyenLieu  = txtMaLoaiNguyenLieu.Text;
            loaiNguyenLieu.tenLoaiNguyenLieu = txtTenLoai.Text;
            loaiNguyenLieu.trangThai         = 0;

            if (CLoaiNguyenLieu_BUS.edit(loaiNguyenLieu))
            {
                MessageBox.Show("Sửa thành công");
                hienThiDSLoaiNhanVien(CLoaiNguyenLieu_BUS.toList());
                txtMaLoaiNguyenLieu.Text = CServices.taoMa <LoaiNguyenLieu>(CLoaiNguyenLieu_BUS.toListAll());
                txtTenLoai.Text          = "";
            }
        }
 private void btnXoa_Click(object sender, RoutedEventArgs e)
 {
     if (loaiNguyenLieuSeclect != null)
     {
         if (CLoaiNguyenLieu_BUS.remove(loaiNguyenLieuSeclect))
         {
             MessageBox.Show("Xóa thành công");
             hienThiDSLoaiNhanVien(CLoaiNguyenLieu_BUS.toList());
             txtMaLoaiNguyenLieu.Text = CServices.taoMa <LoaiNguyenLieu>(CLoaiNguyenLieu_BUS.toListAll());
             txtTenLoai.Text          = "";
         }
     }
     else
     {
         MessageBox.Show("Vui lòng chọn nguyên liệu cần xóa");
     }
 }