public void DeleteChucVu(int maChucVu) { try { ChucVu cv = context.ChucVus.Where(x => x.MaChucVu == maChucVu).Single <ChucVu>(); context.ChucVus.Remove(cv); context.SaveChanges(); } catch (Exception e) { throw e; } }
public void DeleteTheTu(int maTheTu) { try { TheTu theTu = context.TheTus.Where(x => x.MaTheTu == maTheTu).Single <TheTu>(); context.TheTus.Remove(theTu); context.SaveChanges(); } catch (Exception e) { throw e; } }
public void DeleteTrinhDoHocVan(int maTrinhDoHocVan) { try { TrinhDoHocVan trinhDoHocVan = context.TrinhDoHocVans.Where(x => x.MaTrinhDoHocVan == maTrinhDoHocVan).Single <TrinhDoHocVan>(); context.TrinhDoHocVans.Remove(trinhDoHocVan); context.SaveChanges(); } catch (Exception e) { throw e; } }
public void DeleteTonGiao(int maTonGiao) { try { TonGiao tonGiao = context.TonGiaos.Where(x => x.MaTonGiao == maTonGiao).Single <TonGiao>(); context.TonGiaos.Remove(tonGiao); context.SaveChanges(); } catch (Exception e) { throw e; } }
public void DeleteTheTu(int maTheTu) { try { VanTay vanTay = context.VanTays.Where(x => x.MaVanTay == maTheTu).Single <VanTay>(); context.VanTays.Remove(vanTay); context.SaveChanges(); } catch (Exception e) { MessageBox.Show(e.Message); } }
public void DeleteKhuonMat(int maKhuonMat) { try { KhuonMat khuonMat = context.KhuonMats.Where(x => x.MaKhuonMat == maKhuonMat).Single <KhuonMat>(); context.KhuonMats.Remove(khuonMat); context.SaveChanges(); } catch (Exception e) { throw e; } }
public int AddQuocTich(QuocTich quocTich) { try { context.QuocTiches.Add(quocTich); context.SaveChanges(); int maQuocTich = quocTich.MaQuocTich; return(maQuocTich); } catch (Exception e) { throw e; } }
public int AddDanToc(DanToc danToc) { try { context.DanTocs.Add(danToc); context.SaveChanges(); int maDanToc = danToc.MaDanToc; return(maDanToc); } catch (Exception e) { throw e; } }
public int AddNguoi(Nguoi nguoi) { try { context.Nguois.Add(nguoi); context.SaveChanges(); int maNguoi = nguoi.MaNguoi; return(maNguoi); } catch (Exception e) { throw e; } }
public int AddNgayNghiLe(NgayNghiLe ngayNghiLe) { int maNgayNghiLe = 0; try { context.NgayNghiLes.Add(ngayNghiLe); context.SaveChanges(); maNgayNghiLe = ngayNghiLe.MaNgayNghiLe; } catch (Exception e) { MessageBox.Show(e.Message); } return(maNgayNghiLe); }
public int AddPhongBan(PhongBan phongBan) { int maPhongBan = -1; try { context.PhongBans.Add(phongBan); context.SaveChanges(); maPhongBan = phongBan.MaPhongBan; } catch (Exception e) { MessageBox.Show(e.Message); } return(maPhongBan); }