public BusinessPartnerLocationBackgroundService(IDalService dalService, IGeocoderService geocoderService, ILogger <BusinessPartnerLocationBackgroundService> logger) { _logger = logger; _dalService = dalService; _geocoderService = geocoderService; }
public Dictionary <string, int> drugStatistics(DateTime start, DateTime finish, string drugID = null) { try { Dictionary <string, int> result = new Dictionary <string, int>(); if (drugID != null) { var prescriptionsOnTheAppropriateDate = (from item in IDalService.GetAllRecipes() where (drugID == item.MedicineId && start <= item.Date && finish >= item.Date) group item by item.Date.ToString("MM")).ToList(); var prescriptions = prescriptionsOnTheAppropriateDate.OrderBy(g => g.Key); foreach (var g in prescriptions) { result.Add(g.Key, g.Count()); } } if (drugID == null) { var prescriptionsOnTheAppropriateDate = (from item in IDalService.GetAllRecipes() where (start <= item.Date && finish >= item.Date) group item by item.Date.ToString("MM")).ToList(); var prescriptions = prescriptionsOnTheAppropriateDate.OrderBy(g => g.Key); foreach (var g in prescriptions) { result.Add(g.Key, g.Count()); } } return(result); } catch (Exception e) { throw e; } }
private DigitalAssetLinksRepository(PackageManager packageManager) { mPackageManager = packageManager; mCache = new Dictionary <DalInfo, DalCheck>(); mDalService = (IDalService) new Retrofit.Builder() .BaseUrl(DAL_BASE_URL) .Build() .Create(Java.Lang.Class.FromType(typeof(IDalService))); }
public ServerManager(IControlTour controlTour, IHubService hubService, IDalService dalService) { this.controlTour = controlTour; this.dalService = dalService; this.hubService = hubService; controlTour.onPlaneMoved += Airport_planeMoved; controlTour.onError += Airport_onError; }
public User GetUser(string id) { try { return(IDalService.GetUser(id)); } catch (Exception ex) { throw ex; } }
public Recipe GetRecipe(string recipeId) { try { return(IDalService.GetRecipe(recipeId)); } catch (Exception ex) { throw ex; } }
public Patient GetPatient(string id) { try { return(IDalService.GetPatient(id)); } catch (Exception ex) { throw ex; } }
public Medicine GetMedicine(string id) { try { return(IDalService.GetMedicine(id)); } catch (Exception ex) { throw ex; } }
public void DeleteUser(User user) { try { IDalService.DeleteUser(user); } catch (Exception ex) { throw ex; } }
public void AddPatient(Patient patient) { try { IDalService.AddPatient(patient); } catch (Exception ex) { throw ex; } }
public SketchDownloadPageViewModel( INavigationService navigationService, IEventAggregator eventAggregator, IDalService dalService, ISaveService saveService) : base(navigationService) { _eventAggregator = eventAggregator; _dalService = dalService; _saveService = saveService; HasDownloadFinished = false; }
public void AddMedicine(Medicine medicine) { try { IDalService.AddMedicine(medicine); } catch (Exception ex) { throw ex; } }
public void AddRecipe(Recipe recipe) { try { IDalService.AddRecipe(recipe); } catch (Exception ex) { throw ex; } }
public void AddUser(User user) { try { IDalService.AddUser(user); } catch (Exception ex) { throw ex; } }
public List <Patient> GetAllPatients(Func <Patient, bool> predicate = null) { try { List <Patient> res = IDalService.GetAllPatients(); return(res); } catch (Exception ex) { throw ex; } }
public List <User> GetAllUsers(Func <User, bool> predicate = null) { try { List <User> res = IDalService.GetAllUsers(); return(res); } catch (Exception ex) { throw ex; } }
public List <Recipe> GetAllRecipes(Func <Recipe, bool> predicate = null) { try { List <Recipe> res = IDalService.GetAllRecipes(); return(res); } catch (Exception ex) { throw ex; } }
public List <string> GetAllMedicinesNames() { try { var names = (from item in IDalService.GetAllMedicines() select item.CommercialName).ToList(); return(names); } catch (Exception ex) { throw ex; } }
public List <string> GetAllMedicineId() { try { var ids = (from item in IDalService.GetAllMedicines() select item.Id).ToList(); return(ids); } catch (Exception ex) { throw ex; } }
public NewBrainstormingPageViewModel( ILogger logger, IUiNavigationService navigationService, IDalService dalService, BrainstormingContext brainstormingContext) { _logger = logger; _navigationService = navigationService; _brainstormingDalService = dalService.BrainstormingDalService; _context = brainstormingContext; CreateFindingCommand = new DelegateCommand(CreateFinding); HasInvalidChars = false; }
public BaseServicesTest() { TestServer = new TestServer( WebHost .CreateDefaultBuilder() .UseEnvironment("InMemoryTesting") .UseStartup <Startup>()); var configuration = (IConfiguration)TestServer.Host.Services.GetService(typeof(IConfiguration)); DbContext = (RalDbContext)TestServer.Host.Services.GetService(typeof(RalDbContext)); DalService = (IDalService)TestServer.Host.Services.GetService(typeof(IDalService)); Mapper = (IMapper)TestServer.Host.Services.GetService(typeof(IMapper)); }
public LoginPageViewModel( ILogger logger, IUiNavigationService navigationService, IDalService dalService, BrainstormingContext context) { _logger = logger; _navigationService = navigationService; _participantDalService = dalService.ParticipantDalService; _context = context; LoginCommand = new DelegateCommand(async() => await Login()); ShowRegisterCommand = new DelegateCommand(ShowRegister); }
public AuthenticationService( TokenValidationParameters tokenValidationParameters, JwtSettings jwtSettings, IDalService dalService, UserManager <IdentityUser> userManager, ILogger <AuthenticationService> logger) { _tokenValidationParametersWithoutExpiry = tokenValidationParameters.Clone(); _tokenValidationParametersWithoutExpiry.ValidateLifetime = false; _dalService = dalService; _logger = logger; _userManager = userManager; _jwtSettings = jwtSettings; }
public BrainstormingFindingListPageViewModel(IUiNavigationService navigationService, IDalService iDalService, BrainstormingContext brainstormingContext, ILogger logger) { _navigationService = navigationService; _brainstormingDalService = iDalService.BrainstormingDalService; _brainstormingContext = brainstormingContext; _logger = logger; FillFindingListItems(); _brainstormingContext.PropertyChanged += Context_PropertyChanged; SelectFindingCommand = new DelegateCommand(SelectFinding); CreateFindingCommand = new DelegateCommand(async() => await CreateBrainstormingFinding()); }
public BrainstormingService( ILogger logger, IDalService iDalService, BrainstormingContext brainstormingContext, BrainstormingModel brainstormingModel) { _logger = logger; _context = brainstormingContext; _brainstormingDalService = iDalService.BrainstormingDalService; _teamDalService = iDalService.TeamDalService; _fileDalService = iDalService.FileDalService; _patternDalService = iDalService.PatternDalService; _stateMachine = new StateMachine(_logger, _brainstormingDalService, _context, brainstormingModel); _stateMachine.PropertyChanged += StateMachine_PropertyChanged; _brainstormingModel = brainstormingModel; _brainstormingModel.PropertyChanged += _brainstormingModel_PropertyChanged; }
public void TestGetWithNSub() { var rtnForGetAll = new List <User>() { new User() { Name = "Amigo", DepartmentId = 1, Department = new Department() { Name = "開發二課" } }, new User() { Name = "Ariel", DepartmentId = 1, Department = new Department() { Name = "開發一課" } }, new User() { Name = "Frank", DepartmentId = 1, Department = new Department() { Name = "開發一課" } } }; IDalService dalService = Substitute.For <IDalService>(); dalService.GetAll().Returns(rtnForGetAll.AsEnumerable()); var entities = dalService.GetAll(); foreach (var entity in entities) { Debug.WriteLine(String.Format("Name:{0}, Department:{1}", entity.Name, entity.Department.Name)); } Debug.WriteLine("Finish"); //The real test here .... }
protected RepositoryTests(DatabaseFixture fixture) { var webHost = WebHost.CreateDefaultBuilder() .UseEnvironment("SapIntegrationTesting") .UseStartup <Startup>() .Build(); var configuration = (IConfiguration)webHost.Services.GetService(typeof(IConfiguration)); var settings = new TestSettings(); configuration.Bind(nameof(TestSettings), settings); var sapServerSettings = new SapServerSettings(); configuration.Bind(nameof(SapServerSettings), sapServerSettings); fixture.SetBackupPath(settings.SqlBackupPath); DalService = (IDalService)webHost.Services.GetService(typeof(IDalService)); //Clear tests after dispose fixture.SetConnectionString(sapServerSettings.SapServerSql); fixture.BackupDatabase(); fixture.RestoreDatabaseOnDispose(true); }
public List <Recipe> getPatientHistoryByDrug(DateTime first, DateTime second, string patientId = null, string drugID = null) { try { List <Recipe> result = new List <Recipe>(); if (patientId != null && drugID != null) { result = (from item in getPatientHistory(patientId) where drugID == item.MedicineId && item.Date <= second.AddDays(1) && item.Date.AddDays(item.PeriodOfUse) > first select item).ToList(); } if (patientId != null && drugID == null) { result = (from item in getPatientHistory(patientId) where item.Date <= second.AddDays(1) && item.Date.AddDays(item.PeriodOfUse) > first select item).ToList(); } if (patientId == null && drugID != null) { result = (from item in IDalService.GetAllRecipes() where drugID == item.MedicineId && item.Date <= second.AddDays(1) && item.Date.AddDays(item.PeriodOfUse) > first select item).ToList(); } if (patientId == null && drugID == null) { result = (from item in IDalService.GetAllRecipes() where item.Date <= second.AddDays(1) && item.Date.AddDays(item.PeriodOfUse) > first select item).ToList(); } return(result); } catch (Exception ex) { throw ex; } }
public BllService(IDalService <T> dalService) { this.DBService = dalService; }
public UserDataService(IDalService dalService) { _dalService = dalService; }