protected void AddUser_Click(object sender, EventArgs e) { AdminUtilities au = new AdminUtilities(); DrawNewUserTable(); AddUser.Visible = false; Label1.Text = "You are currently creating a new user."; CreateUser.Visible = true; }
protected void uxDeleteButton_Click(object sender, EventArgs e) { try { bool deleted = false; foreach (GridViewRow row in uxGridCulture.Rows) { CheckBox deleteCheck = (CheckBox)row.FindControl("uxCheck"); if (deleteCheck.Checked) { string defaultLanguage = row.Cells[ColumnName].Text.Trim(); CultureConfigs cultureConfigs = new CultureConfigs(); if (cultureConfigs.UseCultureName(defaultLanguage)) { uxMessage.DisplayError(Resources.CultureMessages.DeleteErrorExistingConfig); return; } string id = row.Cells[ColumnCultureID].Text.Trim(); DataAccessContext.CultureRepository.Delete(id); //Delete Relate Table (CultureID) DeleteAllRelateFieldCultureID(id); deleted = true; //Delete Email Template DeleteCultureInformation(id); } } if (deleted) { AdminUtilities.ClearLanguageCache(); uxMessage.DisplayMessage(Resources.CultureMessages.DeleteSuccess); } } catch (DataAccessException ex) { uxMessage.DisplayError("Error:<br/>" + ex.Message); } catch { uxMessage.DisplayError(Resources.CultureMessages.DeleteError); } RefreshGrid(); if (uxGridCulture.Rows.Count == 0 && uxPagingControl.CurrentPage >= uxPagingControl.NumberOfPages) { uxPagingControl.CurrentPage = uxPagingControl.NumberOfPages; RefreshGrid(); } }
protected void uxUpdateConfigOnlyButton_Click(object sender, EventArgs e) { WidgetDirector widgetDirector = new WidgetDirector(); SystemConfig.UpdateNewConfigValue(widgetDirector.WidgetConfigurationCollection); DatabaseConverter convert = new DatabaseConverter(); convert.UpdateStoreConfigurations(); AdminUtilities.ClearAllCache(); uxMessageLabel.ForeColor = System.Drawing.Color.Green; uxMessageLabel.Text = "<strong>Update Config Completed</storng>"; }
protected void uxTopContentMenuGrid_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { GridViewRow rowGrid = uxTopContentMenuGrid.Rows[e.RowIndex]; string contentmenuID = ((Label)rowGrid.FindControl("uxContentMenuIDLabel")).Text; ContentMenu contentMenu = DataAccessContext.ContentMenuRepository.GetOne(contentmenuID); contentMenu.IsEnabled = ((CheckBox)rowGrid.FindControl("uxContentEnabledCheck")).Checked; ContentMenuItem contentMenuItem = GetReferringContentMenuItem(DataAccessContext.CultureRepository.GetOne( DataAccessContext.CultureRepository.GetIDByName(SystemConst.USCultureName)), contentmenuID); contentMenuItem.IsEnabled = contentMenu.IsEnabled; DataAccessContext.ContentMenuItemRepository.Save(contentMenuItem); string menuType = ((DropDownList)rowGrid.FindControl("uxContentMenuTypeDrop")).SelectedValue; DataAccessContext.ContentMenuRepository.Save(contentMenu); Store store = DataAccessContext.StoreRepository.GetOne(uxStoreFilterDrop.SelectedValue); if (contentmenuID == DataAccessContext.Configurations.GetValue("TopContentMenu", CurrentStore)) { DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["TopContentMenuType"], menuType, CurrentStore); } else if (contentmenuID == DataAccessContext.Configurations.GetValue("LeftContentMenu", CurrentStore)) { DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["LeftContentMenuType"], menuType, CurrentStore); } else if (contentmenuID == DataAccessContext.Configurations.GetValue("RightContentMenu", CurrentStore)) { DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RightContentMenuType"], menuType, CurrentStore); } AdminUtilities.LoadSystemConfig(); uxTopContentMenuGrid.EditIndex = -1; RefreshGrid(); uxMessage.DisplayMessage(Resources.ContentMenuItemMessages.ItemUpdateSuccess); } finally { // Avoid calling Update() automatically by GridView e.Cancel = true; } }
protected void uxAddButton_Click(object sender, EventArgs e) { uxGrid.EditIndex = -1; uxGrid.ShowFooter = true; RefreshGrid(); uxAddButton.Visible = false; SetFooterRowFocus(); AdminUtilities.ClearLanguageCache(); }
public void SetFooter(Object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Footer) { TableCellCollection cells = e.Row.Cells; cells[0].CssClass = "AffiliateCommissionFooterFirstColumn"; cells[1].Text = "Total"; cells[1].CssClass = "AffiliateCommissionFooterTotalColumn"; cells[2].Text = AdminUtilities.FormatPrice(Convert.ToDecimal(GetTotal())); cells[2].CssClass = "AffiliateCommissionFooterTotalAmountColumn"; cells[3].CssClass = "AffiliateCommissionFooterEndColumn"; } }
protected void uxAddButton_Click(object sender, EventArgs e) { try { if (Page.IsValid) { if (uxProductAttributes.IsProductSkuExist()) { uxMessage.DisplayError(Resources.ProductMessages.AddErrorSkuExist); return; } if (uxProductInfo.ConvertToCategoryIDs().Length <= 0) { uxMessage.DisplayError(Resources.ProductMessages.AddErrorCategoryEmpty); return; } if (uxProductKit.IsProductKit) { if (uxProductKit.GetSelectedGroupID().Length <= 0) { uxMessage.DisplayError(Resources.ProductMessages.AddErrorProductKitEmpty); return; } } if (!uxProductAttributes.VerifyInputListOption()) { DisplayErrorOption(); return; } uxProductAttributes.SetStockWhenAdd(); string productID = AddNew(); uxLastAddLink.Visible = true; GetLastAddProductLink(productID); ClearInputFields(); uxProductAttributes.PopulateStockOptionControl(); AdminUtilities.ClearSiteMapCache(); } } catch (Exception ex) { uxMessage.DisplayException(ex); } }
private void PopulateControl() { PopulateDate(); IList <Order> list = DataAccessContext.OrderRepository.GetPaidOrdersByDateTime(GetStartDate(), GetEndDate()); uxSaleAmountLabel.Text = String.Format("Number of Transactions: <strong>{0}</strong>", list.Count); decimal subtotal = 0; for (int i = 0; i < list.Count; i++) { subtotal += list[i].Total; } uxSaleTotalLabel.Text = String.Format( "Sales Amount: <strong>{0}</strong>", AdminUtilities.FormatPrice(subtotal)); }
protected void uxSearchGrid_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { string pageID = ((HiddenField)uxSearchGrid.Rows[e.RowIndex].FindControl("uxPageIDHidden")).Value; string oldCultureID = ((HiddenField)uxSearchGrid.Rows[e.RowIndex].FindControl("uxOldCultureIDHidden")).Value; string oldKeyName = ((HiddenField)uxSearchGrid.Rows[e.RowIndex].FindControl("uxOldKeyNameHidden")).Value; string newCultureID = ((DropDownList)uxSearchGrid.Rows[e.RowIndex].FindControl("uxCultureDrop")).SelectedValue; string newKeyName = ((TextBox)uxSearchGrid.Rows[e.RowIndex].FindControl("uxKeyNameText")).Text.Trim(); string newTextData = ((TextBox)uxSearchGrid.Rows[e.RowIndex].FindControl("uxTextDataText")).Text.Trim(); LanguageTextAccess.Update( pageID, oldCultureID, oldKeyName, newCultureID, newKeyName, newTextData); // End editing uxSearchGrid.EditIndex = -1; uxMessage.DisplayMessage(Resources.LanguagePageMessages.KeywordUpdateSuccess); RefreshGrid(); } catch (Exception ex) { string message; if (ex.InnerException is DuplicatedPrimaryKeyException) { message = Resources.LanguagePageMessages.KeywordUpdateErrorDuplicated; } else { message = Resources.LanguagePageMessages.KeywordUpdateError; } throw new ApplicationException(message); } finally { // Avoid calling Update() automatically by GridView e.Cancel = true; } AdminUtilities.ClearLanguageCache(); }
protected void uxDeleteButton_Click(object sender, EventArgs e) { try { bool deleted = false; foreach (GridViewRow row in uxGrid.Rows) { CheckBox deleteCheck = (CheckBox)row.FindControl("uxCheck"); if (deleteCheck.Checked) { string ID = row.Cells[ColumnAdminID].Text.Trim(); string userName = row.Cells[ColumnUserName].Text.Trim(); if ((Membership.GetUser().UserName != userName) && (userName.ToLower() != "admin")) { DataAccessContext.AdminRepository.Delete(ID); Membership.DeleteUser(row.Cells[ColumnUserName].Text.Trim()); AdminMenuPermissionAccess.Delete(ID); deleted = true; } else { uxMessage.DisplayError(Resources.AdminMessage.DeleteDefaultUserError); } } } if (deleted) { AdminUtilities.ClearAdminCache(); uxMessage.DisplayMessage(Resources.AdminMessage.DeleteSuccess); } } catch (Exception ex) { uxMessage.DisplayException(ex); } RefreshGrid(); if (uxGrid.Rows.Count == 0 && uxPagingControl.CurrentPage >= uxPagingControl.NumberOfPages) { uxPagingControl.CurrentPage = uxPagingControl.NumberOfPages; RefreshGrid(); } }
protected void uxGrid_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { string newCultureID = ((DropDownList)uxGrid.Rows[e.RowIndex].FindControl("uxCultureDrop")) .SelectedValue; string newKeyName = ((TextBox)uxGrid.Rows[e.RowIndex].FindControl("uxKeyNameText")).Text.Trim(); string newTextData = ((TextBox)uxGrid.Rows[e.RowIndex].FindControl("uxTextDataText")).Text.Trim(); uxLanguageTextSource.UpdateParameters.Add("pageID", e.Keys["PageID"].ToString()); uxLanguageTextSource.UpdateParameters.Add("cultureID", e.Keys["CultureID"].ToString()); uxLanguageTextSource.UpdateParameters.Add("keyName", e.Keys["KeyName"].ToString()); uxLanguageTextSource.UpdateParameters.Add("newCultureID", newCultureID); uxLanguageTextSource.UpdateParameters.Add("newKeyName", newKeyName); uxLanguageTextSource.UpdateParameters.Add("newTextData", newTextData); uxLanguageTextSource.Update(); // End editing uxGrid.EditIndex = -1; uxMessage.DisplayMessage(Resources.LanguagePageMessages.KeywordUpdateSuccess); uxStatusHidden.Value = "Updated"; } catch (Exception ex) { string message; if (ex.InnerException is DuplicatedPrimaryKeyException) { message = Resources.LanguagePageMessages.KeywordUpdateErrorDuplicated; } else { message = Resources.LanguagePageMessages.KeywordUpdateError; } throw new ApplicationException(message); } finally { // Avoid calling Update() automatically by GridView e.Cancel = true; } AdminUtilities.ClearLanguageCache(); }
protected void uxExecuteButton_Click(object sender, EventArgs e) { string pathFile = uxFileNameText.Text; Culture culture = DataAccessContext.CultureRepository.GetOne(uxLanguageDrop.SelectedValue); // ProductImporter importer = new ProductImporter(culture, new FileManager()); ProductImportStatus status; TimeSpan timeDiff; string storeID = CurrentStoreID; LargeImporter importer = new LargeImporter(culture, new FileManager()); switch (uxModeRadioList.SelectedValue) { case "Purge": DataAccessContextDeluxe.PromotionProductRepository.DeleteAll(); DataAccessContextDeluxe.ProductSubscriptionRepository.DeleteAll(); status = importer.ImportProductPurgeAll( "~/" + uxFileNameText.Text.Trim(), uxImageProcessCheck.Checked, uxSkipImageProcessingCheck.Checked, out timeDiff, storeID); UpdateMessage(status); UpdateTimeMessage(timeDiff); break; case "Overwrite": status = importer.ImportProductOverwrite( "~/" + uxFileNameText.Text.Trim(), uxImageProcessCheck.Checked, uxSkipImageProcessingCheck.Checked, out timeDiff, storeID, GetProductIDAndSku()); UpdateMessage(status); UpdateTimeMessage(timeDiff); break; } AdminUtilities.ClearAllCache(); }
private void UpdateDatabase() { if (Page.IsValid) { try { UpdateOrderSettings(); UpdateStoreDetail(); AdminUtilities.LoadSystemConfig(); uxMessage.DisplayMessage(Resources.SetupMessages.UpdateSuccess); } catch (Exception ex) { uxMessage.DisplayException(ex); } } }
protected void uxGrid_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Add") { try { string cultureID = ((DropDownList)uxGrid.FooterRow.FindControl("uxCultureDrop")) .SelectedValue; string keyName = ((TextBox)uxGrid.FooterRow.FindControl("uxKeyNameText")).Text.Trim(); string textData = ((TextBox)uxGrid.FooterRow.FindControl("uxTextDataText")).Text.Trim(); uxLanguageTextSource.InsertParameters.Add("pageID", CurrentPageID); uxLanguageTextSource.InsertParameters.Add("cultureID", cultureID); uxLanguageTextSource.InsertParameters.Add("keyName", keyName); uxLanguageTextSource.InsertParameters.Add("textData", textData); uxLanguageTextSource.Insert(); ((TextBox)uxGrid.FooterRow.FindControl("uxKeyNameText")).Text = ""; ((TextBox)uxGrid.FooterRow.FindControl("uxTextDataText")).Text = ""; uxMessage.DisplayMessage(Resources.LanguagePageMessages.KeywordAddSuccess); } catch (Exception ex) { string message; if (ex.InnerException is DuplicatedPrimaryKeyException) { message = Resources.LanguagePageMessages.KeywordAddErrorDuplicated; } else { message = Resources.LanguagePageMessages.KeywordAddError; } throw new ApplicationException(message); } RefreshGrid(); AdminUtilities.ClearLanguageCache(); uxStatusHidden.Value = "Added"; } }
protected void uxFormView_DataBound(object sender, EventArgs e) { FormView formView = (FormView)sender; Order order = (Order)formView.DataItem; if (!String.IsNullOrEmpty(order.OrderID)) { uxProductCostLabel.Text = AdminUtilities.FormatPrice(order.Subtotal); uxDiscountLabel.Text = AdminUtilities.FormatPrice(order.CouponDiscount * (-1)); uxPointDiscountLabel.Text = AdminUtilities.FormatPrice(order.RedeemPrice * (-1)); uxGiftCertificateLabel.Text = AdminUtilities.FormatPrice(order.GiftCertificate * (-1)); uxTaxLabel.Text = AdminUtilities.FormatPrice(order.Tax); uxShippingCostLabel.Text = AdminUtilities.FormatPrice(order.ShippingCost); uxHandlindFeeLabel.Text = AdminUtilities.FormatPrice(order.HandlingFee); uxTotalLabel.Text = AdminUtilities.FormatPrice(order.Total); UxHandlingFeeTR.Visible = IsHandlingFeeVisible(); } }
public void SetFooter(Object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Footer) { TableCellCollection cells = e.Row.Cells; cells.RemoveAt(0); cells.RemoveAt(0); cells[0].ColumnSpan = 3; if (uxSearchFilter.SearchFilterObj.FilterType != SearchFilter.SearchFilterType.None) { if (uxSearchFilter.SearchFilterObj.Value2 != "") { if (uxSearchFilter.SearchFilterObj.FilterType == SearchFilter.SearchFilterType.Date) { cells[0].Text = uxSearchFilter.SearchFilterObj.FieldName + "<br> from " + DateTime.Parse(uxSearchFilter.SearchFilterObj.Value1).ToString("MMMM d, yyyy") + " to " + DateTime.Parse(uxSearchFilter.SearchFilterObj.Value2).ToString("MMMM d, yyyy"); } else { cells[0].Text = uxSearchFilter.SearchFilterObj.FieldName + "<br> from " + uxSearchFilter.SearchFilterObj.Value1 + " to " + uxSearchFilter.SearchFilterObj.Value2; } } else { cells[0].Text = uxSearchFilter.SearchFilterObj.FieldName + " from " + uxSearchFilter.SearchFilterObj.Value1; } } else { cells[0].Text = " Show All "; } cells[0].CssClass = "pdl10"; cells[1].Text = "Total"; cells[1].HorizontalAlign = HorizontalAlign.Center; cells[1].Font.Bold = true; cells[2].Text = AdminUtilities.FormatPrice(TotalPrice()); cells[2].CssClass = "OrderListTotalPrice"; } }
private void UpdateCategory() { try { if (Page.IsValid) { if (uxParentDrop.SelectedValue != ParentCategoryID) { DataAccessContext.CategoryRepository.ReArrangeSortOrder(uxLanguageControl.CurrentCulture, uxParentDrop.SelectedValue, CurrentID, BoolFilter.ShowTrue); } Category category = DataAccessContext.CategoryRepository.GetOne( uxLanguageControl.CurrentCulture, CurrentID); category = SetUpCategory(category); category = DataAccessContext.CategoryRepository.Save(category); if (IsEnabledChanged()) { DataAccessContext.ProductRepository.RefreshIsParentVisibleByCategoryID(CurrentID, new StoreRetriever().GetCurrentStoreID()); } DataAccessContext.CategoryRepository.ReArrangeSortOrderByParentCategoryID( uxLanguageControl.CurrentCulture, ParentCategoryID, BoolFilter.ShowTrue); HttpContext.Current.Session[SystemConst.CategoryTreeViewLeftKey] = null; uxMessage.DisplayMessage(Resources.CategoryMessages.UpdateSuccess); InitParentDropDownList(); PopulateControls(); } } catch (Exception ex) { uxMessage.DisplayException(ex); } uxStatusHidden.Value = "Updated"; AdminUtilities.ClearSiteMapCache(); }
protected void uxImportButton_Click(object sender, EventArgs e) { uxMessagePanel.Controls.Clear(); string localFilePath = Server.MapPath("~/" + uxFileNameText.Text.Trim()); if (!File.Exists(localFilePath)) { Label label = new Label(); label.ForeColor = Color.Red; label.Text = "File not found."; uxMessagePanel.Controls.Add(label); return; } Culture culture = DataAccessContext.CultureRepository.GetOne(uxLanguageDrop.SelectedValue); ProductImporter importer = new ProductImporter(culture, new FileManager()); ProductImportStatus status; TimeSpan timeDiff; string storeID = CurrentStoreID; switch (uxModeRadioList.SelectedValue) { case "Purge": DataAccessContextDeluxe.PromotionProductRepository.DeleteAll(); DataAccessContextDeluxe.ProductSubscriptionRepository.DeleteAll(); status = importer.ImportProductPurgeAll( "~/" + uxFileNameText.Text.Trim(), uxImageProcessCheck.Checked, uxSkipImageProcessCheck.Checked, out timeDiff, storeID); UpdateMessage(status); UpdateTimeMessage(timeDiff, uxMessagePanel); break; case "Overwrite": status = importer.ImportProductOverwrite( "~/" + uxFileNameText.Text.Trim(), uxImageProcessCheck.Checked, uxSkipImageProcessCheck.Checked, out timeDiff, storeID); UpdateMessage(status); UpdateTimeMessage(timeDiff, uxMessagePanel); break; } AdminUtilities.ClearAllCache(); }
protected void uxGrid_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { string newPageID = ((TextBox)uxGrid.Rows[e.RowIndex].FindControl("uxPageIDText")).Text.Trim(); string newPath = ((TextBox)uxGrid.Rows[e.RowIndex].FindControl("uxPathText")).Text.Trim(); uxPageSource.UpdateParameters.Add("pageID", e.Keys["PageID"].ToString()); uxPageSource.UpdateParameters.Add("newPageID", newPageID); uxPageSource.UpdateParameters.Add("newPath", newPath); uxPageSource.Update(); // End editing uxGrid.EditIndex = -1; RefreshGrid(); uxMessage.DisplayMessage(Resources.LanguagePageMessages.UpdateSuccess); } catch (Exception ex) { string message; if (ex.InnerException is DuplicatedPrimaryKeyException) { message = Resources.LanguagePageMessages.UpdateErrorDuplicated; } else { message = Resources.LanguagePageMessages.UpdateError; } throw new ApplicationException(message); } finally { // Avoid calling Update() automatically by GridView e.Cancel = true; AdminUtilities.ClearLanguageCache(); } }
public void SetFooter(Object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Footer) { if (_table != null) { decimal total = 0; decimal numberOfOrder = 0; decimal quantity = 0; for (int x = 0; x < _table.Rows.Count; x++) { total += ConvertUtilities.ToDecimal(_table.Rows[x]["Total"].ToString()); numberOfOrder += ConvertUtilities.ToInt32(_table.Rows[x]["NumberOfOrder"].ToString()); quantity += ConvertUtilities.ToInt32(_table.Rows[x]["Quantity"].ToString()); } TableCellCollection cells = e.Row.Cells; cells[0].Text = " Total "; cells[0].HorizontalAlign = HorizontalAlign.Center; cells[0].Font.Bold = true; cells[1].CssClass = "TotalReport"; cells[1].Text = AdminUtilities.FormatPrice(total); cells[2].CssClass = "TotalQuantity"; cells[2].Text = "" + numberOfOrder; cells[3].CssClass = "TotalReport"; cells[3].Text = AdminUtilities.FormatPrice(total / numberOfOrder); cells[4].CssClass = "TotalQuantity"; cells[4].Text = "" + quantity; cells[5].CssClass = "TotalQuantity"; cells[5].Text = "" + (quantity / numberOfOrder); } } }
protected void uxGrid_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Add") { try { string pageID = ((TextBox)uxGrid.FooterRow.FindControl("uxPageIDText")).Text.Trim(); string path = ((TextBox)uxGrid.FooterRow.FindControl("uxPathText")).Text.Trim(); uxPageSource.InsertParameters.Add("pageID", pageID); uxPageSource.InsertParameters.Add("path", path); uxPageSource.Insert(); ((TextBox)uxGrid.FooterRow.FindControl("uxPageIDText")).Text = ""; ((TextBox)uxGrid.FooterRow.FindControl("uxPathText")).Text = ""; uxMessage.DisplayMessage(Resources.LanguagePageMessages.AddSuccess); } catch (Exception ex) { string message; if (ex.InnerException is DuplicatedPrimaryKeyException) { message = Resources.LanguagePageMessages.AddErrorDuplicated; } else { message = Resources.LanguagePageMessages.AddError; } throw new VevoException(message); } finally { } RefreshGrid(); AdminUtilities.ClearLanguageCache(); } }
protected void uxExecuteButton_Click(object sender, EventArgs e) { try { if (uxExecuteText.Text != "") { AdminUtilities.RemoveAllCacheInMemory(); DatabaseConverter databaseConverter = new DatabaseConverter(); databaseConverter.OnScriptExecuting(); DataAccess.ExecuteNonQueryNoParameter(uxExecuteText.Text.Trim()); databaseConverter.OnScriptExecuted(); // Update configurations DataAccessContext.ClearConfigurationCache(); ConfigurationHelper.ApplyConfigurations(); databaseConverter.Convert(); AdminUtilities.RemoveAllCacheInMemory(); // Set up PaymentModule // PaymentModuleSetup paymentModule = new PaymentModuleSetup(); // paymentModule.ProcessDatabaseConnected(); uxMessageLabel.ForeColor = System.Drawing.Color.Green; uxMessageLabel.Text = "<strong>Upgrade Completed</storng>"; } else { DisplatError("No command to execute."); } } catch (Exception ex) { DisplatError(ex.Message); } }
protected void uxShippingAddressImportButton_Click(object sender, EventArgs e) { uxImportShippingAddressMessagePanel.Controls.Clear(); string localFilePath = Server.MapPath("~/" + uxShippingAddressCsvFileNameText.Text.Trim()); if (!File.Exists(localFilePath)) { Label label = new Label(); label.ForeColor = Color.Red; label.Text = "File not found."; uxImportShippingAddressMessagePanel.Controls.Add(label); return; } CustomerImporter importer = new CustomerImporter(); CustomerImportStatus status = new CustomerImportStatus(); TimeSpan timeDiff; switch (uxShippingAddressImportModeRadioList.SelectedValue) { case "Purge": status = importer.ImportShippingAddressPurgeAll( "~/" + uxShippingAddressCsvFileNameText.Text.Trim(), out timeDiff); UpdateImportMessage(status, uxImportShippingAddressMessagePanel, false); UpdateTimeMessage(timeDiff, uxImportShippingAddressMessagePanel); break; case "Overwrite": status = importer.ImportShippingAddressOverWrite( "~/" + uxShippingAddressCsvFileNameText.Text.Trim(), out timeDiff); UpdateImportMessage(status, uxImportShippingAddressMessagePanel, false); UpdateTimeMessage(timeDiff, uxImportShippingAddressMessagePanel); break; default: break; } AdminUtilities.ClearAllCache(); }
private void AddBlogCategory() { try { if (Page.IsValid) { BlogCategory blogcategory = new BlogCategory(uxLanguageControl.CurrentCulture); blogcategory = SetUpBlogCategory(blogcategory); blogcategory = DataAccessContext.BlogCategoryRepository.Save(blogcategory); uxMessage.DisplayMessage(Resources.BlogMessage.AddSuccess); ClearInputFields(); } } catch (Exception ex) { uxMessage.DisplayException(ex); } uxStatusHidden.Value = "Added"; AdminUtilities.ClearSiteMapCache(); }
private void AddManufacturer() { try { if (Page.IsValid) { Manufacturer manufacturer = new Manufacturer(uxLanguageControl.CurrentCulture); manufacturer = SetUpManufacturer(manufacturer); manufacturer = DataAccessContext.ManufacturerRepository.Save(manufacturer); uxMessage.DisplayMessage(Resources.ManufacturerMessages.AddSuccess); ClearInputFields(); } } catch (Exception ex) { uxMessage.DisplayException(ex); } uxStatusHidden.Value = "Added"; AdminUtilities.ClearSiteMapCache(); }
private void UpdateManufacturer() { try { if (Page.IsValid) { Manufacturer manufacturer = DataAccessContext.ManufacturerRepository.GetOne( uxLanguageControl.CurrentCulture, CurrentID); manufacturer = SetUpManufacturer(manufacturer); manufacturer = DataAccessContext.ManufacturerRepository.Save(manufacturer); uxMessage.DisplayMessage(Resources.CategoryMessages.UpdateSuccess); PopulateControls(); } } catch (Exception ex) { uxMessage.DisplayException(ex); } uxStatusHidden.Value = "Updated"; AdminUtilities.ClearSiteMapCache(); }
private void AddCategory() { try { if (Page.IsValid) { Category category = new Category(uxLanguageControl.CurrentCulture); category = SetUpCategory(category); category = DataAccessContext.CategoryRepository.Save(category); HttpContext.Current.Session[SystemConst.CategoryTreeViewLeftKey] = null; uxMessage.DisplayMessage(Resources.CategoryMessages.AddSuccess); ClearInputFields(); } } catch (Exception ex) { uxMessage.DisplayException(ex); } uxStatusHidden.Value = "Added"; AdminUtilities.ClearSiteMapCache(); }
protected void uxUpdateButton_Click(object sender, EventArgs e) { if (DataAccessContext.Configurations.GetValue("BaseWebsiteCurrency") == CurrentCurrencyCode) { if (uxIsEnabledCheck.Checked == false) { uxMessage.DisplayError(Resources.CurrencyMessages.UpdateDefaultError); return; } } try { Currency currency = DataAccessContext.CurrencyRepository.GetOne(CurrentCurrencyCode); currency = SetUpCurrency(currency); DataAccessContext.CurrencyRepository.Save(currency, uxCurrencyCodeText.Text.Trim()); if (DataAccessContext.Configurations.GetValue("BaseWebsiteCurrency") == CurrentCurrencyCode && uxCurrencyCodeText.Text != CurrentCurrencyCode) { DataAccessContext.ConfigurationRepository.UpdateValue(DataAccessContext.Configurations["BaseWebsiteCurrency"], uxCurrencyCodeText.Text); AdminUtilities.LoadSystemConfig(); } AdminUtilities.ClearCurrencyCache(); uxMessage.DisplayMessage(Resources.CurrencyMessages.UpdateSuccess); CurrentCurrencyCode = uxCurrencyCodeText.Text.Trim(); PopulateControl(); } catch (Exception ex) { uxMessage.DisplayException(ex); } }
private void AddDepartment() { try { if (Page.IsValid) { Department department = new Department(uxLanguageControl.CurrentCulture); department = SetUpDepartment(department); department = DataAccessContext.DepartmentRepository.Save(department); HttpContext.Current.Session[SystemConst.DepartmentTreeViewLeftKey] = null; uxMessage.DisplayMessage(Resources.DepartmentMessages.AddSuccess); ClearInputFields(); } } catch (Exception ex) { uxMessage.DisplayException(ex); } uxStatusHidden.Value = "Added"; AdminUtilities.ClearSiteMapCache(); }
protected void uxUpdateConfigButton_Click(object sender, EventArgs e) { try { if (Page.IsValid) { string message; if (VerifyStateCountry(out message)) { UpdateShippingMethod(); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExMerchantZip"], uxMerchantZipText.Text); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExMerchantState"], uxStateList.CurrentSelected); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExMerchantCountry"], uxCountryList.CurrentSelected); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExKey"], uxKeyText.Text); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExPassword"], uxPasswordText.Text); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExAccountNumber"], uxAccountNumberText.Text); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExMeterNumber"], uxMeterNumberText.Text); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExUrl"], uxFedExTestModeDrop.SelectedValue); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExRateRequest"], uxRateRequestDrop.SelectedValue); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExIncludeInsurance"], uxInsuranceValueDrop.SelectedValue); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExCustoms"], uxCustomsDrop.SelectedValue); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExServiceEnabled"], GetServiceSelected(uxFedExServiceCheckList)); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExFreeShippingCostService"], GetServiceSelected(uxFreeShippingServiceCheckList)); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExFreeShipping"], uxFreeShippingDrop.SelectedValue); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExFreeShippingCost"], Currency.ConvertPriceToUSFormat(uxFreeShippingCostText.Text)); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExDropoffType"], uxDropoffTypeDrop.SelectedValue); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExPackingType"], uxPickupTypeDrop.SelectedValue); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExUseMinOrderWeight"], uxMinimumWeightDrop.SelectedValue); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExMinOrderWeight"], uxMinimumWeightText.Text); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExMarkup"], Currency.ConvertPriceToUSFormat(uxMarkupText.Text)); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExServiceAllowedSetFree"], GetServiceSelected(uxFedExAllowedSetFreeCheckList)); DataAccessContext.ConfigurationRepository.UpdateValue( DataAccessContext.Configurations["RTShippingFedExServiceAllowedUseCouponFree"], GetServiceSelected(uxFedExAllowedUseFreeCouponCheckList)); AdminUtilities.LoadSystemConfig(); uxMessage.DisplayMessage(Resources.ShippingMessages.UpdateSuccess); PopulateControls(); } else { uxMessage.DisplayError(message); } } } catch (Exception ex) { uxMessage.DisplayException(ex); } }