protected void saveDiseasesButton_Click(object sender, EventArgs e)
        {
            Diseases aDiseases = new Diseases();
            aDiseases.Name = diseasesNameTextBox.Text;
            aDiseases.Discription = discriptionTextBox.Text;
            aDiseases.TreatmentProcedure = treatmentProcedureTextBox.Text;
            int message = diseasesManager.SaveDiseases(aDiseases);
            if (message > 0)
            {
                messageLabel.Text = "Successfully Saved";
                messageLabel.ForeColor = Color.Green;
                LoadAllDiseases();

            }
            else if (message == 0)
            {
                messageLabel.Text = "This Diseases name alresdy saved";
                messageLabel.ForeColor = Color.Red;
            }
            else
            {
                messageLabel.Text = "Saved Failed";
                messageLabel.ForeColor = Color.Red;
            }
        }
 public bool SaveDiseases(Diseases aDiseases)
 {
     string saveMedicine = "INSERT INTO tbl_diseases (DiseasesName,Description,TreatmentProc) VALUES(@name,@discription,@treatmentProc)";
     sqlConnection.Open();
     sqlCommand.CommandText = saveMedicine;
     sqlCommand.Parameters.AddWithValue("@name", aDiseases.Name);
     sqlCommand.Parameters.AddWithValue("@discription", aDiseases.Discription);
     sqlCommand.Parameters.AddWithValue("@treatmentProc", aDiseases.TreatmentProcedure);
     int rowAffected = sqlCommand.ExecuteNonQuery();
     sqlConnection.Close();
     if (rowAffected > 0)
     {
         return true;
     }
     return false;
 }
        public int SaveDiseases(Diseases aDiseases)
        {
            if (diseasesGateway.IsThisDiseasesNameExists(aDiseases.Name))
            {
                return 0;
            }
            else
            {
                if (diseasesGateway.SaveDiseases(aDiseases))
                {
                    return 1;
                }
                else
                {
                    return 2;
                }

            }
        }
        public List<Diseases> GetAllDiseases()
        {
            string searchMedicine = "SELECT * FROM tbl_diseases ORDER BY DiseasesName ASC";
            sqlConnection.Open();
            sqlCommand.CommandText = searchMedicine;
            SqlDataReader reader = sqlCommand.ExecuteReader();
            List<Diseases> diseasesList = new List<Diseases>();
            while (reader.Read())
            {
                Diseases aDiseases = new Diseases();
                aDiseases.Id = (int) reader["id"];
                aDiseases.Name = reader["DiseasesName"].ToString();
                aDiseases.Discription = reader["Description"].ToString();
                aDiseases.TreatmentProcedure = reader["TreatmentProc"].ToString();
                diseasesList.Add(aDiseases);

            }
            reader.Close();
            sqlConnection.Close();
            return diseasesList;
        }