public static bool Delete(NhapHang data) { try { if (data != null) { NhapHang objDb = GetById(data.Id); if (objDb != null) { objDb.DeleteFlag = true; dbContext.SubmitChanges(); return true; } } } catch { } CreateSQlConnection(); return false; }
public UcInfo(DTO.NhapHang data) { InitializeComponent(); dataNhapHang = data; if (Init()) { RefreshData(); AddToBill(data.Id); tbMa.Text = data.Id.ToString(); tbGhiChu.Text = data.GhiChu; dtpFilter.Value = data.Date; lbNgayGio.Text = dtpFilter.Value.ToString(Constant.DEFAULT_DATE_TIME_FORMAT); } else { this.Visible = false; } }
public static bool Update(NhapHang data) { return NhapHangDao.Update(data); }
public static bool Insert(NhapHang data) { return NhapHangDao.Insert(data); }
public static bool Delete(NhapHang data) { return NhapHangDao.Delete(data); }
partial void DeleteNhapHang(NhapHang instance);
partial void UpdateNhapHang(NhapHang instance);
partial void InsertNhapHang(NhapHang instance);
private void detach_NhapHangs(NhapHang entity) { this.SendPropertyChanging(); entity.User = null; }
private void attach_NhapHangs(NhapHang entity) { this.SendPropertyChanging(); entity.User = this; }
private void detach_NhapHangs(NhapHang entity) { this.SendPropertyChanging(); entity.NguonCungCap = null; }
private bool InsertDataNhapHang() { DTO.NhapHang data = new DTO.NhapHang(); data.Date = dtpFilter.Value; data.IdUser = FormMain.user.Id; data.GhiChu = tbGhiChu.Text; if (NhapHangBus.Insert(data)) { return InsertDataNhapHangChiTiet(data); } else { return false; } }
public static bool Update(NhapHang data) { try { if (data != null) { dbContext.SubmitChanges(); return true; } return false; } catch { return false; } }
public static bool Insert(NhapHang data) { try { dbContext.NhapHangs.InsertOnSubmit(data); dbContext.SubmitChanges(); return true; } catch { return false; } }