public int Post()
 {
     try
     {
         var tinhThanhs = Get();
         _giaoDucContext.TinhThanhs.AddRange(tinhThanhs);
         _giaoDucContext.SaveChanges();
         return(1);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #2
0
 public int Post()
 {
     try
     {
         var quanHuyens = Get();
         _giaoDucContext.QuanHuyens.AddRange(quanHuyens);
         _giaoDucContext.SaveChanges();
         return(1);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #3
0
 public int Post()
 {
     try
     {
         var donVis = Get();
         _giaoDucContext.DonVis.AddRange(donVis);
         _giaoDucContext.SaveChanges();
         return(1);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #4
0
        public int Post()
        {
            try
            {
                var maQuanHuyens = _giaoDucContext.QuanHuyens.Select(x => x.maQuanHuyen).ToList();

                foreach (var maQuanHuyen in maQuanHuyens)
                {
                    var truongHocs = Get(maQuanHuyen);
                    _giaoDucContext.TruongHocs.AddRange(truongHocs);
                    _giaoDucContext.SaveChanges();
                }

                return(1);
            }
            catch (Exception)
            {
                throw;
            }
        }
        public int Post()
        {
            try
            {
                var maTruongHocs = _giaoDucContext.TruongHocs.Select(x => x.maTruongHoc).ToList();

                foreach (var maTruongHoc in maTruongHocs)
                {
                    var lopHoc2019s = Get(maTruongHoc, 2019).Select(i => { i.namHoc = 2019; return(i); });
                    var lopHoc2020s = Get(maTruongHoc, 2020).Select(i => { i.namHoc = 2020; return(i); });

                    _giaoDucContext.LopHocs.AddRange(lopHoc2019s);
                    _giaoDucContext.LopHocs.AddRange(lopHoc2020s);
                    _giaoDucContext.SaveChanges();
                }


                return(1);
            }
            catch (Exception)
            {
                throw;
            }
        }