Exemplo n.º 1
0
        public CompanyManagementViewModel(Company company)
        {
            Info = new CompanyInfoViewModel(company);

            if (company.OwnerID.HasValue)
            {
                Founder = new SmallEntityAvatarViewModel(company.Owner);
            }

            foreach (var manager in company.CompanyManagers.ToList())
            {
                Managers.Add(new SmallEntityAvatarViewModel(manager.Entity));
            }
        }
Exemplo n.º 2
0
        public CompanyMarketOfferListViewModel(Entities.Company company, IQueryable <MarketOfferModel> marketOffers, PagingParam pagingParam,
                                               CompanyRights rights, IMarketService marketService)
        {
            Info          = new CompanyInfoViewModel(company);
            CompanyRights = rights;

            PagingParam = pagingParam;
            if (marketOffers.Count() > 0)
            {
                var filteredOffers = marketOffers.OrderByDescending(mo => mo.OfferID).Apply(PagingParam).ToList();

                foreach (var offer in filteredOffers)
                {
                    Offers.Add(new MarketOfferViewModel(SessionHelper.CurrentEntity, offer, marketService, deleteable: true, showDetails: true));
                }
            }
        }
Exemplo n.º 3
0
        public ViewCompanyViewModel(Company company, IProductRepository productRepository, ICompanyService companyService, CompanyRights companyRights, IRegionService regionService, IRegionRepository regionRepository)
        {
            IProductService productService = DependencyResolver.Current.GetService <IProductService>();

            Info              = new CompanyInfoViewModel(company);
            Quality           = company.Quality;
            Money             = MoneyViewModel.GetMoney(company.Entity.Wallet);
            ShowEmployeeStats = true;
            Queue             = (double)company.Queue;
            Rights            = companyRights;

            initializeEmployees(company, companyService);

            initializeRequiredProducts(company, productRepository, productService);

            initializeProducedStock(company, productRepository);

            if (Rights.HaveAnyRights)
            {
                Statistics = new CompanyStatisticsViewModel(company, companyService, regionService, regionRepository);
            }
        }
Exemplo n.º 4
0
 public CompanyEquipmentViewModel(Company company, Entities.Equipment equipment)
     : base(equipment)
 {
     Info = new CompanyInfoViewModel(company);
 }
Exemplo n.º 5
0
        public CompanyAddMarketOfferViewModel(Entities.Company company, List <int> embargoedCountries)
        {
            Info = new CompanyInfoViewModel(company);

            LoadSelectLists(embargoedCountries, company);
        }
Exemplo n.º 6
0
 public CompanyWalletViewModel(Company company, List <WalletMoney> money) : base(money)
 {
     Info = new CompanyInfoViewModel(company);
 }