Пример #1
0
 public KhoaHocKiThuat CreateKhoaHocKiThuat(KhoaHocKithuatDTO khoaHocKithuatDTO)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         KhoaHocKiThuat khoaHocKiThuat = new KhoaHocKiThuat();
         khoaHocKiThuat.DongGopHs1    = khoaHocKithuatDTO.DongGopHs1;
         khoaHocKiThuat.DongGopHs2    = khoaHocKithuatDTO.DongGopHs2;
         khoaHocKiThuat.HocSinh1      = khoaHocKithuatDTO.HocSinh1;
         khoaHocKiThuat.HocSinh2      = khoaHocKithuatDTO.HocSinh2;
         khoaHocKiThuat.IsCaNhan      = khoaHocKithuatDTO.IsCaNhan;
         khoaHocKiThuat.LinhVucId     = khoaHocKithuatDTO.LinhVucId;
         khoaHocKiThuat.LopIdHocSinh1 = khoaHocKithuatDTO.LopIdHocSinh1;
         khoaHocKiThuat.LopIdhocSinh2 = khoaHocKithuatDTO.LopIdhocSinh2;
         khoaHocKiThuat.TenDeTai      = khoaHocKithuatDTO.TenDeTai;
         khoaHocKiThuat.SchoolId      = khoaHocKithuatDTO.SchoolId;
         khoaHocKiThuat.CreatedAt     = DateTime.Now;
         khoaHocKiThuat.GVHD          = khoaHocKithuatDTO.GVHD;
         khoaHocKiThuat.Email         = khoaHocKithuatDTO.Email;
         khoaHocKiThuat.SDT           = khoaHocKithuatDTO.SDT;
         khoaHocKiThuat.DVCongTac     = khoaHocKithuatDTO.DVCongTac;
         _db.KhoaHocKiThuats.Add(khoaHocKiThuat);
         _db.SaveChanges();
         return(khoaHocKiThuat);
     }
 }
Пример #2
0
 public SocialLifeSkill UpdateSocialLifeSkills(SocialLifeSkill socialLifeSkill)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         _db.Entry(socialLifeSkill).State = EntityState.Modified;
         _db.SaveChanges();
         return(socialLifeSkill);
     }
 }
Пример #3
0
 public SocialLifeSkill CreateSocialLifeSkills(SocialLifeSkill socialLifeSkill)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         _db.SocialLifeSkills.Add(socialLifeSkill);
         _db.SaveChanges();
         return(socialLifeSkill);
     }
 }
Пример #4
0
 public HoatDongNgoaiKhoa UpdateHoatDongNgoaiKhoa(HoatDongNgoaiKhoa hoatDongNgoaiKhoa)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         _db.Entry(hoatDongNgoaiKhoa).State = EntityState.Modified;
         _db.SaveChanges();
         return(hoatDongNgoaiKhoa);
     }
 }
Пример #5
0
 public HoatDongNgoaiKhoa CreateHoatDongNgoaiKhoa(HoatDongNgoaiKhoa hoatDongNgoaiKhoa)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         _db.HoatDongNgoaiKhoas.Add(hoatDongNgoaiKhoa);
         _db.SaveChanges();
         return(hoatDongNgoaiKhoa);
     }
 }
 public SubjectsRegisted CreateSubjectRegisted(SubjectsRegisted subjectsRegisted)
 {
     using (HoatDongTraiNghiemDB _db = new HoatDongTraiNghiemDB())
     {
         var subjectRegisted = _db.SubjectsRegisteds.Add(subjectsRegisted);
         _db.SaveChanges();
         return(subjectsRegisted);
     }
 }
 public RegistrationCreativeExp SaveRegistrationCreativeExp(RegistrationCreativeExp registrationCreativeExp)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         _db.RegistrationCreativeExps.Add(registrationCreativeExp);
         _db.SaveChanges();
         return(registrationCreativeExp);
     }
 }
 public Registration UpdateRegistration(Registration registration)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         _db.Entry(registration).State = EntityState.Modified;
         _db.SaveChanges();
         return(registration);
     }
 }
 public Registration CreateRegistration(Registration registration)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         _db.Registrations.Add(registration);
         _db.SaveChanges();
         return(registration);
     }
 }
Пример #10
0
 public KhoaHocKiThuat UpdateFileTaiLieuKhoaHocKiThuat(int id, string tenFile)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         KhoaHocKiThuat khoaHocKiThuat = _db.KhoaHocKiThuats.Where(s => s.Id == id).SingleOrDefault();
         khoaHocKiThuat.FileTaiLieu      = tenFile.Trim();
         _db.Entry(khoaHocKiThuat).State = EntityState.Modified;
         try
         {
             _db.SaveChanges();
         }
         catch (Exception)
         {
             return(null);
         }
         return(khoaHocKiThuat);
     }
 }
 public bool RemoveSunjectRegistedByRegistrationId(int id)
 {
     try
     {
         using (HoatDongTraiNghiemDB _db = new HoatDongTraiNghiemDB())
         {
             var subjectsRegisteds = _db.SubjectsRegisteds.Where(s => s.RegistrationId == id).ToList();
             foreach (var item in subjectsRegisteds)
             {
                 _db.SubjectsRegisteds.Remove(item);
                 _db.SaveChanges();
             }
         }
     }
     catch (Exception)
     {
         return(false);
     }
     return(true);
 }