public void saveCallBack() { billing = settings.billingInfo; credit = settings.ccInfo; colorRelevant = settings.colorRelevant; sizeRelevant = settings.sizeRelevant; color = settings.color; size = settings.size; keywords = settings.keywords; category = settings.category; btnOrder.Enabled = true; }
private void btnSave_Click(object sender, EventArgs e) { if (txtAddressOne.Text.Length > 0 && txtAddressOne.Text.Length > 0 && txtZipCode.Text.Length > 0 && txtCity.Text.Length > 0 && comboCountry.Text != "" && txtTelephone.Text.Length > 0 && txtEmail.Text.Length > 0 && comboCcType.Text != "" && comboCategory.Text != "" && txtCcNumber.Text.Length > 1 && txtMonth.Text.Length == 2 && txtCVV2.Text.Length > 0 && lstKeywords.Items.Count > 0) { billingInfo.FullName = txtFullName.Text; billingInfo.Address_1 = txtAddressOne.Text; billingInfo.Address_2 = txtAddressTwo.Text; billingInfo.Address_3 = txtAddressThree.Text; billingInfo.ZipCode = txtZipCode.Text; billingInfo.City = txtCity.Text; billingInfo.Country = new Selector.Country(new Regex("(.+) \\((.+?)\\)").Match(comboCountry.SelectedItem.ToString()).Groups[2].Value); billingInfo.Telephone = txtTelephone.Text; billingInfo.Email = txtEmail.Text; switch (comboCcType.Text) { case "VISA": ccInfo.Type = Selector.CreditcardType.VISA; break; case "MasterCard": ccInfo.Type = Selector.CreditcardType.MasterCard; break; case "American Express": ccInfo.Type = Selector.CreditcardType.American_Express; break; } ccInfo.Number = txtCcNumber.Text; ccInfo.Month = txtMonth.Text; ccInfo.Year = nmrcYear.Value.ToString(); ccInfo.CVV2 = txtCVV2.Text; colorRelevant = chckColor.Checked; color = txtColor.Text; category = new Selector.Category(comboCategory.Text); sizeRelevant = chckSize.Checked; size = txtSize.Text; keywords = new string[lstKeywords.Items.Count]; for (int i = 0; i < keywords.Length; i++) { keywords[i] = lstKeywords.Items[i].ToString(); } _mFrm.saveCallBack(); this.Hide(); } else { MessageBox.Show("Some of the information you entered is not correct.", "Validation failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } }