Ejemplo n.º 1
0
 public pl_windowThemLoaiNhaCungCap()
 {
     try
     {
         InitializeComponent();
         this.bus_LoaiNCC = new bus_LoaiNhaCungCap();
         this.vo_loaiNCC  = new vo_LoaiNhaCungCap();
         this.DataContext = vo_loaiNCC;
         // tao ma loai nha cung cap
         this.vo_loaiNCC.Id = bus_LoaiNCC.GetLastesIDLoaiNCC() + 1;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Loi!", MessageBoxButton.OK, MessageBoxImage.Information);
     }
 }
 //tao ma loai hang hoa
 private void createMaLoaiHH()
 {
     try
     {
         if (this.bl_LoaiNCC != null)
         {
             DataRow dr = this.dataSource.NewRow();
             int     i  = bl_LoaiNCC.GetLastesIDLoaiNCC();
             dr[0] = i + 1;
             this.dataSource.Rows.Add(dr);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Loi!", MessageBoxButton.OK, MessageBoxImage.Information);
     }
 }