Exemple #1
0
 public static void XoaTre(List <string> listMaTre)
 {
     foreach (string maTre in listMaTre)
     {
         TreDAL.XoaTre(maTre);
     }
 }
Exemple #2
0
 public static bool KiemTraTreThoiHoc(string maTre, string maLop)
 {
     if (string.Compare(TreDAL.GetTinhTrangTrongLop(maTre, maLop).Trim(), "2") == 0)
     {
         return(true);
     }
     return(false);
 }
Exemple #3
0
        public static string GetHoTen(string maTre)
        {
            DataTable dt = TreDAL.GetHoTenTre(maTre);

            foreach (DataRow row in dt.Rows)
            {
                return(row["HoTenTre"].ToString());
            }

            return("");
        }
Exemple #4
0
 public static bool CapNhatThongTinTre(Tre tre)
 {
     try
     {
         TreDAL.CapNhatThongTinTre(tre);
     }
     catch (Exception ex)
     {
         return(false);
     }
     return(true);
 }
Exemple #5
0
        public static void ThemLopThamGia(string maDV, string maLop)
        {
            DichVuSucKhoeDAL.ThemLopThamGia(maDV, maLop);

            //Them ket qua suc khoe mac dinh cho lop nay
            DataTable listTre = TreDAL.GetListTreTheoLop(maLop);

            foreach (DataRow row in listTre.Rows)
            {
                DichVuSucKhoeDAL.ThemThongTinSucKhoe(maDV, row["MaTre"].ToString());
            }
        }
        public static void ThemLopThamGia(string maHD, string maLop)
        {
            HoatDongNgoaiKhoaDAL.ThemLopThamGia(maHD, maLop);

            //Them ket qua hoat dong mac dinh cho lop nay
            DataTable listTre = TreDAL.GetListTreTheoLop(maLop);

            foreach (DataRow row in listTre.Rows)
            {
                HoatDongNgoaiKhoaDAL.ThemKetQuaHoatDong(maHD, row["MaTre"].ToString());
            }
        }
        public static void XoaLopThamGia(string maHD, string maLop)
        {
            //Xoa ket qua mac dinh da tao cho lop nay
            DataTable listTre = TreDAL.GetListTreTheoLop(maLop);

            foreach (DataRow row in listTre.Rows)
            {
                HoatDongNgoaiKhoaDAL.XoaKetQuaHoatDong(maHD, row["MaTre"].ToString());
            }

            //Tien hanh xoa lop nay trong danh sach lop tham gia
            HoatDongNgoaiKhoaDAL.XoaLopThamGia(maHD, maLop);
        }
Exemple #8
0
        public static void XoaLopThamGia(string maDV, string maLop)
        {
            //Xoa ket qua mac dinh da tao cho lop nay
            DataTable listTre = TreDAL.GetListTreTheoLop(maLop);

            foreach (DataRow row in listTre.Rows)
            {
                DichVuSucKhoeDAL.XoaThongTinSucKhoe(maDV, row["MaTre"].ToString());
            }

            //Tien hanh xoa lop nay trong danh sach lop tham gia
            DichVuSucKhoeDAL.XoaLopThamGia(maDV, maLop);
        }
Exemple #9
0
        public static string AutoMaLop()
        {
            string id = TreDAL.GetLastID().Trim();

            if (id == "")
            {
                return("MLOP000001");
            }
            int nextID = int.Parse(id.Remove(0, "MLOP".Length)) + 1;

            id = "00000" + nextID.ToString();
            id = id.Substring(id.Length - 6, 6);
            return("MLOP" + id);
        }
