private void SyncDomainExtensionFields(OrderItem domainItem)
		{
			// skip sync when user would like to update name servers only
			if (rbUpdateNs.Checked)
				return;
			//
			if (ddlTopLevelDoms.SelectedItem.Text == "us")
			{
				domainItem["NexusCategory"] = ddlNexusCategory.SelectedValue;
				domainItem["ApplicationPurpose"] = ddlAppPurpose.SelectedValue;
			}
			else if (ddlTopLevelDoms.SelectedItem.Text.EndsWith(".uk"))
			{
				domainItem["RegisteredFor"] = txtRegisteredFor.Text.Trim();
				domainItem["UK_LegalType"] = ddlUkLegalType.SelectedValue;
				domainItem["UK_CompanyIdNumber"] = txtCompanyIdNum.Text.Trim();
				domainItem["HideWhoisInfo"] = chkHideWhoisInfo.Checked ? "y" : "n";
			}
			else if (ddlTopLevelDoms.SelectedItem.Text.EndsWith("eu"))
			{
				domainItem["EU_WhoisPolicy"] = chkDtPolicyAgree.Checked ? "I Agree" : "";
				domainItem["EU_AgreeDelete"] = chkDelPolicyAgree.Checked ? "YES" : "";
				domainItem["EU_ADRLang"] = ddlEuAdrLang.SelectedValue;
			}
		}
Пример #2
0
		public static OrderResult SubmitCustomerOrder(string contractId, 
			OrderItem[] orderItems, KeyValueBunch extraArgs)
		{
			//
			return EC.Services.Storefront.SubmitCustomerOrder(contractId, orderItems, extraArgs);
		}
		public int AddServiceInfo(string contractId, string currency, OrderItem orderItem)
		{
			return EcommerceProvider.AddHostingPlanSvc(contractId, orderItem.ProductId, 
				orderItem.ItemName, orderItem.BillingCycle, currency);
		}
Пример #4
0
		public static OrderItem GetHostingPlanItem(int productId, string planName, int cycleId)
		{
			OrderItem plan = new OrderItem();
			plan.productId = productId;
			plan.billingCycle = cycleId;
			plan.itemName = planName;
			plan.recurring = true;
			plan.quantity = 1;
			plan.typeId = Product.HOSTING_PLAN;
			//
			return plan;
		}
Пример #5
0
 public OrderResult SubmitCustomerOrder(string contractId, OrderItem[] orderItems, KeyValueBunch extraArgs)
 {
     return StorefrontController.SubmitCustomerOrder(contractId, orderItems, extraArgs);
 }
Пример #6
0
		public static OrderItem GetTopLevelDomainItem(int productId, int cycleId, string itemName)
		{
			OrderItem item = new OrderItem();
			item.recurring = true;
			item.typeId = Product.TOP_LEVEL_DOMAIN;
			item.productId = productId;
			item.quantity = 1;
			item.billingCycle = cycleId;
			item.itemName = itemName;

			return item;
		}
Пример #7
0
		public static OrderItem GetHostingAddonItem(int productId, int cycleId, int quantity, string itemName)
		{
			OrderItem item = new OrderItem();
			item.billingCycle = cycleId;
			item.recurring = cycleId > 0;
			item.quantity = quantity;
			item.productId = productId;
			item.typeId = Product.HOSTING_ADDON;
			item.itemName = itemName;

			return item;
		}
Пример #8
0
		public int AddServiceInfo(string contractId, string currency, OrderItem orderItem)
		{
			string propertyNames = null;
			string propertyValues = null;
			// deserialize
			SecurityUtils.SerializeGenericProfile(ref propertyNames, ref propertyValues, orderItem);
			//
			return EcommerceProvider.AddDomainNameSvc(contractId, orderItem.ParentSvcId,
				orderItem.ProductId, orderItem.ItemName, orderItem.BillingCycle, currency, propertyNames, propertyValues);
		}
