Beispiel #1
0
        //private void cbDiffBilling_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (cbDiffBilling.Checked)
        //    {
        //        grbBilling.Enabled = true;

        //        txtStreetAddress.Text ="";

        //        txtCity.Text ="";

        //        txtZipcode.Text ="";

        //        cbState.Enabled = true;

        //    }
        //    else
        //    {


        //        txtStreetAddress.Text = GlobalVar.CurrentDealer.StreetAddress;

        //        txtCity.Text = GlobalVar.CurrentDealer.City;

        //        txtZipcode.Text = GlobalVar.CurrentDealer.ZipCode;

        //        int zipcode = 0;
        //        Int32.TryParse(GlobalVar.CurrentDealer.ZipCode, out zipcode);

        //        ZipCodeCity findResult = ZipCodeHelper.LookUpZipCode(zipcode);

        //        if (!String.IsNullOrEmpty(findResult.City))
        //        {
        //            txtCity.Text = findResult.City;

        //            cbState.SelectedIndex = _allStatesList.ToList().FindIndex(x => x.State == findResult.State);

        //        }

        //        grbBilling.Enabled = false;
        //    }
        //}

        private void CreditCardAuthorizeForm_Load(object sender, EventArgs e)
        {
            cbExpireMonths.DataSource = QuickBookHelper.GetExpirationMonths();

            cbExpireYear.DataSource = QuickBookHelper.GetExpirationYears();

            cbPackages.DataSource = QuickBookHelper.GetAllPackages();

            _allStatesList = ZipCodeHelper.GetAllStates();

            cbState.DataSource = _allStatesList;

            txtNameOnCard.Text = GlobalVar.CurrentAccount.FirstName + " " + GlobalVar.CurrentAccount.LastName;

            txtStreetAddress.Text = GlobalVar.CurrentDealer.StreetAddress;

            txtCity.Text = GlobalVar.CurrentDealer.City;

            txtZipcode.Text = GlobalVar.CurrentDealer.ZipCode;

            int zipcode = 0;

            Int32.TryParse(GlobalVar.CurrentDealer.ZipCode, out zipcode);

            ZipCodeCity findResult = ZipCodeHelper.LookUpZipCode(zipcode);

            if (!String.IsNullOrEmpty(findResult.City))
            {
                txtCity.Text = findResult.City;

                cbState.SelectedIndex = _allStatesList.ToList().FindIndex(x => x.State == findResult.State);
            }
        }
        private void CraigslistCreditCardForm_Load(object sender, EventArgs e)
        {
            cbExpireMonths.DataSource = QuickBookHelper.GetExpirationMonths();

            cbExpireYear.DataSource = QuickBookHelper.GetExpirationYears();

            _allStatesList = ZipCodeHelper.GetAllStates();

            cbState.DataSource = _allStatesList;



            this.txtCardNumber.Text = Properties.Settings.Default.cardnumber;

            this.txtSecurityCode.Text = Properties.Settings.Default.securitycode;

            this.txtFirstName.Text = Properties.Settings.Default.cardfirstname;

            this.txtLastName.Text = Properties.Settings.Default.cardlastname;

            this.txtStreetAddress.Text = Properties.Settings.Default.cardaddress;

            this.txtCity.Text = Properties.Settings.Default.cardcity;

            this.txtZipcode.Text = Properties.Settings.Default.cardzipcode;

            this.txtContactName.Text = Properties.Settings.Default.cardcontactname;

            this.txtPhoneNumber.Text = Properties.Settings.Default.cardcontactphone;

            this.txtContactEmailAddress.Text = Properties.Settings.Default.cardcontactemail;

            cbState.SelectedIndex = _allStatesList.ToList().FindIndex(x => x.StateAbbr == Properties.Settings.Default.cardstate);

            foreach (ExpirationMonth cbi in cbExpireMonths.Items)
            {
                if (cbi.Month == Properties.Settings.Default.expirationmonth)
                {
                    cbExpireMonths.SelectedItem = cbi;
                    break;
                }
            }


            cbExpireYear.SelectedIndex = QuickBookHelper.GetExpirationYears().ToList().FindIndex(x => x == Properties.Settings.Default.expirationyear);
        }