Ejemplo n.º 1
0
 public static void update(DanhMucKho obj)
 {
     using(var model=ModelConnector.Connector())
     {
         model.Entry(obj).State = System.Data.Entity.EntityState.Modified;
         model.SaveChanges();
     }
 }
Ejemplo n.º 2
0
 public static void insert(DanhMucKho obj)
 {
     using(var model= ModelConnector.Connector())
     {
         model.DanhMucKhoes.Add(obj);
         model.SaveChanges();
     }
 }
Ejemplo n.º 3
0
 void add_kho()
 {
     if (check_detail_kho() == false)
         return;
     objDanhMucKho = new DanhMucKho();
     objDanhMucKho.TenKho = txtTenKho.Text;
     objDanhMucKho.DiaChi = txtDiaChi.Text;
     ADanhMucKho.insert(objDanhMucKho);
     commons.ShowAlert("Đã lưu", 1);
     refesh_kho();
     load_DanhMucKho();
 }
Ejemplo n.º 4
0
 void refesh_kho()
 {
     txtTenKho.Text = "";
     txtDiaChi.Text = "";
     objDanhMucKho = null;
 }
Ejemplo n.º 5
0
 private void gridViewKho_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
 {
     if (gridViewKho.RowCount == 0 || gridViewKho.FocusedRowHandle < 0)
         return;
     objDanhMucKho = new DanhMucKho();
     objDanhMucKho = (DanhMucKho)gridViewKho.GetFocusedRow();
     txtTenKho.Text = objDanhMucKho.TenKho;
     txtDiaChi.Text = objDanhMucKho.DiaChi;
 }