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); }
public List <Medicine> GetMedicines() { var query = SqlQueryGeneration.GetAllMedicinesByIngredientId(((IEntity)this).EntityId); var medicines = new SqlExecuteManager().GetMedicine(query); return(medicines); }
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); }
public static Patient GetById(Guid patientId) { var query = SqlQueryGeneration.GetPatientById(patientId); var patient = _sqlManager.GetPatient(query); return(patient.Count > 0 ? patient.First() : null); }
public List <Order> GetOrders() { var query = SqlQueryGeneration.GetAllPatients(); //return new SqlExecuteManager().GetPatient(query); return(new List <Order>()); }
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); }
public static List <Ingredient> GetByMedicineId(Guid medicineId) { var query = SqlQueryGeneration.GetIngredientByMedicineIdId(medicineId); var ingredients = _sqlManager.GetIngredient(query); return(ingredients); }
public static Doctor GetDoctorByName(string doctorName) { var query = SqlQueryGeneration.GetDoctorByName(doctorName); var doctors = _sqlManager.GetDoctor(query); return(doctors.Count > 0 ? doctors.First() : null);; }
public static Doctor GetDoctorByRecipeId(Guid recipeId) { var query = SqlQueryGeneration.GetDoctorByRecipeId(recipeId); var doctors = _sqlManager.GetDoctor(query); return(doctors.Count > 0 ? doctors.First() : null);; }
public static List <Ingredient> GetAll() { var query = SqlQueryGeneration.GetAllIngredients(); var ingredients = _sqlManager.GetIngredient(query); return(ingredients); }
public static List <Order> GetAll() { var query = SqlQueryGeneration.GetAllOrders(); var orders = _sqlManager.GetOrder(query); FillObjectData(ref orders); return(orders); }
public static Order GetByPatientPhone(string patientPhone) { var query = SqlQueryGeneration.GetOrderByPathientPhone(patientPhone); var orders = _sqlManager.GetOrder(query); FillObjectData(ref orders); return(orders.FirstOrDefault()); }
public static Order GetById(Guid orderId) { var query = SqlQueryGeneration.GetOrderById(orderId); var orders = _sqlManager.GetOrder(query); FillObjectData(ref orders); return(orders.FirstOrDefault()); }
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)); }
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)); }
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)); }
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)); }
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); }
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); } }
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); } }
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); } }
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); } }
public static List <Doctor> GetAllDoctors() { var query = SqlQueryGeneration.GetAllDoctors(); return(_sqlManager.GetDoctor(query)); }