示例#1
0
        private static List <Medicine> FillObjectData(string query)
        {
            var medicines = _sqlManager.GetMedicine(query);

            foreach (var medicine in medicines)
            {
                medicine.Ingredients = IngredientManager.GetByMedicineId(medicine.Id);
            }

            return(medicines);
        }
示例#2
0
        public static Medicine Update(Medicine medicine)
        {
            if (medicine == null)
            {
                throw new ArgumentException("Medicine information was not provided");
            }

            var query = SqlQueryGeneration.UpdateMedicine(medicine);


            var returnMedicine = _sqlManager.UpdateMedicine(query, medicine.Image);

            returnMedicine.Ingredients = IngredientManager.GetByMedicineId(returnMedicine.Id);

            return(returnMedicine);
        }