Пример #9
0
		public static OrderResult SubmitCustomerOrder(string contractId, OrderItem[] orderItems, KeyValueBunch extraArgs)
		{
            //
            Contract contract = ContractSystem.ContractController.GetContract(contractId);
            // Impersonate
            ContractSystem.ContractController.ImpersonateAsContractReseller(contract);
            //
			OrderResult oResult = new OrderResult();
			// check account
			SecurityResult sResult = StorehouseController.CheckAccountActive();
			//
			if (!sResult.Success)
			{
				//
				oResult.Succeed = false;
				//
				oResult.ResultCode = sResult.ResultCode;
				//
				return oResult;
			}
			// check order items not empty
			if (orderItems == null || orderItems.Length == 0)
			{
				//
				oResult.Succeed = false;
				//
				oResult.ResultCode = EMPTY_ORDER_ITEMS_CODE;
				//
				return oResult;
			}
			//
			ES.TaskManager.StartTask("Storefront", "SUBMIT_CUSTOMER_ORDER");

			//
			try
			{
                string currency = StorehouseController.GetBaseCurrency(contract.ResellerId);
				// ordered services
				List<int> orderedSvcs = new List<int>();
				// build services to be ordered
				for (int i = 0; i < orderItems.Length; i++)
				{
					// 
					OrderItem orderItem = orderItems[i];
					//
					int orderedSvcId = 0;
					//
					orderItem.ParentSvcId = (orderItem.ParentIndex > -1) ? orderedSvcs[orderItem.ParentIndex] : orderItem.ParentSvcId;
					// load svc type
					ProductType svcType = StorehouseController.GetProductType(orderItem.TypeId);
					//
					IServiceProvisioning controller = (IServiceProvisioning)Activator.CreateInstance(
						Type.GetType(svcType.ProvisioningController));
					// add service
					orderedSvcId = controller.AddServiceInfo(contractId, currency, orderItem);
					// check service controller result
					if (orderedSvcId < 1)
					{
						// ROLLBACK HERE
						StorehouseController.BulkServiceDelete(contractId, orderedSvcs.ToArray());
						oResult.Succeed = false;
						oResult.ResultCode = orderedSvcId;
						return oResult;
						// EXIT
					}
					// 
					orderedSvcs.Add(orderedSvcId);
				}
				// build invoice lines
				List<InvoiceItem> invoiceLines = InvoiceController.CalculateInvoiceLinesForServices(orderedSvcs);
				//
				int resultCode = InvoiceController.AddInvoice(contractId, invoiceLines, extraArgs);
				// ERROR
				if (resultCode < 1)
				{
					// ROLLBACK HERE
					StorehouseController.BulkServiceDelete(contractId, orderedSvcs.ToArray());
					oResult.Succeed = false;
					oResult.ResultCode = resultCode;
					return oResult;
				}
				// 
				oResult.OrderInvoice = resultCode;
				//
				oResult.Succeed = true;
			}
			catch (Exception ex)
			{
				//
				oResult.ResultCode = -1;
				//
				oResult.Succeed = false;
				//
				ES.TaskManager.WriteError(ex);
			}
			finally
			{
				//
				ES.TaskManager.CompleteTask();
			}
			//
			return oResult;
		}
		public int AddServiceInfo(string contractId, string currency, OrderItem orderItem)
		{
			// get hosting addon product
			HostingAddon addon = StorehouseController.GetHostingAddon(SecurityContext.User.UserId,
				orderItem.ProductId);
			// uncountable addons always have 1 for quantity
			int quantity = addon.Countable ? orderItem.Quantity : 1;
			// add hosting addon
			return EcommerceProvider.AddHostingAddonSvc(contractId, orderItem.ParentSvcId, orderItem.ProductId, 
				quantity, orderItem.ItemName, orderItem.BillingCycle, currency);
		}
Пример #11
0
 /// <remarks/>
 public void SubmitCustomerOrderAsync(string contractId, OrderItem[] orderItems, KeyValueBunch extraArgs, object userState) {
     if ((this.SubmitCustomerOrderOperationCompleted == null)) {
         this.SubmitCustomerOrderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSubmitCustomerOrderOperationCompleted);
     }
     this.InvokeAsync("SubmitCustomerOrder", new object[] {
                 contractId,
                 orderItems,
                 extraArgs}, this.SubmitCustomerOrderOperationCompleted, userState);
 }
Пример #12
0
 /// <remarks/>
 public void SubmitCustomerOrderAsync(string contractId, OrderItem[] orderItems, KeyValueBunch extraArgs) {
     this.SubmitCustomerOrderAsync(contractId, orderItems, extraArgs, null);
 }
Пример #13
0
 /// <remarks/>
 public System.IAsyncResult BeginSubmitCustomerOrder(string contractId, OrderItem[] orderItems, KeyValueBunch extraArgs, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("SubmitCustomerOrder", new object[] {
                 contractId,
                 orderItems,
                 extraArgs}, callback, asyncState);
 }
Пример #14
0
 public OrderResult SubmitCustomerOrder(string contractId, OrderItem[] orderItems, KeyValueBunch extraArgs) {
     object[] results = this.Invoke("SubmitCustomerOrder", new object[] {
                 contractId,
                 orderItems,
                 extraArgs});
     return ((OrderResult)(results[0]));
 }