Example #1
0
        /// <summary>
        /// Creates the company registration view.
        /// </summary>
        /// <param name="companyCollection">The company collection.</param>
        /// <param name="industryCollection"></param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">
        /// companyCollection
        /// or
        /// industryCollection
        /// </exception>
        public ICompanyRegistrationView CreateCompanyRegistrationView(IList <ICompanyDetail> companyCollection, IList <IIndustry> industryCollection, IList <ICountry> countryCollection)
        {
            if (companyCollection == null)
            {
                throw new ArgumentNullException(nameof(companyCollection));
            }

            if (industryCollection == null)
            {
                throw new ArgumentNullException(nameof(industryCollection));
            }

            if (countryCollection == null)
            {
                throw new ArgumentNullException(nameof(countryCollection));
            }

            // get parentcompany  drop down list
            var parentCompanytDDL = GetDropDownList.CompanyListItems(companyCollection, -1);

            var industryDDl = GetDropDownList.IIndsutryListItems(industryCollection, -1);

            var countryDDL = GetDropDownList.CountryListItem(countryCollection, 161);

            var model = new CompanyRegistrationView()
            {
                IndustryDropDownList      = industryDDl,
                ParentCompanyDropDownList = parentCompanytDDL,
                CountryDropDownList       = countryDDL,
                CompanyCountryId          = 161
            };

            return(model);
        }
Example #2
0
        /// <summary>
        /// Creates the company registration view.
        /// </summary>
        /// <param name="companyInfo">The company information.</param>
        /// <param name="companyCollection">The company collection.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">companyCollection</exception>
        public ICompanyRegistrationView CreateCompanyRegistrationView(ICompanyDetail companyInfo,
                                                                      IList <ICompanyDetail> companyCollection, IList <IIndustry> industryCollection, IList <ICountry> countryCollection)
        {
            if (companyCollection == null)
            {
                throw new ArgumentNullException(nameof(companyCollection));
            }

            if (industryCollection == null)
            {
                throw new ArgumentNullException(nameof(industryCollection));
            }

            // get parentcompany  drop down list
            var parentCompanytDDL =
                GetDropDownList.CompanyListItems(companyCollection, companyInfo.ParentCompanyId ?? -1);

            var industryDDL =
                GetDropDownList.IIndsutryListItems(industryCollection, companyInfo.IndustryId);

            var countryDDL =
                GetDropDownList.CountryListItem(countryCollection, 161);

            var model = new CompanyRegistrationView()
            {
                ParentCompanyDropDownList = parentCompanytDDL,
                CountryDropDownList       = countryDDL,
                ProcessingMessage         = string.Empty,
                CompanyCountry            = companyInfo.CompanyCountry,
                CACRegistrationNumber     = companyInfo.CACRegistrationNumber,
                CompanyAddressLine1       = companyInfo.CompanyAddressLine1,
                CompanyAddressLine2       = companyInfo.CompanyAddressLine2,
                CompanyCity          = companyInfo.CompanyCity,
                CompanyCountryId     = 161,
                CompanyEmail         = companyInfo.CompanyEmail,
                CompanyId            = companyInfo.CompanyId,
                CompanyName          = companyInfo.CompanyName,
                CompanyPhone         = companyInfo.CompanyPhone,
                CompanyState         = companyInfo.CompanyState,
                CompanyWebsite       = companyInfo.CompanyWebsite,
                CompanyZipCode       = companyInfo.CompanyZipCode,
                DateCreated          = companyInfo.DateCreated,
                ParentCompanyId      = companyInfo.ParentCompanyId,
                LogoDigitalFileId    = companyInfo.LogoDigitalFileId,
                CompanyAlias         = companyInfo.CompanyAlias,
                IsActive             = companyInfo.IsActive,
                IndustryDropDownList = industryDDL,
                IndustryId           = companyInfo.IndustryId,
                CompanyLogo          = companyInfo.CompanyLogo
            };

            return(model);
        }
Example #3
0
        /// <summary>
        /// Creates the company registration view.
        /// </summary>
        /// <param name="companyInfo">The company information.</param>
        /// <param name="companyCollection">The company collection.</param>
        /// <param name="industryCollection"></param>
        /// <param name="processingMessage">The processing message.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">
        /// companyInfo
        /// or
        /// companyCollection
        /// or
        /// industryCollection
        /// </exception>
        public ICompanyRegistrationView CreateCompanyRegistrationView(ICompanyRegistrationView companyInfo,
                                                                      IList <ICompanyDetail> companyCollection, IList <IIndustry> industryCollection, IList <ICountry> countryCollection,
                                                                      string processingMessage)
        {
            if (companyInfo == null)
            {
                throw new ArgumentNullException(nameof(companyInfo));
            }

            if (companyCollection == null)
            {
                throw new ArgumentNullException(nameof(companyCollection));
            }

            if (industryCollection == null)
            {
                throw new ArgumentNullException(nameof(industryCollection));
            }

            // get parentcompany  drop down list
            var parentCompanytDDL =
                GetDropDownList.CompanyListItems(companyCollection, companyInfo.ParentCompanyId ?? -1);

            var industryDDL =
                GetDropDownList.IIndsutryListItems(industryCollection, companyInfo.IndustryId);

            var countryDDL =
                GetDropDownList.CountryListItem(countryCollection, companyInfo.CompanyCountryId);

            var viewModel = companyInfo;

            viewModel.ParentCompanyDropDownList = parentCompanytDDL;
            viewModel.IndustryDropDownList      = industryDDL;
            viewModel.CountryDropDownList       = countryDDL;
            viewModel.ProcessingMessage         = processingMessage;

            return(viewModel);
        }