Exemple #10
0
        public static bool ThemTre(Tre hocsinhmoi)
        {
            DataTable dt = TreDAL.ThemTre(hocsinhmoi);

            foreach (DataRow row in dt.Rows)
            {
                if (row.ItemArray[0].ToString().Trim() == "0")
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #11
0
 public static bool XepLop(List <string> listMaTre, string maLop)
 {
     foreach (string maTre in listMaTre)
     {
         try
         {
             TreDAL.XepLop(maTre, maLop);
         }
         catch (Exception ex)
         {
             return(false);
         }
     }
     return(true);
 }
Exemple #12
0
        public static int GetSoNgayDiHocTrongThang(string maTre, int thang, int nam)
        {
            DataTable dt = TreDAL.LayTongSoNgayDiHocTrongThang(maTre, thang, nam);

            try
            {
                foreach (DataRow row in dt.Rows)
                {
                    return(int.Parse(row["SoNgayDiHoc"].ToString()));
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Đã xảy ra lỗi khi lấy tổng số ngày đi học trong tháng.");
            }

            return(0);
        }
Exemple #13
0
 public static bool ChuyenLop(string maTre, string maLopMoi, string maLopCu)
 {
     if (string.Compare(TreDAL.GetTinhTrangTrongLop(maTre, maLopCu).Trim(), "0") == 0)
     {
         try
         {
             TreDAL.ChuyenLop(maTre, maLopMoi);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
     else
     {
         return(false);
     }
     return(true);
 }
Exemple #14
0
 public static bool ThoiHoc(List <string> listMaTre, string maLop)
 {
     foreach (string maTre in listMaTre)
     {
         if (string.Compare(TreDAL.GetTinhTrangTrongLop(maTre, maLop).Trim(), "0") == 0)
         {
             try
             {
                 TreDAL.ThoiHoc(maTre, maLop);
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message);
             }
         }
         else
         {
             return(false);
         }
     }
     return(true);
 }
Exemple #15
0
 public static DataTable GetSucKhoeTheoThang(string maTre, int thang, int nam)
 {
     return(TreDAL.GetSucKhoeTheoThang(maTre, thang, nam));
 }
Exemple #16
0
 public static void ThemTreVaoLop(string maTre, string maLop)
 {
     TreDAL.ThemTreVaoLop(maTre, maLop);
 }
Exemple #17
0
 public static DataTable TreChuaCoLop(string namSinh)
 {
     return(TreDAL.TreChuaCoLop(namSinh));
 }
Exemple #18
0
 public static DataTable GetListTreTheoMaLop(string maLop)
 {
     return(TreDAL.GetListTreTheoMaLop(maLop));
 }
Exemple #19
0
 public static DataTable GetListTre(Lop lop = null, string keyWord = null, string gioiTinh = null)
 {
     return(TreDAL.GetListTre(lop, keyWord, gioiTinh));
 }
Exemple #20
0
 public static void XoaTre(string maTre)
 {
     TreDAL.XoaTre(maTre);
 }
Exemple #21
0
 public static DataTable TimKiemTre(string tuKhoa)
 {
     return(TreDAL.TimKiemTre(tuKhoa));
 }
Exemple #22
0
 public static DataTable LayThongTinTre(string maTre)
 {
     return(TreDAL.LayThongTinTre(maTre));
 }
Exemple #23
0
 public static void CapNhatThongTinTre(Tre tre)
 {
     TreDAL.CapNhatThongTinTre(tre);
 }
Exemple #24
0
 public static DataTable GetSucKhoe(string maTre, int nam)
 {
     return(TreDAL.GetSucKhoe(maTre, nam));
 }
Exemple #25
0
 public static List <Tre> GetList()
 {
     return(TreDAL.GetList());
 }
Exemple #26
0
 public static DataTable GetListTreChuaCoLop(int tuoiMin, int tuoiMax)
 {
     return(TreDAL.GetListTreChuaCoLop(tuoiMin, tuoiMax));
 }
Exemple #27
0
 public static Tre GetTre(string maTre)
 {
     return(TreDAL.GetTre(maTre));
 }
Exemple #28
0
 public static DataTable GetLopDaHoc(string maTre)
 {
     return(TreDAL.GetLopDaHoc(maTre));
 }