Example #1
0
        public ActionResult EditCompanyDetails()
        {
            var company = _companyDetailsService.GetCompany();
            var companyDetailsViewModel = new CompanyDetailsViewModel
            {
                Id                   = company.Id,
                Name                 = company.Name,
                Address1             = !String.IsNullOrEmpty(company.Address1) ? company.Address1 : String.Empty,
                Address2             = !String.IsNullOrEmpty(company.Address2) ? company.Address2 : String.Empty,
                Address3             = !String.IsNullOrEmpty(company.Address3) ? company.Address3 : String.Empty,
                Address4             = !String.IsNullOrEmpty(company.Address4) ? company.Address4 : String.Empty,
                Address5             = !String.IsNullOrEmpty(company.Address5) ? company.Address5 : String.Empty,
                Telephone            = company.Telephone,
                Fax                  = company.Fax,
                Email                = company.Email,
                Www                  = company.Www,
                TermsAndConditions   = company.TermsAndConditions,
                QuoteSummaryText     = company.QuoteSummaryText,
                OrderAcknowledgeText = company.OrderAcknowledgeText,
                RegNo                = !String.IsNullOrEmpty(company.RegNo) ? company.RegNo : String.Empty,
                VatRegNo             = !String.IsNullOrEmpty(company.VatRegNo) ? company.VatRegNo : String.Empty,
                CurrencyId           = company.DefaultCurrency.Id,
                PaymentTermId        = company.DefaultPaymentTerm.Id,
                BankDetailsId        = company.DefaultBankDetails.Id,
                TaxCodeId            = company.DefaultTaxCode.Id,
                CultureId            = company.DefaultCultureCode,
                Currencies           = _currencyService.GetCurrencies().ToSelectList(),
                PaymentTerms         = _listItemService.GetAllByCategory(ListItemCategoryType.PaymentTerm).ToSelectList(),
                TaxCodes             = _companyDetailsService.GetTaxCodes().Select(t => new { Id = t.Id, Name = t.TaxCodeName }).ToSelectList(),
                BankDetails          = _companyDetailsService.GetBankDetails().Select(t => new { Id = t.Id, Name = t.ShortName }).ToSelectList(),
                Cultures             = _companyDetailsService.GetSupportedCultures().Select(c => new { Id = c.Key, Name = c.Value }).ToSelectList()
            };

            return(View("CompanyDetails", companyDetailsViewModel));
        }
Example #2
0
        public ActionResult CreateIndividualOrder()
        {
            var viewModel = new OrderCreateViewModel
            {
                JobItemId   = Guid.Empty,
                CurrencyId  = _companyDetailsService.GetCompany().DefaultCurrency.Id,
                Currencies  = _currencyService.GetCurrencies().ToSelectList(),
                Description = "placeholder", // This is needed because this value is required by another view that uses the same model.
                Quantity    = 1              // Likewise.
            };

            return(View(viewModel));
        }
        protected override async Task OnInitializedAsync()
        {
            try
            {
                CompanyDetailsModel = await CompanyDetailsService.GetCompany(Id);
            }
            catch (Exception ex)
            {
                CompanyDetailsModel.IsError = true;

                CompanyDetailsModel.ErrorMessage = ex.Message;
            }
        }
Example #4
0
        public ActionResult Create(Guid jobItemId, Guid jobId)
        {
            var job                   = _jobService.GetJob(jobId);
            var company               = _companyDetailsService.GetCompany();
            var jobItem               = _jobItemService.GetById(jobItemId);
            var workTypeListItemId    = _listItemService.GetByType(ListItemType.WorkTypeInvestigation).Id;
            var investigationWorkItem = jobItem.HistoryItems.Where(i => i.WorkType.Id == workTypeListItemId).FirstOrDefault();
            var viewmodel             = new QuoteCreateViewModel()
            {
                JobItemId  = jobItemId,
                JobId      = jobId,
                OrderNo    = job.OrderNo,
                AdviceNo   = job.AdviceNo,
                Currencies = _currencyService.GetCurrencies().ToSelectList(),
                CurrencyId = company.DefaultCurrency.Id,
                Report     = investigationWorkItem != null ? investigationWorkItem.Report : String.Empty
            };

            return(View("Create", viewmodel));
        }