HBM.Customers.SaveCustomerGroupData C# (CSharp) Method

SaveCustomerGroupData() private method

private SaveCustomerGroupData ( HBM.CustomerManagement currentCustomer ) : void
currentCustomer HBM.CustomerManagement
return void
        private void SaveCustomerGroupData(CustMan.Customer currentCustomer)
        {
            currentCustomer.CustomerName = txtGroupName.Value.ToString();

            currentCustomer.Car = null;
            currentCustomer.CarLicensePlate = null;

            currentCustomer.CCExpirationDate = CCExpiryDateGrp;
            currentCustomer.CCNameOnCard = txtNameOnCardGrp.Text.ToString();
            currentCustomer.CCNo = txtCCNoGrp.Text.ToString();
            currentCustomer.CardSecurityCode = txtCardSecurityCodeGrp.Text.ToString();

            if (dtStartDateGrp.Value == null)
            {
                currentCustomer.CardStartDate = null;
            }
            else
            {
                if (dtStartDateGrp.Value == null && dtStartDateGrp.Value.ToString() == string.Empty)
                {
                    currentCustomer.CardStartDate = null;
                }
                else
                {
                    currentCustomer.CardStartDate = Convert.ToDateTime(dtStartDateGrp.Value.ToString());
                }
            }

            currentCustomer.CardIssueNo = txtCardIssueNoGrp.Text.ToString();

            if (cmbCCTypeGrp.SelectedItem == null)
            {
                currentCustomer.CreditCardTypeId = null;
            }
            else
            {
                if (cmbCCTypeGrp.SelectedItem.Value != null && cmbCCTypeGrp.SelectedItem.Value.ToString() != string.Empty)
                {
                    currentCustomer.CreditCardTypeId = Convert.ToInt32(cmbCCTypeGrp.SelectedItem.Value.ToString());
                }
                else
                {
                    currentCustomer.CreditCardTypeId = null;
                }
            }

            currentCustomer.CompanyName = txtCompanyNameGrp.Text.ToString();
            currentCustomer.CompanyNotes = txtCompanyNotesGrp.Text.ToString();

            currentCustomer.UseSameBillingAddress = chkUseSameBillingAddressGrp.Checked == true ? true : false;

            if (chkUseSameBillingAddressGrp.Checked)
            {
                currentCustomer.CompanyAddressLine1 = string.Empty;
                currentCustomer.CompanyAddressLine2 = string.Empty;
                currentCustomer.CompanyCity = string.Empty;
                currentCustomer.CompanyCountryId = null;
                currentCustomer.CompanyState = string.Empty;
                currentCustomer.CompanyPostCode = string.Empty;
            }
            else
            {
                currentCustomer.CompanyAddressLine1 = txtCompanyAddressLine1Grp.Text.ToString();
                currentCustomer.CompanyAddressLine2 = txtCompanyAddressLine2Grp.Text.ToString();
                currentCustomer.CompanyCity = txtCompanyCityGrp.Text.Trim();

                if (cmbCompanyCountryGrp.Items == null || cmbCompanyCountryGrp.SelectedItem == null)
                {
                    currentCustomer.CompanyCountryId = null;
                }
                else
                {
                    if (cmbCompanyCountryGrp.SelectedItem.Value != null && cmbCompanyCountryGrp.SelectedItem.Value.ToString() != string.Empty)
                    {
                        currentCustomer.CompanyCountryId = Convert.ToInt32(cmbCompanyCountryGrp.SelectedItem.Value.ToString());
                    }
                    else
                    {
                        currentCustomer.CompanyCountryId = null;
                    }
                }

                currentCustomer.CompanyState = txtCompanyStateGrp.Text.ToString();
                currentCustomer.CompanyPostCode = txtCompanyPostCodeGrp.Text.ToString();
            }

            currentCustomer.BillingAddressLine1 = txtBillingAddressLine1Grp.Text.ToString();
            currentCustomer.BillingAddressLine2 = txtBillingAddressLine2Grp.Text.ToString();
            currentCustomer.BillingCity = txtBillingCityGrp.Text.ToString();
            currentCustomer.BillingState = txtBillingStateGrp.Text.ToString();

            if (cmbBillingCountryGrp.Items == null || cmbBillingCountryGrp.SelectedItem == null)
            {
                currentCustomer.BillingCountryId = null;
            }
            else
            {
                if (cmbBillingCountryGrp.SelectedItem.Value != null && cmbBillingCountryGrp.SelectedItem.Value.ToString() != string.Empty)
                {
                    currentCustomer.BillingCountryId = Convert.ToInt32(cmbBillingCountryGrp.SelectedItem.Value);
                }
                else
                {
                    currentCustomer.BillingCountryId = null;
                }
            }

            currentCustomer.BillingPostCode = txtBillingZipPostalCodeGrp.Text.ToString();

            currentCustomer.DriverLicense = null;
            currentCustomer.Email = txtEmailGrp.Text.ToString();
            currentCustomer.Fax = txtFaxGrp.Text.ToString();
            currentCustomer.Gender = "Male";
            currentCustomer.MemberCode = txtMemberCodeGrp.Text.ToString();
            currentCustomer.Mobile = txtPhoneGrp.Text.ToString();
            currentCustomer.GuestTypeId = (int)cmbGuestTypeGrp.SelectedItem.Value;
            currentCustomer.PassportCountryOfIssue = null;

            currentCustomer.Phone = txtPhoneGrp.Text.ToString();
            currentCustomer.CreatedUser = Master.LoggedUser.UsersId;
            currentCustomer.UpdatedUser = Master.LoggedUser.UsersId;
            currentCustomer.StatusId = (int)HBM.Common.Enums.HBMStatus.Active;
            currentCustomer.IsGroupCustomer = true;
            currentCustomer.DsGroupCustomers = (DataSet)Session[Constants.SESSION_GROUPCUSTOMERS];
        }