public int Insert(VaiTro entity, VaiTroChucNangPhanMem a) { db.VaiTroChucNangPhanMems.Add(a); db.VaiTroes.Add(entity); a.VaiTroID = entity.VaiTroID; db.SaveChanges(); return(entity.VaiTroID); }
public int Insert(HocVu entity, User a) { db.HocVus.Add(entity); entity.TinhTrang = false; entity.UserID = a.UserID; entity.NgayTao = DateTime.Now; db.SaveChanges(); return(entity.HocVuID); }
private void CreateCustomHeader(DoAnDbContext context) { if (context.CustomHeaders.Count() == 0) { List <CustomHeader> listCustomHeader = new List <CustomHeader> { new CustomHeader() { Type = "Header", Status = true, CreatedDate = DateTime.Now }, }; context.CustomHeaders.AddRange(listCustomHeader); context.SaveChanges(); } }
private void CreateCustomImage(DoAnDbContext context) { if (context.CustomImages.Count() == 0) { List <CustomImage> listCustomImage = new List <CustomImage> { new CustomImage() { Type = "Logo", Status = true, CreatedDate = DateTime.Now }, new CustomImage() { Type = "Background", Status = true, CreatedDate = DateTime.Now } }; context.CustomImages.AddRange(listCustomImage); context.SaveChanges(); } }
private void CreateControlPanel(DoAnDbContext context) { if (context.Controlpanels.Count() == 0) { List <ControlPanel> listControlPanel = new List <ControlPanel> { new ControlPanel() { Name = "Tổ chức", Status = false }, new ControlPanel() { Name = "Quyên góp", Status = true } }; context.Controlpanels.AddRange(listControlPanel); context.SaveChanges(); } }
public int Insert(Lop entity) { db.Lops.Add(entity); db.SaveChanges(); return(entity.LopID); }
public int Insert(HocVu entity) { db.HocVus.Add(entity); db.SaveChanges(); return(entity.HocVuID); }
public int Insert(User entity) { db.Users.Add(entity); db.SaveChanges(); return(entity.UserID); }
public int Insert(DanhMuc entity) { db.DanhMucs.Add(entity); db.SaveChanges(); return(entity.DanhMucID); }
public int Insert(VaiTroChucNangPhanMem entity) { db.VaiTroChucNangPhanMems.Add(entity); db.SaveChanges(); return(entity.VaiTroChucNangID); }
public int Insert(DonVi entity) { db.DonVis.Add(entity); db.SaveChanges(); return(entity.DonViID); }