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(); } }
private void DoContractAccountGet(WizardNavigationEventArgs e) { try { Contract contract = StorehouseHelper.GetCustomerContract(WSP.PanelSecurity.SelectedUserId); ctlUserAccount.ContractId = contract.ContractId; } catch (Exception ex) { ShowErrorMessage("GET_CUSTOMER_CONTRACT", ex); } }
private bool DoContractAccountGet(WizardNavigationEventArgs e) { try { Contract contract = StorehouseHelper.GetCustomerContract(PanelSecurity.SelectedUserId); if (contract != null) { ctlCustomerCreate.ContractId = contract.ContractId; return(true); } } catch (Exception ex) { ShowErrorMessage("GET_CUSTOMER_CONTRACT", ex); } // No contract has been found return(false); }
private object GetCustomerContract() { return(StorehouseHelper.GetCustomerContract(PanelSecurity.SelectedUserId)); }