protected void saveButton_Click(object sender, EventArgs e)
        {
            Medicine aMedicine = new Medicine();

            aMedicine.Name = medicineTextBox.Text;

            msgLabel.Text = aMedicineManager.Save(aMedicine);
            medicineGridView.DataSource = aMedicineManager.ShowMedicine();
            medicineGridView.DataBind();
        }
 public string Save(Medicine aMedicine)
 {
     if (aMedicineGateway.Save(aMedicine) > 0)
         {
             return "Saved Successfully";
         }
         else
         {
             return "Failed";
         }
 }
        public List<Medicine> GetCenterAllMedicineList(int centerId)
        {
            List<Medicine> medicineList = new List<Medicine>();
            string query = "SELECT * FROM CenterMedicineRelationTBL WHERE CenterId='" + centerId + "'";
            SqlConnection connection = new SqlConnection(connectionString);

            SqlCommand command = new SqlCommand(query, connection);
            connection.Open();
            SqlDataReader reader = command.ExecuteReader();
            while (reader.Read())
            {
                int medicineId = int.Parse(reader["MedicineId"].ToString());
                Medicine aMedicine = new Medicine();
                aMedicine = medicineManager.GetCenterAllMedicines(medicineId);
                aMedicine.Quantity = int.Parse(reader["Quantity"].ToString());
                medicineList.Add(aMedicine);
            }
            reader.Close();
            connection.Close();
            return medicineList;
        }