Ejemplo n.º 1
0
        public int SaveDoctorSpeciality(DoctorsSpecialities aDoctorSpeciality)
        {
            Query   = "INSERT INTO DoctorsSpecialities VALUES(@speciality)";
            Command = new SqlCommand(Query, Connection);
            Command.Parameters.AddWithValue("speciality", aDoctorSpeciality.Speciality);
            Connection.Open();
            int rowAffected = Command.ExecuteNonQuery();

            Connection.Close();
            return(rowAffected);
        }
Ejemplo n.º 2
0
        public string SaveDoctorSpeciality(DoctorsSpecialities aDoctorSpeciality)
        {
            int rowAffected = aMainAdminGateway.SaveDoctorSpeciality(aDoctorSpeciality);

            if (rowAffected > 0)
            {
                return("Success");
            }
            else
            {
                return("Doctor speciality saving failed.");
            }
        }
Ejemplo n.º 3
0
        public List <DoctorsSpecialities> GetSpecialities()
        {
            Query   = "SELECT * FROM DoctorsSpecialities ORDER BY Speciality";
            Command = new SqlCommand(Query, Connection);
            Connection.Open();
            Reader = Command.ExecuteReader();
            List <DoctorsSpecialities> doctorsSpecialities = new List <DoctorsSpecialities>();

            while (Reader.Read())
            {
                DoctorsSpecialities specialities = new DoctorsSpecialities();
                specialities.Id         = Convert.ToInt32(Reader["Id"]);
                specialities.Speciality = Reader["Speciality"].ToString();
                doctorsSpecialities.Add(specialities);
            }
            Reader.Close();
            Connection.Close();
            return(doctorsSpecialities);
        }