public List<Medicine> GetAllMedicines()
        {
            aGateway.command.CommandText = "SELECT * FROM MedicineList_tbl";
            aGateway.sqlConnection.Open();
            SqlDataReader reader = aGateway.command.ExecuteReader();
            List<Medicine> medicinesList = new List<Medicine>();

            if (reader != null)
                while (reader.Read())
                {
                    Medicine aMedicine = new Medicine();
                    aMedicine.ID = Convert.ToInt16(reader["ID"].ToString());
                    aMedicine.MedicineName = reader["MedicineNameWithML"].ToString();
                    medicinesList.Add(aMedicine);

                }
            reader.Close();
            aGateway.sqlConnection.Close();
            return medicinesList;
        }
 public int SaveMedicine(Medicine aMedicine)
 {
     string query = "insert into MedicineList_tbl(MedicineNameWithML) values('" + aMedicine.MedicineName + "')";
     aGateway.sqlConnection.Open();
     aGateway.command.CommandText = query;
     int rowAffected = aGateway.command.ExecuteNonQuery();
     aGateway.sqlConnection.Close();
     return rowAffected;
 }
 public int SaveMedicine(Medicine aMedicine)
 {
     return aHeadOfficeGateway.SaveMedicine(aMedicine);
 }
        public List<Medicine> MedicineList()
        {
            List<Medicine> MedicineList=new List<Medicine>();
            aGateway.command.CommandText = "SELECT * FROM MedicineList_tbl ORDER BY MedicineNameWithML ASC";
            aGateway.sqlConnection.Open();
            SqlDataReader reader = aGateway.command.ExecuteReader();
            while (reader.Read())
            {
                Medicine newMedicine =new Medicine();
                newMedicine.MedicineName = reader[1].ToString();
                MedicineList.Add(newMedicine);

            }
            reader.Close();
            aGateway.sqlConnection.Close();
            return MedicineList;
        }
        public void GetMedicineList()
        {
            medicineStockList = aCenterManager.GetAllMedicineByCenterID(newCenter);

            foreach (CenterMedicineStock medicine in medicineStockList)
            {
                Medicine newMedicine = new Medicine();
                newMedicine.ID = medicine.MedicineID;
                newMedicine.MedicineName = aCenterManager.GetMedicineInfo(medicine.MedicineID);
                newMedicineList.Add(newMedicine);
            }
        }