public static string GetIDByClinicName(string Name) { Name = Name.ToLower(); cPhongKhamDO group = new cPhongKhamDO(); using (DB_HMS_Entities lst = new DB_HMS_Entities()) { var query = from u in lst.tbPHONGKHAMs where u.TENPHONG == Name select u; foreach (var row in query) { group.MAPHONGKHAM = row.MAPHONGKHAM; } } return group.MAPHONGKHAM; }
/// <summary> /// lấy thông tin phòng khám /// </summary> /// <returns></returns> public cPhongKhamDO Getthongtinpk() { cPhongKhamDO ds = new cPhongKhamDO(); ds.TENPHONG = txtTenphongkham.Text; ds.MAPHONGKHAM = txtMaphongkham.Text; ds.NGAYTAO = DateTime.Today; if(chkTrangThai.Checked == true) { ds.TRANGTHAI = true; }else { ds.TRANGTHAI = false; } return ds; }
/// <summary> /// Lay danh sach phong kham tu entities /// </summary> /// <returns></returns> public static List<cPhongKhamDO> Getdsphongkham() { List<cPhongKhamDO> dsphongkham = new List<cPhongKhamDO>(); using (DB_HMS_Entities ds = new DB_HMS_Entities()) { var query = from ads in ds.tbPHONGKHAMs select ads; foreach(var row in query) { cPhongKhamDO dss = new cPhongKhamDO(); dss.MAPHONGKHAM = row.MAPHONGKHAM; dss.TENPHONG = row.TENPHONG; dss.NGAYTAO = row.NGAYTAO.Value; dss.TRANGTHAI = row.TRANGTHAI.Value; dsphongkham.Add(dss); } return dsphongkham; } }
public static string GetNameByClinicID(string ID) { ID = ID.ToLower(); cPhongKhamDO group = new cPhongKhamDO(); using (DB_HMS_Entities lst = new DB_HMS_Entities()) { var query = from u in lst.tbPHONGKHAMs where u.MAPHONGKHAM == ID select u; foreach (var row in query) { group.TENPHONG = row.TENPHONG; } } return group.TENPHONG; }
/// <summary> /// kiểm tra thông tin nhập vào /// </summary> /// <param name="ds"></param> /// <returns></returns> private static bool Checkdauvao(cPhongKhamDO ds) { if (ds.MAPHONGKHAM.Equals("")) { XtraMessageBox.Show("Vui lòng nhập lại mã phòng khám!"); return false; } if (ds.TENPHONG.Equals("")) { XtraMessageBox.Show("Vui lòng nhập lại tên phòng khám!"); return false; } return true; }