Ejemplo n.º 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));
        }
Ejemplo n.º 2
0
        public ActionResult Index()
        {
            var banks      = _companyDetailsService.GetBankDetails();
            var viewmodels = new List <BankDetailsIndexViewModel>();

            foreach (var bank in banks)
            {
                viewmodels.Add(new BankDetailsIndexViewModel()
                {
                    AccountNo = bank.AccountNo,
                    Address1  = bank.Address1,
                    Address2  = bank.Address2,
                    Address3  = bank.Address3,
                    Address4  = bank.Address4,
                    Address5  = bank.Address5,
                    Iban      = bank.Iban,
                    Id        = bank.Id,
                    Name      = bank.Name,
                    ShortName = bank.ShortName,
                    SortCode  = bank.SortCode
                });
            }
            return(View(viewmodels));
        }