public static bool CapNhatLopThamGia(Dictionary <string, bool> listLop, string maDV) { DichVuSucKhoe dichVu = DichVuSucKhoeDAL.GetDichVu(maDV); if (DateTime.Today > dichVu.NgayKham) { MessageBox.Show("Dịch vụ sức khỏe này đã diễn ra, không được thay đổi thông tin", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } else { foreach (string key in listLop.Keys) { if (listLop[key]) { if (!DichVuSucKhoeDAL.CheckExistsLopThamGia(maDV, key)) { //lop nay chua tham gia => tao moi ThemLopThamGia(maDV, key); } } else { if (DichVuSucKhoeDAL.CheckExistsLopThamGia(maDV, key)) { //lop nay da tham gia, xoa lop nay trong danh sach lop tham gia dich vu XoaLopThamGia(maDV, key); } } } return(true); } }
public static string GetTenDV(string maDV) { DichVuSucKhoe dichVu = DichVuSucKhoeDAL.GetDichVu(maDV); if (dichVu != null) { return(dichVu.TenDV); } return(""); }
public static bool CapNhatSucKhoe(string maDV, string maTre, float canNang, float chieuCao, string tinhTrang) { DichVuSucKhoe dichVu = DichVuSucKhoeDAL.GetDichVu(maDV); if (DateTime.Today < dichVu.NgayKham) { MessageBox.Show("Chỉ được nhập sức khỏe sau ngày khám", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } else { DichVuSucKhoeDAL.CapNhatSucKhoe(maDV, maTre, canNang, chieuCao, tinhTrang); return(true); } }
public static bool CapNhatTreThamGiaDichVu(Dictionary <string, bool> listTre, string maDV) { DichVuSucKhoe dichVu = DichVuSucKhoeDAL.GetDichVu(maDV); if (DateTime.Today > dichVu.NgayKham) { MessageBox.Show("Dịch vụ này đã diễn ra, không được thay đổi thông tin", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } else { foreach (string key in listTre.Keys) { DichVuSucKhoeDAL.CapNhatTreThamGiaDichVu(maDV, key, listTre[key] ? 1 : 0); } return(true); } }
public static DichVuSucKhoe GetDV(string maDV) { return(DichVuSucKhoeDAL.GetDichVu(maDV)); }