Esempio n. 1
0
        public static List <Ingredient> GetByName(string ingredientName)
        {
            var query       = SqlQueryGeneration.GetIngredientByName(ingredientName);
            var ingredients = _sqlManager.GetIngredient(query);

            return(ingredients);
        }
        public static MedicineType GetUseMethodById(Guid useMethodId)
        {
            var query     = SqlQueryGeneration.GetUseMethodById(useMethodId);
            var useMethod = _sqlManager.GetUseMethod(query);

            return(useMethod.Count > 0 ? useMethod.First() : null);
        }
        public static MedicineType GetUseMethodByName(string useMethodName)
        {
            var query     = SqlQueryGeneration.GetUseMethodByName(useMethodName);
            var useMethod = _sqlManager.GetUseMethod(query);

            return(useMethod.Count > 0 ? useMethod.First() : null);
        }
Esempio n. 4
0
        public List <Medicine> GetMedicines()
        {
            var query     = SqlQueryGeneration.GetAllMedicinesByIngredientId(((IEntity)this).EntityId);
            var medicines = new SqlExecuteManager().GetMedicine(query);

            return(medicines);
        }
Esempio n. 5
0
        public List<Ingredient> GetIngredients()
        {
            var query = SqlQueryGeneration.GetIngredientByMedicineIdId(this.Id);
            var ingredients = new SqlExecuteManager().GetIngredient(query);

            return ingredients;
        }
        public static Patient GetByRecipeId(Guid orderId)
        {
            var query   = SqlQueryGeneration.GetPatientByRecipeId(orderId);
            var patient = _sqlManager.GetPatient(query);

            return(patient.FirstOrDefault());
        }
        public static List <Patient> GetAll()
        {
            var query   = SqlQueryGeneration.GetAllPatients();
            var patient = _sqlManager.GetPatient(query);

            return(patient);
        }
        public static List <Patient> GetByPhone(string phoneNumber)
        {
            var query   = SqlQueryGeneration.GetPatientByPhone(phoneNumber);
            var patient = _sqlManager.GetPatient(query);

            return(patient);
        }
        public static List <Patient> GetByName(string patientName)
        {
            var query   = SqlQueryGeneration.GetPatientByName(patientName);
            var patient = _sqlManager.GetPatient(query);

            return(patient);
        }
Esempio n. 10
0
        public static Patient GetById(Guid patientId)
        {
            var query   = SqlQueryGeneration.GetPatientById(patientId);
            var patient = _sqlManager.GetPatient(query);

            return(patient.Count > 0 ? patient.First() : null);
        }
Esempio n. 11
0
        public List <Order> GetOrders()
        {
            var query = SqlQueryGeneration.GetAllPatients();

            //return new SqlExecuteManager().GetPatient(query);
            return(new List <Order>());
        }
Esempio n. 12
0
        public static Ingredient GetById(Guid ingredientId)
        {
            var query       = SqlQueryGeneration.GetIngredientById(ingredientId);
            var ingredients = _sqlManager.GetIngredient(query);

            return(ingredients.Count > 0 ? ingredients.First() : null);
        }
        public static List <MedicineType> GetAll()
        {
            var query     = SqlQueryGeneration.GetAllUseMethods();
            var useMethod = _sqlManager.GetUseMethod(query);

            return(useMethod);
        }
Esempio n. 14
0
        public static List <Ingredient> GetByMedicineId(Guid medicineId)
        {
            var query       = SqlQueryGeneration.GetIngredientByMedicineIdId(medicineId);
            var ingredients = _sqlManager.GetIngredient(query);

            return(ingredients);
        }
Esempio n. 15
0
        public static Doctor GetDoctorByName(string doctorName)
        {
            var query   = SqlQueryGeneration.GetDoctorByName(doctorName);
            var doctors = _sqlManager.GetDoctor(query);

            return(doctors.Count > 0 ? doctors.First() : null);;
        }
Esempio n. 16
0
        public static Doctor GetDoctorByRecipeId(Guid recipeId)
        {
            var query   = SqlQueryGeneration.GetDoctorByRecipeId(recipeId);
            var doctors = _sqlManager.GetDoctor(query);

            return(doctors.Count > 0 ? doctors.First() : null);;
        }
Esempio n. 17
0
        public static List <Ingredient> GetAll()
        {
            var query = SqlQueryGeneration.GetAllIngredients();

            var ingredients = _sqlManager.GetIngredient(query);

            return(ingredients);
        }
