Esempio n. 1
0
        protected override async Task OnInitializedAsync()
        {
            Project = await ProjectDataService.GetProjectAsync(ProjectID);

            Title          = Project.Title;
            Requirement    = Project.Requirement;
            Design         = Project.Design;
            CompletionDate = Project.CompletionDate;
        }
Esempio n. 2
0
        protected override async Task OnInitializedAsync()
        {
            ProjectViewModel = await ProjectDataService.GetProjectAsync(ProjectSlug);



            Title          = ProjectViewModel.Title;
            Requirement    = ProjectViewModel.Requirement;
            Design         = ProjectViewModel.Design;
            CompletionDate = ProjectViewModel.CompletionDate;
        }
Esempio n. 3
0
    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);
    }
Esempio n. 4
0
        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}");
        }
Esempio n. 5
0
 public ReleaseRetentionService(
     EnvironmentDataService environmentDataService,
     ProjectDataService projectDataService,
     ReleaseDataService releaseDataService,
     DeploymentDataService deploymentDataService,
     ILogger <ReleaseRetentionService> logger)
 {
     _environmentDataService = environmentDataService;
     _projectDataService     = projectDataService;
     _releaseDataService     = releaseDataService;
     _deploymentDataService  = deploymentDataService;
     _logger = logger;
 }
Esempio n. 6
0
        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);
        }
Esempio n. 8
0
        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);
                    }
                }
            }
        }
Esempio n. 9
0
        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);
        }
Esempio n. 10
0
        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);
            }
        }
Esempio n. 12
0
        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));
 }
Esempio n. 16
0
 public ProjectListViewModel()
 {
     _dataService = new ProjectDataService(DependencyService.Get <ISQLite>().GetConnection());
     Entities     = new ObservableCollection <Project>(_dataService.Select());
 }
Esempio n. 17
0
        public async void PostProject()
        {
            await ProjectDataService.AddProjectAsync(Project);

            NavigationManager.NavigateTo("/");
        }
Esempio n. 18
0
 public ProjectRegisterViewModel()
 {
     _dataService = new ProjectDataService(DependencyService.Get <ISQLite>().GetConnection());
     SetVisibility(CurrentProject.ProjectId == 0);
 }
 public ProjectsController()
 {
     ProjectDataService = new ProjectDataService();
 }
Esempio n. 20
0
 private void SaveRateData()
 {
     // Dependency traz uma implementação de SQLite trazendo a conexão.
     _dataService = new ProjectDataService(DependencyService.Get <ISQLite>().GetConnection());
 }