Exemple #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);
     }
 }
Exemple #2
0
 public KhoaHocKiThuat GetKhoaHocKiThuatById(int id)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         KhoaHocKiThuat khoaHocKiThuat = _db.KhoaHocKiThuats.Where(s => s.Id == id).SingleOrDefault();
         return(khoaHocKiThuat);
     }
 }
Exemple #3
0
 public List <Province> GetProvinces()
 {
     using (HoatDongTraiNghiemDB _db = new HoatDongTraiNghiemDB())
     {
         var provinces = _db.Provinces.Where(s => s.CountryId == 237).OrderBy(s => s.Name).ToList();
         return(provinces);
     }
 }
 public List <KHKTLinhVucThamGia> GetKHKTLinhVucThamGias()
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         List <KHKTLinhVucThamGia> kHKTLinhVucThamGias = _db.KHKTLinhVucThamGias.Where(s => s.IsActive == true).ToList();
         return(kHKTLinhVucThamGias);
     }
 }
 public Registration GetRegistrationsById(int id)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         var social = _db.Registrations.Include("Jobtitle").Include("Province").Where(s => s.Id == id).SingleOrDefault();
         return(social);
     }
 }
 public List <Registration> GetRegistrations(DateTime dateFrom, DateTime dateTo)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         var list = _db.Registrations.Include("Jobtitle").Include("Province").Where(s => s.DateRegisted >= dateFrom && s.DateRegisted <= dateTo && s.SchoolId != null).OrderBy(s => s.DateRegisted).ToList();
         return(list);
     }
 }
Exemple #7
0
 public T_DM_Truong GetTruongBySchoolId(string schoolId)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         var school = _db.Database.SqlQuery <T_DM_Truong>($"SELECT * FROM [Server_VS].[CSDL].[dbo].[T_DM_Truong] WHERE [SchoolID] = '${schoolId}'").SingleOrDefault();
         return(school);
     }
 }
Exemple #8
0
 public List <HoatDongNgoaiKhoa> GetHoatDongNgoaiKhoasBySchoolId(string schoolId)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         var list = _db.HoatDongNgoaiKhoas.Include("JobTitle").Include("Province").Where(s => s.SchoolId == schoolId).OrderBy(s => s.DateRegisted).ToList();
         return(list);
     }
 }
 public List <SubjectsRegisted> GetSubjectsRegistedsByRegistrationId(int id)
 {
     using (HoatDongTraiNghiemDB _db = new HoatDongTraiNghiemDB())
     {
         var subjectsRegisteds = _db.SubjectsRegisteds.Include("Subject").Where(s => s.RegistrationId == id).ToList();
         return(subjectsRegisteds);
     }
 }
 public IQueryable <SessionADay> GetSessionADays()
 {
     using (HoatDongTraiNghiemDB _db = new HoatDongTraiNghiemDB())
     {
         var sessionADays = _db.SessionADays;
         return(sessionADays);
     }
 }
Exemple #11
0
 public SocialLifeSkill GetSocialLifeSkillsById(int id)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         var social = _db.SocialLifeSkills.Include("Jobtitle").Where(s => s.Id == id).SingleOrDefault();
         return(social);
     }
 }
 public List <Jobtitle> GetJobtitles()
 {
     using (HoatDongTraiNghiemDB _db = new HoatDongTraiNghiemDB())
     {
         var jobtitles = _db.Jobtitles.Where(s => s.IsActive == true).ToList();
         return(jobtitles);
     }
 }
Exemple #13
0
 public List <Subject> GetSubjects()
 {
     using (HoatDongTraiNghiemDB _db = new HoatDongTraiNghiemDB())
     {
         var subjects = _db.Subjects.Where(s => s.IsActive == true).ToList();
         return(subjects);
     }
 }
Exemple #14
0
 public List <SocialLifeSkill> GetSocialLifeSkills(DateTime dateFrom, DateTime dateTo)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         var list = _db.SocialLifeSkills.Include("Jobtitle").Where(s => s.DateFrom >= dateFrom && s.DateFrom <= dateTo && s.SchoolId != null).OrderBy(s => s.DateFrom).ToList();
         return(list);
     }
 }
Exemple #15
0
 public List <Program> GetPrograms()
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         var programs = _db.Programs.AsNoTracking().Where(s => s.IsActive == true).ToList();
         return(programs);
     }
 }
Exemple #16
0
 public List <SocialLifeSkill> GetSocialLifeSkillsBySchoolId(string schoolId)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         var list = _db.SocialLifeSkills.Include("Jobtitle").Where(s => s.SchoolId == schoolId).OrderBy(s => s.DateFrom).ToList();
         return(list);
     }
 }