Esempio n. 18
0
        public static List <Order> GetAll()
        {
            var query  = SqlQueryGeneration.GetAllOrders();
            var orders = _sqlManager.GetOrder(query);

            FillObjectData(ref orders);

            return(orders);
        }
Esempio n. 19
0
        public static Order GetByPatientPhone(string patientPhone)
        {
            var query  = SqlQueryGeneration.GetOrderByPathientPhone(patientPhone);
            var orders = _sqlManager.GetOrder(query);

            FillObjectData(ref orders);

            return(orders.FirstOrDefault());
        }
Esempio n. 20
0
        public static Order GetById(Guid orderId)
        {
            var query  = SqlQueryGeneration.GetOrderById(orderId);
            var orders = _sqlManager.GetOrder(query);

            FillObjectData(ref orders);

            return(orders.FirstOrDefault());
        }
Esempio n. 21
0
        public static Guid Insert(Recipe recipe)
        {
            if (recipe == null)
            {
                throw new ArgumentException("Recipe information was not provided");
            }

            var query = SqlQueryGeneration.InsertRecipe(recipe);

            return(_sqlManager.InsertRecipe(query));
        }
Esempio n. 22
0
        public static bool Delete(Medicine medicine)
        {
            if (medicine == null || medicine.Id == Guid.Empty)
            {
                throw new ArgumentException("MedicineId information was not provided");
            }

            var query = SqlQueryGeneration.DeleteMedicine(medicine);

            return(_sqlManager.DeleteMedicine(query));
        }
Esempio n. 23
0
        public static Guid Insert(Patient patient)
        {
            if (patient == null)
            {
                throw new ArgumentException("Patient information was not provided");
            }

            var query = SqlQueryGeneration.InsertPatient(patient);

            return(_sqlManager.InsertPatient(query));
        }
Esempio n. 24
0
        public static Doctor Update(Doctor doctor)
        {
            if (doctor == null)
            {
                throw new ArgumentException("doctor information was not provided");
            }

            var query = SqlQueryGeneration.InsertDoctor(doctor);

            return(string.IsNullOrEmpty(query) ? doctor : _sqlManager.UpdateDoctor(query));
        }
Esempio n. 25
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);
        }
Esempio n. 26
0
        public static Guid Insert(Medicine medicine)
        {
            if (medicine == null)
            {
                throw new ArgumentException("Medicine information was not provided");
            }

            var query = SqlQueryGeneration.InsertMedicine(medicine);

            try
            {
                return(_sqlManager.InsertMedicine(query, medicine.Image));
            }
            catch (SqlException e)
            {
                //ToDo: Log Exception
                throw new Exception("Failed to insert Medicine", e);
            }
        }
Esempio n. 27
0
        public static Guid Insert(Doctor doctor)
        {
            if (doctor == null)
            {
                throw new ArgumentException("doctor information was not provided");
            }

            var query = SqlQueryGeneration.InsertDoctor(doctor);

            try
            {
                return(_sqlManager.InsertDoctor(query));
            }
            catch (SqlException e)
            {
                //ToDo: Log Exception
                throw new Exception("Failed to insert Doctor", e);
            }
        }
Esempio n. 28
0
        public static void Insert(Ingredient ingredient)
        {
            if (ingredient == null)
            {
                throw new ArgumentException("Medicine information was not provided");
            }

            var query = SqlQueryGeneration.InsertIngredient(ingredient);

            try
            {
                _sqlManager.InsertIngredient(query);
            }
            catch (SqlException e)
            {
                //ToDo: Log Exception
                throw new Exception("Failed to insert Medicine", e);
            }
        }
Esempio n. 29
0
        public static void Insert(Order order)
        {
            if (order == null)
            {
                throw new ArgumentException("Order information was not provided");
            }

            var query = SqlQueryGeneration.InsertOrder(order);

            try
            {
                _sqlManager.InsertOrder(query);
            }
            catch (SqlException e)
            {
                //ToDo: Log Exception
                throw new Exception("Failed to insert Order", e);
            }
        }
Esempio n. 30
0
        public static List <Doctor> GetAllDoctors()
        {
            var query = SqlQueryGeneration.GetAllDoctors();

            return(_sqlManager.GetDoctor(query));
        }