protected override async Task OnInitializedAsync() { Project = await ProjectDataService.GetProjectAsync(ProjectID); Title = Project.Title; Requirement = Project.Requirement; Design = Project.Design; CompletionDate = Project.CompletionDate; }
protected override async Task OnInitializedAsync() { ProjectViewModel = await ProjectDataService.GetProjectAsync(ProjectSlug); Title = ProjectViewModel.Title; Requirement = ProjectViewModel.Requirement; Design = ProjectViewModel.Design; CompletionDate = ProjectViewModel.CompletionDate; }
public void FixtureSetUp() { _context = new SiteContext(); // connection string is taken from app.config file _seeder = new DatabaseSeeder(_context); _seeder.InitialiseDb(); // create database structure ProjectRepository projectRepository = new ProjectRepository(_context); _projectDataService = new ProjectDataService(projectRepository); }
public async Task SubmitChanges() { Project.Title = Title; Project.Requirement = Requirement; Project.Design = Design; Project.CompletionDate = CompletionDate; await ProjectDataService.UpdateProjectAsync(Project); NavigationManager.NavigateTo($"/projects/detail/{Project.ID}"); }
public ReleaseRetentionService( EnvironmentDataService environmentDataService, ProjectDataService projectDataService, ReleaseDataService releaseDataService, DeploymentDataService deploymentDataService, ILogger <ReleaseRetentionService> logger) { _environmentDataService = environmentDataService; _projectDataService = projectDataService; _releaseDataService = releaseDataService; _deploymentDataService = deploymentDataService; _logger = logger; }
public async Task SubmitChanges() { ProjectViewModel.Title = Title; ProjectViewModel.Requirement = Requirement; ProjectViewModel.Design = Design; ProjectViewModel.CompletionDate = CompletionDate; ProjectSlug = ProjectViewModel.Title.ToSlug(); await ProjectDataService.UpdateProjectAsync(ProjectViewModel); NavigationManager.NavigateTo($"projects/detail/{ProjectSlug}"); }
public void Init() { _elasticSearchServiceMock = new Mock <IElasticSearchService>(); _efContext = EFContextFactory.CreateInMemoryEFContext(); _optionsMock = new Mock <IOptions <AppSettings> >(); _optionsMock.Setup(o => o.Value).Returns(new AppSettings()); _efContext.Currency.Add(new Currency { DefaultCurrency = true, Symbol = "$", Code = "USD" }); _efContext.SaveChanges(); _projectDataService = new ProjectDataService(_elasticSearchServiceMock.Object, _efContext, _optionsMock.Object); }
protected override async Task OnInitializedAsync() { ProjectViewModels = await ProjectDataService.GetProjectsAsync(); //Not a fan of this nested logic //What I'm trying to do is collect every distinct category of a given type of CategoryTypeFilter foreach (ProjectViewModel projectVM in ProjectViewModels) { foreach (Category category in projectVM.Categories) { if (!CategoryList.Contains <Category>(category) && category.Type == CategoryTypeFilter) { CategoryList.Add(category); } } } }
public TransactionStatusModel AddNewProduct(ProductDTO product) { TransactionStatusModel transStatus = new TransactionStatusModel(); ProjectDataService dataService = new ProjectDataService(); using (TransactionScope tran = new TransactionScope()) { try { transStatus = dataService.AddNewProduct(product); } catch (Exception ex) { transStatus.ReturnStatus = false; transStatus.ReturnMessage.Add("Add Product Failed"); return(transStatus); } tran.Complete(); } return(transStatus); }
public TransactionStatusModel AddTransaction(TransactionDTO transaction) { TransactionStatusModel transStatus = new TransactionStatusModel(); ProjectDataService dataService = new ProjectDataService(); using (TransactionScope tran = new TransactionScope()) { try { transStatus = dataService.AddTransaction(transaction); } catch (Exception ex) { transStatus.ReturnStatus = false; transStatus.ReturnMessage.Add("Add Transaction Failed"); return(transStatus); } try { foreach (var sale in transaction.SaleDtoList) { transStatus = dataService.AddSale(sale); transStatus = dataService.UpdateStock(sale.ProductDto); //comment out this line when using Sale Generator } } catch (Exception ex) { transStatus.ReturnStatus = false; transStatus.ReturnMessage.Add("Add Sale Failed"); return(transStatus); } tran.Complete(); } return(transStatus); }
public void DoesCreateWorks() { var options = new DbContextOptionsBuilder <MDManagementDbContext>() .UseInMemoryDatabase(databaseName: "testDb") .Options; using (var dbContext = new MDManagementDbContext(options)) { var userManager = new Mock <UserManager <Employee> >().Object; IJobTitleDataService jobTitleService = new JobTittleDataServie(dbContext); ICompanyDataService companyService = new CompanyDataSerive(dbContext); IEmployeeDataService employeeService = new EmployeeDataService(dbContext, jobTitleService, companyService, userManager); IProjectDataService projectService = new ProjectDataService(dbContext, employeeService); var modelService = new ProjectServiceModel { Name = "AI", Description = "nope", }; Assert.AreEqual("AI", dbContext.Projects.FirstOrDefault().Name); } }
public TransactionStatusModel UpdateUser(UserDTO user) { TransactionStatusModel transStatus = new TransactionStatusModel(); ProjectDataService dataService = new ProjectDataService(); using (TransactionScope tran = new TransactionScope()) { try { transStatus = dataService.UpdateUser(user); } catch (Exception ex) { transStatus.ReturnStatus = false; transStatus.ReturnMessage.Add("Update User Failed"); return(transStatus); } tran.Complete(); } return(transStatus); }
public ProjectManager(FreeLancersEntities entities) : base(entities) { _projectDataService = new ProjectDataService(entities); }
public ProjectMasterViewModel() { _dataService = new ProjectDataService(DependencyService.Get <ISQLite>().GetConnection()); _dataService.Select(); this.projectList = new ProjectListViewModel(_dataService); }
public ProjectListByUserViewModel() { _dataService = new ProjectDataService(DependencyService.Get <ISQLite>().GetConnection()); projectUser = new ObservableCollection <Project>(_dataService.SelectByUser(GlobalSettings.currentUserId)); }
public ProjectListViewModel() { _dataService = new ProjectDataService(DependencyService.Get <ISQLite>().GetConnection()); Entities = new ObservableCollection <Project>(_dataService.Select()); }
public async void PostProject() { await ProjectDataService.AddProjectAsync(Project); NavigationManager.NavigateTo("/"); }
public ProjectRegisterViewModel() { _dataService = new ProjectDataService(DependencyService.Get <ISQLite>().GetConnection()); SetVisibility(CurrentProject.ProjectId == 0); }
public ProjectsController() { ProjectDataService = new ProjectDataService(); }
private void SaveRateData() { // Dependency traz uma implementação de SQLite trazendo a conexão. _dataService = new ProjectDataService(DependencyService.Get <ISQLite>().GetConnection()); }