Exemple #17
0
 public List <Program> GetProgramsAll()
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         var programs = _db.Programs.AsNoTracking().ToList();
         return(programs);
     }
 }
 public KHKTLinhVucThamGia GetHKTLinhVucThamGiaById(int id)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         KHKTLinhVucThamGia kHKTLinhVucThamGia = _db.KHKTLinhVucThamGias.Where(s => s.Id == id).SingleOrDefault();
         return(kHKTLinhVucThamGia);
     }
 }
Exemple #19
0
 public HoatDongNgoaiKhoa GetHoatDongNgoaiKhoaById(int id)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         HoatDongNgoaiKhoa hoatDongNgoaiKhoa = _db.HoatDongNgoaiKhoas.Include("JobTitle").Include("Province").Where(s => s.Id == id).SingleOrDefault();
         return(hoatDongNgoaiKhoa);
     }
 }
 public List <Registration> GetRegistrationsBySchoolId(string schoolId)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         var list = _db.Registrations.Include("Jobtitle").Include("Province").Where(s => s.SchoolId == schoolId).OrderBy(s => s.DateRegisted).ToList();
         return(list);
     }
 }
Exemple #21
0
 public List <HoatDongNgoaiKhoa> GetHoatDongNgoaiKhoasByRange(DateTime dateFrom, DateTime dateTo)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         var list = _db.HoatDongNgoaiKhoas.Include("JobTitle").Include("Province").Where(s => s.DateRegisted >= dateFrom && s.DateRegisted <= dateTo).Where(s => s.SchoolId != null).OrderBy(s => s.DateRegisted).ToList();
         return(list);
     }
 }
Exemple #22
0
 public List <KhoaHocKiThuat> GetKhoaHocKiThuatByDeTaiId(int id)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         List <KhoaHocKiThuat> khoaHocKiThuats = _db.KhoaHocKiThuats.Where(s => s.LinhVucId == id && s.CreatedAt.Value.Year == DateTime.Now.Year).ToList();
         return(khoaHocKiThuats);
     }
 }
 public SubjectsRegisted CreateSubjectRegisted(SubjectsRegisted subjectsRegisted)
 {
     using (HoatDongTraiNghiemDB _db = new HoatDongTraiNghiemDB())
     {
         var subjectRegisted = _db.SubjectsRegisteds.Add(subjectsRegisted);
         _db.SaveChanges();
         return(subjectsRegisted);
     }
 }
Exemple #24
0
 public SocialLifeSkill UpdateSocialLifeSkills(SocialLifeSkill socialLifeSkill)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         _db.Entry(socialLifeSkill).State = EntityState.Modified;
         _db.SaveChanges();
         return(socialLifeSkill);
     }
 }
Exemple #25
0
 public SocialLifeSkill CreateSocialLifeSkills(SocialLifeSkill socialLifeSkill)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         _db.SocialLifeSkills.Add(socialLifeSkill);
         _db.SaveChanges();
         return(socialLifeSkill);
     }
 }
Exemple #26
0
 public List <Program> GetProgramsByAccountId(int accountId)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         var listProgramPermission = _db.ProgramPermissions.AsNoTracking().Where(s => s.AccountId == accountId && s.Program.IsActive == true).Select(s => s.ProgramId).ToList();
         var listProgarm           = _db.Programs.Where(s => listProgramPermission.Contains(s.Id)).ToList();
         return(listProgarm);
     }
 }
Exemple #27
0
 public HoatDongNgoaiKhoa UpdateHoatDongNgoaiKhoa(HoatDongNgoaiKhoa hoatDongNgoaiKhoa)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         _db.Entry(hoatDongNgoaiKhoa).State = EntityState.Modified;
         _db.SaveChanges();
         return(hoatDongNgoaiKhoa);
     }
 }
Exemple #28
0
 public HoatDongNgoaiKhoa CreateHoatDongNgoaiKhoa(HoatDongNgoaiKhoa hoatDongNgoaiKhoa)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         _db.HoatDongNgoaiKhoas.Add(hoatDongNgoaiKhoa);
         _db.SaveChanges();
         return(hoatDongNgoaiKhoa);
     }
 }
 public Registration UpdateRegistration(Registration registration)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         _db.Entry(registration).State = EntityState.Modified;
         _db.SaveChanges();
         return(registration);
     }
 }
 public RegistrationCreativeExp SaveRegistrationCreativeExp(RegistrationCreativeExp registrationCreativeExp)
 {
     using (var _db = new HoatDongTraiNghiemDB())
     {
         _db.RegistrationCreativeExps.Add(registrationCreativeExp);
         _db.SaveChanges();
         return(registrationCreativeExp);
     }
 }