//Appointment Search===================== public int appointmentView() { DB_Operations db = new DB_Operations(); try { string sql = "SELECT * FROM Appointments WHERE DoctorID =" + DoctorID + " AND Date = '" + Date + "'"; ds = db.exesearchQuery(sql); if (ds.Tables[0].Rows.Count > 0) { return(1); } else { return(0); } } catch (Exception ex) { throw ex; } }
//Search public int search() { DB_Operations db = new DB_Operations(); try { string sql = "SELECT * FROM NeerogaUsers WHERE UserID = " + UserID; DataSet ds = db.exesearchQuery(sql); if (ds.Tables[0].Rows.Count > 0) { UserID = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString()); UserName = ds.Tables[0].Rows[0][1].ToString(); Password = ds.Tables[0].Rows[0][2].ToString(); UserType = ds.Tables[0].Rows[0][3].ToString(); Age = Convert.ToInt32(ds.Tables[0].Rows[0][4].ToString()); City = ds.Tables[0].Rows[0][5].ToString(); Gender = ds.Tables[0].Rows[0][6].ToString(); TP_No = Convert.ToInt32(ds.Tables[0].Rows[0][7].ToString()); Category = ds.Tables[0].Rows[0][8].ToString(); return(1); } else { return(0); } } catch (Exception ex) { throw ex; } }
public int userlogin(int id) { this.ID = id; DB_Operations db = new DB_Operations(); try { string sql = "SELECT * FROM NeerogaUsers WHERE UserID = " + ID + ""; DataSet ds = db.exesearchQuery(sql); if (ds.Tables[0].Rows.Count > 0) { ID = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString()); Password = ds.Tables[0].Rows[0][2].ToString(); UserType = ds.Tables[0].Rows[0][3].ToString(); return(1); } else { return(0); } } catch (Exception ex) { throw ex; } }
//search========== public int search() { DB_Operations db = new DB_Operations(); try { //string sql = "SELECT * FROM PatientDetails WHERE " + DoctorID + " "; string sql = "SELECT Max(AppointmentID) from Appointments"; ds = db.exesearchQuery(sql); if (ds.Tables[0].Rows.Count > 0) { AppointmentID = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString()); return(1); } else { return(0); } } catch (Exception ex) { throw ex; } }
//Seerch records public int RecordSearch() { DB_Operations db = new DB_Operations(); try { string sql = "SELECT * FROM PatientRecords where AppointmentID = " + AppointmentID + " "; ds = db.exesearchQuery(sql); if (ds.Tables[0].Rows.Count > 0) { return(1); } else { return(0); } } catch (Exception ex) { throw ex; } }
//SEARCH CODE public int search() { DB_Operations db = new DB_Operations(); try { string sql = "SELECT * FROM PatientDetails WHERE " + cname + " LIKE '%" + sname + "%' "; ds = db.exesearchQuery(sql); if (ds.Tables[0].Rows.Count > 0) { return(1); } else { return(0); } } catch (Exception ex) { throw ex; } }
//SEARCH CODE public int search() { DB_Operations db = new DB_Operations(); try { string sql = "SELECT * FROM Doctor_Availability WHERE UserID = " + DoctorID + " "; ds = db.exesearchQuery(sql); if (ds.Tables[0].Rows.Count > 0) { //PatientID = ds.Tables[0].Rows[0][0].ToString(); //PatientName = ds.Tables[0].Rows[0][1].ToString(); //PatientContact = ds.Tables[0].Rows[0][2].ToString(); //PatientAge = Convert.ToInt32(ds.Tables[0].Rows[0][3].ToString()); return(1); } else { return(0); } } catch (Exception ex) { throw ex; } }
//Search Availabiity public int Doctor_AvailabilitySearch() { DB_Operations db = new DB_Operations(); try { string sql = "SELECT * FROM Doctor_Availability where UserID = " + DoctorID + " "; ds = db.exesearchQuery(sql); if (ds.Tables[0].Rows.Count > 0) { return(1); } else { return(0); } } catch (Exception ex) { throw ex; } }
//Datatable public DataTable gettable() { DB_Operations db = new DB_Operations(); try { string sql = "select * from NeerogaUsers"; DataSet ds = db.exesearchQuery(sql); if (ds.Tables[0].Rows.Count > 0) { return(ds.Tables[0]); } else { return(ds.Tables[0]); } } catch (Exception ex) { throw ex; } }