public DoctorModel GetDoctorByCriteria(DoctorModel doctor, string connectionString) { DoctorModel doctorDetails = new DoctorModel(); DataSet ds = DoctorsDA.GetDoctorsByCriteria(doctor.Id, doctor.Name, doctor.Designation, doctor.SearchText, doctor.Password, connectionString); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { return(GetDoctorFromDataRow(ds.Tables[0].Rows[0])); } return(doctorDetails); }
public List <DoctorModel> GetDoctorsByCriteria(DoctorModel doctor, string connectionString) { List <DoctorModel> doctorsList = new List <DoctorModel>(); DataSet ds = DoctorsDA.GetDoctorsByCriteria(doctor.Id, doctor.Name, doctor.Designation, doctor.SearchText, doctor.Password, connectionString); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { return(GetDoctorFromDataTable(ds.Tables[0])); } return(doctorsList); }