public List<Medicine> GetllMedicines()
        {
            List<Medicine> medicines = new List<Medicine>();

            SqlConnection connection = new SqlConnection(connectionstring);

            string query = "SELECT * FROM Table_Medicine";

            SqlCommand command = new SqlCommand(query, connection);

            connection.Open();

            SqlDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                 Medicine medicine=new Medicine();

                medicine.Id = int.Parse(reader["medicine_Id"].ToString());
                medicine.Name = reader["medicine_Name"].ToString();

               medicines.Add(medicine);
            }

            return medicines;
        }
        public string Insert(Medicine medicine)
        {
            if (medicine.Name == "")
            {
                return "medicine name is missing";

            }

            else if (medicineGateway.IsThisMedicineNameExists(medicine.Name))
            {
                return "medicine name already exists!!";
            }

            else
            {
                int value = medicineGateway.Insert(medicine);

                if (value > 0)
                {
                    return "Saved Successfully";
                }

                else
                {
                    return "Operation Failed";
                }
            }
        }
        public int Insert(Medicine medicine)
        {
            SqlConnection connection = new SqlConnection(connectionstring);

            string query = "INSERT INTO Table_Medicine VALUES('" + medicine.Name + "')";

            SqlCommand command = new SqlCommand(query, connection);

            connection.Open();

            int rowsAffected = command.ExecuteNonQuery();

            connection.Close();

            return rowsAffected;
        }