Exemplo n.º 1
0
        /// <summary>BuildCustomerAccountBase - Populates many customerAccountProfile fields</summary>
        /// <param name="customerAccountDT">Customer Account Data Table</param>
        /// <param name="customerAccountProfile">Customer account profile object</param>
        /// <returns><void></returns>
        private void BuildCustomerAccountBase(CustomerAccountProfileSchema.CustomerAccountDataTable customerAccountDT, CustomerAccountProfile customerAccountProfile)
        {
            customerAccountProfile.AccountNumber9 = customerAccountDT[0].Account_Number;
            customerAccountProfile.AccountStatus  = (AccountStatus)TypeDescriptor.GetConverter(customerAccountProfile.AccountStatus).ConvertFrom(customerAccountDT[0].Customer_Status_Code);
            customerAccountProfile.CompanyNumber  = customerAccountDT[0].Company_Number;
            if (customerAccountDT[0].Disconnect_Date != string.Empty)
            {
                customerAccountProfile.CustomerDisconnectDate = new Icoms1900Date(customerAccountDT[0].Disconnect_Date);
            }
            if (customerAccountDT[0].Connect_Date != string.Empty)
            {
                customerAccountProfile.CustomerEstablishedDate = new Icoms1900Date(customerAccountDT[0].Connect_Date);
            }
            customerAccountProfile.DivisionNumber      = customerAccountDT[0].Division_Number;
            customerAccountProfile.FirstName           = customerAccountDT[0].First_Name;
            customerAccountProfile.FranchiseNumber     = customerAccountDT[0].Franchise_Number;
            customerAccountProfile.HouseNumber         = customerAccountDT[0].House_Number;
            customerAccountProfile.LanguagePreference  = customerAccountDT[0].Language_Code;
            customerAccountProfile.LastName            = customerAccountDT[0].Last_Name;
            customerAccountProfile.MiddleInitial       = customerAccountDT[0].Middle_Initial;
            customerAccountProfile.ResidentNumber      = customerAccountDT[0].House_Resident_Number;
            customerAccountProfile.ServiceAddressLine1 = customerAccountDT[0].Address_Line_1;
            customerAccountProfile.ServiceAddressLine2 = customerAccountDT[0].Address_Line_2;
            customerAccountProfile.ServiceAddressLine3 = customerAccountDT[0].Address_Line_3;
            customerAccountProfile.ServiceAddressLine4 = customerAccountDT[0].Address_Line_4;
            customerAccountProfile.SiteId    = customerAccountDT[0].Site_Id;
            customerAccountProfile.Title     = customerAccountDT[0].Title;
            customerAccountProfile.ZipCode4  = customerAccountDT[0].ADDR_ZIP_4;
            customerAccountProfile.ZipCode5  = customerAccountDT[0].ADDR_ZIP_5;
            customerAccountProfile.City      = customerAccountDT[0].ADDR_CITY;
            customerAccountProfile.State     = customerAccountDT[0].ADDR_STATE;
            customerAccountProfile.Building  = customerAccountDT[0].Building;
            customerAccountProfile.Apartment = customerAccountDT[0].Apartment;
            customerAccountProfile.CommercialBusinessName = customerAccountDT[0].Customer_Business_Name;
            customerAccountProfile.DwellingType           = (DwellingType)TypeDescriptor.GetConverter(customerAccountProfile.DwellingType).ConvertFrom(customerAccountDT[0].Dwelling_Type);
            customerAccountProfile.BillType     = (BillType)TypeDescriptor.GetConverter(customerAccountProfile.BillType).ConvertFrom(customerAccountDT[0].Bill_Type_Code);
            customerAccountProfile.CustomerType = (CustomerType)TypeDescriptor.GetConverter(customerAccountProfile.CustomerType).ConvertFrom(customerAccountDT[0].Customer_Type_Code);
            if (customerAccountDT[0].Date_Of_Birth != string.Empty)
            {
                customerAccountProfile.DateOfBirth = new Icoms1900Date(customerAccountDT[0].Date_Of_Birth);
            }
            customerAccountProfile.DriversLicenseNumber  = customerAccountDT[0].Drivers_License_Number;
            customerAccountProfile.SocialSecurityNumber  = customerAccountDT[0].Social_Security_Nbr;
            customerAccountProfile.PinNumber             = customerAccountDT[0].Pin_Number;
            customerAccountProfile.CustomerComment       = customerAccountDT[0].Customer_Comment;
            customerAccountProfile.DoNotAcceptCheck      = customerAccountDT[0].DoNotAcceptCheck;
            customerAccountProfile.DoNotAcceptCreditCard = customerAccountDT[0].DoNotAcceptCreditCards;
            customerAccountProfile.HsiAbuse = customerAccountDT[0].CHSI_Abuse_Flag;
            customerAccountProfile.VIPCode  = (VIPCode)TypeDescriptor.GetConverter(customerAccountProfile.VIPCode).ConvertFrom(customerAccountDT[0].VIP_Code);
            customerAccountProfile.CustomerValueSegmentation = customerAccountDT[0].Cust_Value_Segmentation;

            //[30-10-2009] Start Changes for including Customer History Data

            customerAccountProfile.CoxUniqueID          = customerAccountDT[0].Cox_Unique_ID;
            customerAccountProfile.ContractEligibleFlag = customerAccountDT[0].Contract;
            customerAccountProfile.TotalTenureInMonths  = customerAccountDT[0].Tenure_Number_Of_Months;

            //[30-10-2009] Start Changes for including Customer History Data

            customerAccountProfile.ActiveTru2WayDevices = customerAccountDT[0].NumberOfTru2WayActive;

            //customerAccountProfile.OnlineOrderBlock = customerAccountDT[0].OnlineOrderBlock;
            //if (customerAccountDT[0]. .OnlineOrderBlock != 0)
            //{
            //    customerAccountProfile.OnlineOrderBlock = true;
            //}
            //else
            //{
            //    customerAccountProfile.OnlineOrderBlock = false;
            //}
        }
