protected void Page_Load(object sender, EventArgs e) { // Step #1: Disable "On Behalf Of" feature if that the case if (PanelSecurity.LoggedUserId != PanelSecurity.SelectedUserId) { DisablePageFunctionality(); ShowWarningMessage("WORK_ON_BEHALF_DISABLED"); return; } // Step #2: Create customer contract if necessary if (!StorehouseHelper.CheckCustomerContractExists()) { ContractAccount accountSettings = ecUtils.GetContractAccountFromUserInfo(PanelSecurity.SelectedUser); GenericResult result = StorefrontHelper.AddContract(PanelSecurity.SelectedUser.OwnerId, accountSettings); // Show error message if (!result.Succeed) { DisablePageFunctionality(); ShowResultMessage(result.GetProperty <int>("ResultCode")); return; } } // Step #3: Load customer contract myContract = StorehouseHelper.GetCustomerContract(PanelSecurity.SelectedUserId); // Step #4: Bind payment profile if (!IsPostBack) { BindPaymentProfile(); } }
protected void wzrdOrderHosting_FinishButtonClick(object sender, WizardNavigationEventArgs e) { if (!Page.IsValid) { return; } // 3. User accepted Terms and Conditions and wish to proceed to checkout if (wzrdOrderHosting.ActiveStep == Step4) { // Ensure the contract already exists if (Page.User.Identity.IsAuthenticated && StorehouseHelper.CheckCustomerContractExists()) { DoContractAccountGet(e); } else { DoContractAccountCreate(e); } // DoOrderSubmit(e); } }