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