Exemplo n.º 2
0
        //Added new method on 4-Feb-2010
        /// <summary>
        /// GetCustomerAccountProfile
        /// </summary>
        /// <param name="siteId"></param>
        /// <param name="accountNumber9"></param>
        /// <returns></returns>
        private CustomerAccountProfile GetCustomerAccountProfile(int siteId, string accountNumber9)
        {
            /// set the siteid/sitecode information
            PopulateSiteInfo(siteId);
            DalAccount dalAccount = new DalAccount();

            if (!dalAccount.IsAccountNumberValid(siteId, accountNumber9))
            {
                throw new Cox.BusinessLogic.Exceptions.InvalidAccountNumberException();
            }
            CompanyDivisionFranchise cdf = new CompanyDivisionFranchise();

            try
            {
                cdf = dalAccount.GetCompanyDivisionFranchise(_siteId,
                                                             _siteCode, accountNumber9);
            }
            catch (Exception e)
            {
                throw new DataSourceUnavailableException(e);
            }

            // convert to customerAccountNumber object
            CustomerAccountNumber accountNumber = new CustomerAccountNumber(
                string.Empty, cdf.Company.ToString(), cdf.Division.ToString(),
                accountNumber9);
            DalCustomerAccount dalCustomerAccount = new DalCustomerAccount();

            // call dal

            //[28-01-2009] Start Changes to reflect services for an account
            CustomerAccountProfileSchema customerAccountSchema = dalCustomerAccount.GetAccountProfile(siteId, accountNumber9);

            CustomerAccountProfileSchema.CustomerAccountDataTable customerAccountDT = customerAccountSchema.CustomerAccount;


            CustomerAccountProfileSchema.CustomerServicesDataTable customerServicesDataTable = customerAccountSchema.CustomerServices;

            CustomerAccountProfile customerAccountProfile = new CustomerAccountProfile();

            if (customerAccountDT != null && customerAccountDT.Rows.Count > 0)
            {
                BuildCustomerAccountBase(customerAccountDT, customerAccountProfile);
                BuildCustomerAccountCampaign(siteId, accountNumber9, dalCustomerAccount, customerAccountProfile);
                BuildCustomerAccountStatement(accountNumber9, accountNumber, customerAccountProfile);
                BuildCustomerAccountContract(siteId, accountNumber9, dalCustomerAccount, customerAccountProfile);
                BuildCustomerAccountPhones(siteId, accountNumber9, dalCustomerAccount, customerAccountProfile);
                BuildCustomerAccountPrivacy(siteId, accountNumber9, dalCustomerAccount, customerAccountProfile);
                BuildCustomerAccountCCRMInfo(siteId, accountNumber9, customerAccountProfile);
                BuildContactEmail(siteId, accountNumber9, dalCustomerAccount, customerAccountProfile);

                // [17-05-11] Changes starts here for price lock enhancement
                BuildPriceLockDetails(siteId, accountNumber9, dalCustomerAccount, customerAccountProfile);
                // [17-05-11] Changes ends here for price lock enhancement
            }

            if (customerServicesDataTable != null && customerServicesDataTable.Rows.Count > 0)
            {
                List <AvailableService> services = new List <AvailableService>();

                foreach (CustomerAccountProfileSchema.CustomerServicesRow row in customerServicesDataTable.Rows)
                {
                    services.Add(new AvailableService(DalServiceCategory.Instance.GetServiceCategoryDesc(row.Service_Category_Code), (ServiceStatus)TypeDescriptor.GetConverter(typeof(ServiceStatus)).ConvertFrom(row.ServiceStatus)));
                }
                customerAccountProfile.Services = services;
            }

            //[28-01-2009] End Changes to reflect services for an account

            // Changes for Self Reg Ernest Griffin **START**//
            //Account account = new Account();

            //AccountActivity accountActivity = new AccountActivity(_userName);
            //account = accountActivity.InquireAccount(accountNumber9, siteId);

            //if (account.AllowOnlineOrdering)
            //{
            //    customerAccountProfile.OnlineOrderDelinquentBalance = false;
            //}
            //else
            //{
            //    customerAccountProfile.OnlineOrderDelinquentBalance = true;
            //}

            //if (account.OnlineOrderingOptOut != 0)
            //{
            //    customerAccountProfile.OnlineOrderBlock = true;
            //}
            //else
            //{
            //    customerAccountProfile.OnlineOrderBlock = false;
            //}
            return(customerAccountProfile);
        }