protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { try { SettingManager.SetParam("Shipping.EstimateShipping.Enabled", cbEstimateShippingEnabled.Checked.ToString()); SettingManager.SetParam("Shipping.FreeShippingOverX.Enabled", cbFreeShippingOverX.Checked.ToString()); SettingManager.SetParamNative("Shipping.FreeShippingOverX.Value", txtFreeShippingOverX.Value); Address shippingOriginAddress = new Address(); shippingOriginAddress.CountryId = int.Parse(this.ddlShippingOriginCountry.SelectedItem.Value); shippingOriginAddress.StateProvinceId = int.Parse(this.ddlShippingOriginStateProvince.SelectedItem.Value); shippingOriginAddress.ZipPostalCode = txtShippingOriginZipPostalCode.Text; ShippingManager.ShippingOrigin = shippingOriginAddress; CustomerActivityManager.InsertActivity( "EditShippingSettings", GetLocaleResourceString("ActivityLog.EditShippingSettings")); Response.Redirect("ShippingSettings.aspx"); } catch (Exception exc) { ProcessException(exc); } } }
protected void SaveButton_Click(object sender, EventArgs e) { if (Page.IsValid) { try { Product product = null; //uncomment this line to support transactions //using (var scope = new System.Transactions.TransactionScope()) { product = ctrlProductInfoAdd.SaveInfo(); ctrlProductSEO.SaveInfo(product.ProductId); ctrlProductCategory.SaveInfo(product.ProductId); ctrlProductManufacturer.SaveInfo(product.ProductId); CustomerActivityManager.InsertActivity( "AddNewProduct", GetLocaleResourceString("ActivityLog.AddNewProduct"), product.Name); //uncomment this line to support transactions //scope.Complete(); } if (product != null) { Response.Redirect("ProductDetails.aspx?ProductID=" + product.ProductId); } } catch (Exception exc) { ProcessException(exc); } } }
private void BindData() { var dataSource = CustomerActivityManager.GetAllActivityTypes(); gvActivityTypes.DataSource = dataSource; gvActivityTypes.DataBind(); }
protected void SaveButton_Click(object sender, EventArgs e) { if (Page.IsValid) { try { Customer customer = CustomerManager.GetCustomerById(this.CustomerId); if (customer != null) { customer = ctrlCustomerInfo.SaveInfo(); ctrlCustomerBillingAddresses.SaveInfo(); ctrlCustomerShippingAddresses.SaveInfo(); ctrlCustomerOrders.SaveInfo(); ctrlCustomerRoleMappings.SaveInfo(); ctrlCurrentShoppingCart.SaveInfo(); ctrlCurrentWishlist.SaveInfo(); ctrlCustomerRewardPoints.SaveInfo(); ctrlCustomerForumSubscriptions.SaveInfo(); CustomerActivityManager.InsertActivity( "EditCustomer", GetLocaleResourceString("ActivityLog.EditCustomer"), customer.CustomerId); } Response.Redirect(string.Format("CustomerDetails.aspx?CustomerID={0}&TabID={1}", customer.CustomerId, this.GetActiveTabId(this.CustomerTabs))); } catch (Exception exc) { ProcessException(exc); } } }
protected List <RowHelper> GetActivityLogs() { DateTime?startDate = ctrlCreatedOnFromDatePicker.SelectedDate; DateTime?endDate = ctrlCreatedOnToDatePicker.SelectedDate; if (startDate.HasValue) { startDate = DateTimeHelper.ConvertToUtcTime(startDate.Value, DateTimeHelper.CurrentTimeZone); } if (endDate.HasValue) { endDate = DateTimeHelper.ConvertToUtcTime(endDate.Value, DateTimeHelper.CurrentTimeZone).AddDays(1); } string customerEmail = txtCustomerEmail.Text.Trim(); string customerName = txtCustomerName.Text.Trim(); int activityLogTypeId = int.Parse(this.ddlActivityLogType.SelectedItem.Value); int totalRecords = 0; var activityLogs = CustomerActivityManager.GetAllActivities( startDate, endDate, customerEmail, customerName, activityLogTypeId, int.MaxValue, 0, out totalRecords); var result = new List <RowHelper>(); foreach (var activityLog in activityLogs) { result.Add(new RowHelper(activityLog)); } return(result); }
protected void SaveButton_Click(object sender, EventArgs e) { if (Page.IsValid) { try { CheckoutAttribute attribute = null; attribute = ctrlCheckoutAttributeInfo.SaveInfo(); ctrlCheckoutAttributeValues.SaveInfo(); CustomerActivityManager.InsertActivity( "EditCheckoutAttribute", GetLocaleResourceString("ActivityLog.EditCheckoutAttribute"), attribute.Name); if (attribute != null) { Response.Redirect(string.Format("CheckoutAttributeDetails.aspx?CheckoutAttributeID={0}&TabID={1}", attribute.CheckoutAttributeId, this.GetActiveTabId(this.AttributeTabs))); } } catch (Exception exc) { ProcessException(exc); } } }
protected void SaveButton_Click(object sender, EventArgs e) { if (Page.IsValid) { try { CheckoutAttribute attribute = ctrlCheckoutAttributeInfo.SaveInfo(); ctrlCheckoutAttributeValues.SaveInfo(); CustomerActivityManager.InsertActivity( "AddNewCheckoutAttribute", GetLocaleResourceString("ActivityLog.AddNewCheckoutAttribute"), attribute.Name); if (attribute != null) { Response.Redirect("CheckoutAttributeDetails.aspx?CheckoutAttributeID=" + attribute.CheckoutAttributeId); } } catch (Exception exc) { ProcessException(exc); } } }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { try { ctrlClickatellProviderInfo.SaveInfo(); ctrlVerizonProviderInfo.SaveInfo(); SettingManager.SetParam("Mobile.SMS.Clickatell.PhoneNumber", txtClickatellPhoneNumber.Text); SettingManager.SetParam("Mobile.SMS.Clickatell.APIID", txtClickatellAPIId.Text); SettingManager.SetParam("Mobile.SMS.Clickatell.Username", txtClickatellUsername.Text); SettingManager.SetParam("Mobile.SMS.Clickatell.Password", txtClickatellPassword.Text); SettingManager.SetParam("Mobile.SMS.Verizon.Email", txtVerizonEmail.Text); CustomerActivityManager.InsertActivity("EditSMSProviders", GetLocaleResourceString("ActivityLog.EditSMSProviders")); Response.Redirect(string.Format("SMSProviders.aspx?TabID={0}", GetActiveTabId(SMSProvidersTabs))); } catch (Exception exc) { ProcessException(exc); } } }
protected void DeleteButton_Click(object sender, EventArgs e) { try { ProductVariant productVariant = ProductManager.GetProductVariantById(this.ProductVariantId); if (productVariant != null) { ProductManager.MarkProductVariantAsDeleted(productVariant.ProductVariantId); CustomerActivityManager.InsertActivity( "DeleteProductVariant", GetLocaleResourceString("ActivityLog.DeleteProductVariant"), productVariant.FullProductName); string url = CommonHelper.GetStoreAdminLocation() + "ProductDetails.aspx?ProductID=" + productVariant.ProductId.ToString(); Response.Redirect(url); } else { Response.Redirect("Products.aspx"); } } catch (Exception exc) { ProcessException(exc); } }
protected void SaveButton_Click(object sender, EventArgs e) { if (Page.IsValid) { try { ProductVariant productVariant = ctrlProductVariantInfo.SaveInfo(); ctrlProductVariantTierPrices.SaveInfo(); ctrlProductPricesByCustomerRole.SaveInfo(); ctrlProductVariantAttributes.SaveInfo(); ctrlProductVariantDiscounts.SaveInfo(); CustomerActivityManager.InsertActivity( "EditProductVariant", GetLocaleResourceString("ActivityLog.EditProductVariant"), productVariant.FullProductName); Response.Redirect(string.Format("ProductVariantDetails.aspx?ProductVariantID={0}&TabID={1}", productVariant.ProductVariantId, this.GetActiveTabId(this.ProductVariantTabs))); } catch (Exception exc) { ProcessException(exc); } } }
protected void DeleteActivityLogButton_OnCommand(object sender, CommandEventArgs e) { if (e.CommandName == "DeleteActivityLog") { CustomerActivityManager.DeleteActivity(Convert.ToInt32(e.CommandArgument)); BindGrid(); } }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { try { //standard settings TaxManager.PricesIncludeTax = cbPricesIncludeTax.Checked; TaxManager.AllowCustomersToSelectTaxDisplayType = cbAllowCustomersToSelectTaxDisplayType.Checked; TaxManager.TaxDisplayType = (TaxDisplayTypeEnum)Enum.ToObject(typeof(TaxDisplayTypeEnum), int.Parse(this.ddlTaxDisplayType.SelectedItem.Value)); TaxManager.DisplayTaxSuffix = cbDisplayTaxSuffix.Checked; TaxManager.DisplayTaxRates = cbDisplayTaxRates.Checked; TaxManager.HideZeroTax = cbHideZeroTax.Checked; TaxManager.HideTaxInOrderSummary = cbHideTaxInOrderSummary.Checked; TaxManager.TaxBasedOn = (TaxBasedOnEnum)Enum.ToObject(typeof(TaxBasedOnEnum), int.Parse(this.ddlTaxBasedOn.SelectedItem.Value)); //tax address Address defaultTaxAddress = new Address(); defaultTaxAddress.CountryId = int.Parse(this.ddlTaxDefaultCountry.SelectedItem.Value); defaultTaxAddress.StateProvinceId = int.Parse(this.ddlTaxDefaultStateProvince.SelectedItem.Value); defaultTaxAddress.ZipPostalCode = txtTaxDefaultZipPostalCode.Text; TaxManager.DefaultTaxAddress = defaultTaxAddress; //shipping TaxManager.ShippingIsTaxable = cbShippingIsTaxable.Checked; TaxManager.ShippingPriceIncludesTax = cbShippingPriceIncludesTax.Checked; TaxManager.ShippingTaxClassId = int.Parse(this.ddlShippingTaxClass.SelectedItem.Value); //additional payment fee TaxManager.PaymentMethodAdditionalFeeIsTaxable = cbPaymentMethodAdditionalFeeIsTaxable.Checked; TaxManager.PaymentMethodAdditionalFeeIncludesTax = cbPaymentMethodAdditionalFeeIncludesTax.Checked; TaxManager.PaymentMethodAdditionalFeeTaxClassId = int.Parse(this.ddlPaymentMethodAdditionalFeeTaxClass.SelectedItem.Value); //EU VAT support TaxManager.EUVatEnabled = cbEUVatEnabled.Checked; TaxManager.EUVatShopCountryId = int.Parse(this.ddlEUVatShopCountry.SelectedItem.Value); TaxManager.EUVatAllowVATExemption = cbEUVatAllowVATExemption.Checked; TaxManager.EUVatUseWebService = cbEUVatUseWebService.Checked; TaxManager.EUVatEmailAdminWhenNewVATSubmitted = cbEUVatEmailAdminWhenNewVATSubmitted.Checked; //logging CustomerActivityManager.InsertActivity( "EditTaxSettings", GetLocaleResourceString("ActivityLog.EditTaxSettings")); Response.Redirect("TaxSettings.aspx"); } catch (Exception exc) { ProcessException(exc); } } }
protected void ClearButton_Click(object sender, EventArgs e) { try { CustomerActivityManager.ClearAllActivities(); BindGrid(); } catch (Exception exc) { ProcessException(exc); } }
protected void SaveButton_Click(object sender, EventArgs e) { if (Page.IsValid) { try { Product product = null; //uncomment this line to support transactions //using (var scope = new System.Transactions.TransactionScope()) { product = ctrlProductInfoAdd.SaveInfo(); ctrlProductSEO.SaveInfo(product.ProductId); ctrlProductCategory.SaveInfo(product.ProductId); ctrlProductManufacturer.SaveInfo(product.ProductId); // add catalog CatalogBiz catalogBiz = new CatalogBiz(); lwg_Catalog catalog = new lwg_Catalog(); catalog.CatalogId = product.ProductId; catalog.CatalogNumber = string.Empty; catalog.Subtitle = string.Empty; catalog.TextLang = string.Empty; catalog.PTSprodcode = string.Empty; catalog.KaldbNumber = string.Empty; catalog.SoundIcon = string.Empty; catalog.PDF = string.Empty; catalog.pages = string.Empty; catalog.TitleDisplay = product.Name; //added to fix empty TitleDisplay issue for new product (LDWG-194) catalogBiz.SaveCatalog(catalog); CustomerActivityManager.InsertActivity( "AddNewProduct", GetLocaleResourceString("ActivityLog.AddNewProduct"), product.Name); //uncomment this line to support transactions //scope.Complete(); } if (product != null) { Response.Redirect("ProductDetails.aspx?ProductID=" + product.ProductId); } } catch (Exception exc) { ProcessException(exc); } } }
protected void DeleteButton_Click(object sender, EventArgs e) { try { CustomerManager.MarkCustomerAsDeleted(this.CustomerId); CustomerActivityManager.InsertActivity( "DeleteCustomer", GetLocaleResourceString("ActivityLog.DeleteCustomer"), this.CustomerId); Response.Redirect("Customers.aspx"); } catch (Exception exc) { ProcessException(exc); } }
protected void FillActivityLogTypesDropDowns() { ddlActivityLogType.Items.Clear(); var allItem = new ListItem(GetLocaleResourceString("Admin.ActivityLog.AllActivityLogType"), "0"); ddlActivityLogType.Items.Add(allItem); var activityLogTypes = CustomerActivityManager.GetAllActivityTypes(); foreach (var activityType in activityLogTypes) { var item = new ListItem(activityType.Name, activityType.ActivityLogTypeId.ToString()); ddlActivityLogType.Items.Add(item); } CommonHelper.SelectListItem(this.ddlActivityLogType, 0); }
protected void BackupButton_Click(object sender, EventArgs e) { try { MaintenanceManager.Backup(); CustomerActivityManager.InsertActivity( "CreateBackup", GetLocaleResourceString("ActivityLog.CreateBackup")); ShowMessage(GetLocaleResourceString("Admin.Maintenance.BackupCreated")); BindGrid(); } catch (Exception exc) { ProcessException(exc); } }
protected void SaveButton_Click(object sender, EventArgs e) { if (Page.IsValid) { try { Product product = null; //uncomment this line to support transactions //using (var scope = new System.Transactions.TransactionScope()) { product = ctrlProductInfoEdit.SaveInfo(); ctrlProductSEO.SaveInfo(); ctrlProductVariants.SaveInfo(); ctrlProductCategory.SaveInfo(); ctrlProductManufacturer.SaveInfo(); ctrlRelatedProducts.SaveInfo(); ctrlProductPictures.SaveInfo(); ctrlProductSpecifications.SaveInfo(); //\ ctlProductInfoAddCatalogLWG.SaveCatalogLWG(); //\ CustomerActivityManager.InsertActivity( "EditProduct", GetLocaleResourceString("ActivityLog.EditProduct"), product.Name); //uncomment this line to support transactions //scope.Complete(); } if (product != null) { Response.Redirect(string.Format("ProductDetails.aspx?ProductID={0}&TabID={1}", product.ProductId, this.GetActiveTabId(this.ProductTabs))); } } catch (Exception exc) { ProcessException(exc); } } }
protected void BtnDuplicate_OnClick(object sender, EventArgs e) { try { Product productCopy = ProductManager.DuplicateProduct(ProductId, txtProductCopyName.Text, cbIsProductCopyPublished.Checked, cbCopyImages.Checked); if (productCopy != null) { CustomerActivityManager.InsertActivity( "AddNewProduct", GetLocaleResourceString("ActivityLog.AddNewProduct"), productCopy.Name); Response.Redirect(String.Format("ProductDetails.aspx?ProductID={0}", productCopy.ProductId)); } } catch (Exception ex) { ProcessException(ex); } }
protected void RestoreButton_OnCommand(object sender, CommandEventArgs e) { if (e.CommandName == "RestoreBackup") { try { MaintenanceManager.RestoreBackup(e.CommandArgument.ToString()); CustomerActivityManager.InsertActivity( "RestoreBackup", GetLocaleResourceString("ActivityLog.RestoreBackup")); BindGrid(); } catch (Exception exc) { ProcessException(exc); } } }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { try { TaxManager.PricesIncludeTax = cbPricesIncludeTax.Checked; TaxManager.AllowCustomersToSelectTaxDisplayType = cbAllowCustomersToSelectTaxDisplayType.Checked; TaxManager.TaxDisplayType = (TaxDisplayTypeEnum)Enum.ToObject(typeof(TaxDisplayTypeEnum), int.Parse(this.ddlTaxDisplayType.SelectedItem.Value)); TaxManager.DisplayTaxSuffix = cbDisplayTaxSuffix.Checked; TaxManager.HideZeroTax = cbHideZeroTax.Checked; TaxManager.HideTaxInOrderSummary = cbHideTaxInOrderSummary.Checked; TaxManager.TaxBasedOn = (TaxBasedOnEnum)Enum.ToObject(typeof(TaxBasedOnEnum), int.Parse(this.ddlTaxBasedOn.SelectedItem.Value)); Address defaultTaxAddress = new Address(); defaultTaxAddress.CountryId = int.Parse(this.ddlTaxDefaultCountry.SelectedItem.Value); defaultTaxAddress.StateProvinceId = int.Parse(this.ddlTaxDefaultStateProvince.SelectedItem.Value); defaultTaxAddress.ZipPostalCode = txtTaxDefaultZipPostalCode.Text; TaxManager.DefaultTaxAddress = defaultTaxAddress; TaxManager.ShippingIsTaxable = cbShippingIsTaxable.Checked; TaxManager.ShippingPriceIncludesTax = cbShippingPriceIncludesTax.Checked; TaxManager.ShippingTaxClassId = int.Parse(this.ddlShippingTaxClass.SelectedItem.Value); TaxManager.PaymentMethodAdditionalFeeIsTaxable = cbPaymentMethodAdditionalFeeIsTaxable.Checked; TaxManager.PaymentMethodAdditionalFeeIncludesTax = cbPaymentMethodAdditionalFeeIncludesTax.Checked; TaxManager.PaymentMethodAdditionalFeeTaxClassId = int.Parse(this.ddlPaymentMethodAdditionalFeeTaxClass.SelectedItem.Value); CustomerActivityManager.InsertActivity( "EditTaxSettings", GetLocaleResourceString("ActivityLog.EditTaxSettings")); Response.Redirect("TaxSettings.aspx"); } catch (Exception exc) { ProcessException(exc); } } }
protected void AddButton_Click(object sender, EventArgs e) { if (Page.IsValid) { try { Setting setting = ctrlSettingInfo.SaveInfo(); CustomerActivityManager.InsertActivity( "AddNewSetting", GetLocaleResourceString("ActivityLog.AddNewSetting"), setting.Name); Response.Redirect("SettingDetails.aspx?SettingID=" + setting.SettingId.ToString()); } catch (Exception exc) { ProcessException(exc); } } }
protected void AddButton_Click(object sender, EventArgs e) { if (Page.IsValid) { try { CustomerRole customerRole = ctrlCustomerRoleInfo.SaveInfo(); CustomerActivityManager.InsertActivity( "AddNewCustomerRole", GetLocaleResourceString("ActivityLog.AddNewCustomerRole"), customerRole.Name); Response.Redirect("CustomerRoleDetails.aspx?CustomerRoleID=" + customerRole.CustomerRoleId.ToString()); } catch (Exception exc) { ProcessException(exc); } } }
protected void SaveButton_Click(object sender, EventArgs e) { if (Page.IsValid) { try { GiftCard gc = ctrlGiftCardInfo.SaveInfo(); CustomerActivityManager.InsertActivity( "EditGiftCard", GetLocaleResourceString("ActivityLog.EditGiftCard"), gc.GiftCardCouponCode); Response.Redirect("GiftCardDetails.aspx?GiftCardID=" + gc.GiftCardId.ToString()); } catch (Exception exc) { ProcessException(exc); } } }
protected void DeleteButton_Click(object sender, EventArgs e) { try { Product product = ProductManager.GetProductById(this.ProductId); if (product != null) { ProductManager.MarkProductAsDeleted(this.ProductId); CustomerActivityManager.InsertActivity( "DeleteProduct", GetLocaleResourceString("ActivityLog.DeleteProduct"), product.Name); } Response.Redirect("Products.aspx"); } catch (Exception exc) { ProcessException(exc); } }
protected void DeleteButton_Click(object sender, EventArgs e) { try { var attribute = CheckoutAttributeManager.GetCheckoutAttributeById(this.CheckoutAttributeId); if (attribute != null) { CheckoutAttributeManager.DeleteCheckoutAttribute(this.CheckoutAttributeId); CustomerActivityManager.InsertActivity( "DeleteCheckoutAttribute", GetLocaleResourceString("ActivityLog.DeleteCheckoutAttribute"), attribute.Name); } Response.Redirect("checkoutattributes.aspx"); } catch (Exception exc) { ProcessException(exc); } }
protected void SaveButton_Click(object sender, EventArgs e) { if (Page.IsValid) { try { ReturnRequest rr = ctrlReturnRequestInfo.SaveInfo(); CustomerActivityManager.InsertActivity( "EditReturnRequest", GetLocaleResourceString("ActivityLog.EditReturnRequest"), rr.ReturnRequestId); Response.Redirect("ReturnRequestDetails.aspx?ReturnRequestID=" + rr.ReturnRequestId.ToString()); } catch (Exception exc) { ProcessException(exc); } } }
protected void AddButton_Click(object sender, EventArgs e) { if (Page.IsValid) { try { Discount discount = ctrlDiscountInfo.SaveInfo(); CustomerActivityManager.InsertActivity( "AddNewDiscount", GetLocaleResourceString("ActivityLog.AddNewDiscount"), discount.Name); Response.Redirect("DiscountDetails.aspx?DiscountID=" + discount.DiscountId.ToString()); } catch (Exception exc) { ProcessException(exc); } } }
protected void SaveButton_Click(object sender, EventArgs e) { if (Page.IsValid) { try { SpecificationAttribute specificationAttribute = ctrlSpecificationAttributeInfo.SaveInfo(); CustomerActivityManager.InsertActivity( "EditSpecAttribute", GetLocaleResourceString("ActivityLog.EditSpecAttribute"), specificationAttribute.Name); Response.Redirect("SpecificationAttributeDetails.aspx?SpecificationAttributeID=" + specificationAttribute.SpecificationAttributeId.ToString()); } catch (Exception exc) { ProcessException(exc); } } }
protected void DeleteButton_Click(object sender, EventArgs e) { try { Manufacturer manufacturer = ManufacturerManager.GetManufacturerById(this.ManufacturerId); if (manufacturer != null) { ManufacturerManager.MarkManufacturerAsDeleted(manufacturer.ManufacturerId); CustomerActivityManager.InsertActivity( "DeleteManufacturer", GetLocaleResourceString("ActivityLog.DeleteManufacturer"), manufacturer.Name); } Response.Redirect("Manufacturers.aspx"); } catch (Exception exc) { ProcessException(exc); } }