public void UpdatePageData(OrderConfirmationData orderConfirmationData) { if (orderConfirmationData.UserType != EnUserType.RegisteredUser) { orderConfirmationData.ShippingContact.Address = SettingsOrderConfirmation.IsShowAddress ? HttpUtility.HtmlEncode(txtAddress.Text) : string.Empty; orderConfirmationData.ShippingContact.Zip = SettingsOrderConfirmation.IsShowZip ? HttpUtility.HtmlEncode(txtZip.Text) : string.Empty; orderConfirmationData.ShippingContact.CustomField1 = SettingsOrderConfirmation.IsShowCustomShippingField1 ? HttpUtility.HtmlEncode(txtShippingField1.Text) : string.Empty; orderConfirmationData.ShippingContact.CustomField2 = SettingsOrderConfirmation.IsShowCustomShippingField2 ? HttpUtility.HtmlEncode(txtShippingField2.Text) : string.Empty; orderConfirmationData.ShippingContact.CustomField3 = SettingsOrderConfirmation.IsShowCustomShippingField3 ? HttpUtility.HtmlEncode(txtShippingField3.Text) : string.Empty; } }
public void UpdatePageData(OrderConfirmationData orderConfirmationData) { if (orderConfirmationData.UserType == EnUserType.RegisteredUserWithoutAddress) { orderConfirmationData.Customer.EMail = CustomerContext.CurrentCustomer.EMail.Contains("@temp") ? HttpUtility.HtmlEncode(txtRegEmail.Text) : CustomerContext.CurrentCustomer.EMail; orderConfirmationData.Customer.FirstName = HttpUtility.HtmlEncode(txtRegFirstName.Text); orderConfirmationData.Customer.LastName = HttpUtility.HtmlEncode(txtRegLastName.Text); orderConfirmationData.Customer.Patronymic = HttpUtility.HtmlEncode(txtRegPatronymic.Text); orderConfirmationData.Customer.Phone = HttpUtility.HtmlEncode(txtRegPhone.Text); } if (orderConfirmationData.UserType == EnUserType.NoUser || orderConfirmationData.UserType == EnUserType.NewUserWithOutRegistration || orderConfirmationData.UserType == EnUserType.JustRegistredUser) { orderConfirmationData.Customer.EMail = HttpUtility.HtmlEncode(txtEmail.Text); orderConfirmationData.Customer.FirstName = HttpUtility.HtmlEncode(txtFirstName.Text); orderConfirmationData.Customer.LastName = HttpUtility.HtmlEncode(txtLastName.Text); orderConfirmationData.Customer.Patronymic = HttpUtility.HtmlEncode(txtPatronymic.Text); orderConfirmationData.Customer.Phone = HttpUtility.HtmlEncode(txtPhone.Text); orderConfirmationData.BillingContact.Name = orderConfirmationData.Customer.FirstName + (orderConfirmationData.Customer.Patronymic.IsNotEmpty() ? " " + orderConfirmationData.Customer.Patronymic : "") + (orderConfirmationData.Customer.LastName.IsNotEmpty() ? " " + orderConfirmationData.Customer.LastName : ""); if (chknewcustomer.Checked) { orderConfirmationData.Customer.Password = txtNewPassword.Text.Trim(); orderConfirmationData.UserType = EnUserType.JustRegistredUser; } } }
private bool ValidateLogin(OrderConfirmationData orderConfirmationData) { var boolIsValidPast = true; if (orderConfirmationData.UserType != EnUserType.RegisteredUser) { txtEmail.Text = txtEmail.Text.Trim(); if (txtEmail.Text.IsNullOrEmpty() || !ValidationHelper.IsValidEmail(txtEmail.Text)) { boolIsValidPast = false; ((AdvantShopClientPage)Page).ShowMessage(Notify.NotifyType.Error, Resource.Client_OrderConfirmation_EnterValidEmail); } } if (orderConfirmationData.UserType == EnUserType.JustRegistredUser) { txtNewPassword.Text = txtNewPassword.Text.Trim(); if (txtNewPassword.Text.IsNullOrEmpty() || txtNewPassword.Text.Length < 6) { ((AdvantShopClientPage)Page).ShowMessage(Notify.NotifyType.Error, Resource.Client_Registration_PasswordLenght); boolIsValidPast = false; } } return(boolIsValidPast); }
public bool IsValidData(OrderConfirmationData orderConfirmationData) { if (orderConfirmationData == null) { return(false); } if (orderConfirmationData.UserType == EnUserType.RegisteredUser) { return(orderConfirmationData.ShippingContact != null); } if (orderConfirmationData.UserType == EnUserType.RegisteredUserWithoutAddress) { return(ValidateRegUserData()); } var isValid = ValidateLogin(orderConfirmationData) && ValidateUserData() && ValidateShipping(); if (!isValid) { ((AdvantShopClientPage)Page).ShowMessage(Notify.NotifyType.Error, Resource.Client_OrderConfirmation_EnterEmptyField); } return(isValid); }
public void UpdatePageData(OrderConfirmationData orderConfirmationData) { switch (orderConfirmationData.SelectedPaymentItem.Type) { case PaymentType.Bill: orderConfirmationData.PaymentDetails = new PaymentDetails { CompanyName = txtCompanyName.Text, INN = txtINN.Text }; break; case PaymentType.SberBank: orderConfirmationData.PaymentDetails = new PaymentDetails { CompanyName = String.Empty, INN = txtINN2.Text }; break; case PaymentType.QIWI: orderConfirmationData.PaymentDetails = new PaymentDetails { Phone = txtPhone.Text }; break; default: orderConfirmationData.PaymentDetails = null; break; } }
public bool IsValidData(OrderConfirmationData orderConfirmationData) { var shippingItem = orderConfirmationData.SelectedShippingItem; if (shippingItem.Ext != null && shippingItem.Ext.Type == ExtendedType.Pickpoint && (shippingItem.Ext.PickpointAddress.IsNullOrEmpty() && shippingItem.Type != ShippingType.Cdek)) { ((AdvantShopClientPage)Page).ShowMessage(Notify.NotifyType.Error, Resource.ShippingRates_ChoosePickPoint); return(false); } if ((shippingItem.Type == ShippingType.ShippingByOrderPrice || shippingItem.Type == ShippingType.FixedRate) && (String.IsNullOrEmpty(orderConfirmationData.ShippingContact.Address) || String.IsNullOrEmpty(orderConfirmationData.ShippingContact.Zip) || orderConfirmationData.ShippingContact.Zip.Length != 6)) { ((AdvantShopClientPage)Page).ShowMessage(Notify.NotifyType.Error, Resource.ShippingRates_NeedAddress); return(false); } return(true); }
public void UpdatePageData(OrderConfirmationData orderConfirmationData) { orderConfirmationData.CustomerComment = HttpUtility.HtmlEncode(txtComments.Text); }