示例#1
0
 public int Insert(VaiTro entity, VaiTroChucNangPhanMem a)
 {
     db.VaiTroChucNangPhanMems.Add(a);
     db.VaiTroes.Add(entity);
     a.VaiTroID = entity.VaiTroID;
     db.SaveChanges();
     return(entity.VaiTroID);
 }
示例#2
0
 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();
     }
 }
示例#6
0
 public int Insert(Lop entity)
 {
     db.Lops.Add(entity);
     db.SaveChanges();
     return(entity.LopID);
 }
示例#7
0
 public int Insert(HocVu entity)
 {
     db.HocVus.Add(entity);
     db.SaveChanges();
     return(entity.HocVuID);
 }
示例#8
0
 public int Insert(User entity)
 {
     db.Users.Add(entity);
     db.SaveChanges();
     return(entity.UserID);
 }
示例#9
0
 public int Insert(DanhMuc entity)
 {
     db.DanhMucs.Add(entity);
     db.SaveChanges();
     return(entity.DanhMucID);
 }
示例#10
0
 public int Insert(VaiTroChucNangPhanMem entity)
 {
     db.VaiTroChucNangPhanMems.Add(entity);
     db.SaveChanges();
     return(entity.VaiTroChucNangID);
 }
示例#11
0
 public int Insert(DonVi entity)
 {
     db.DonVis.Add(entity);
     db.SaveChanges();
     return(entity.DonViID);
 }