protected void dlItems_ItemCommand(object source, ListViewCommandEventArgs e) { string stringId = e.CommandArgument.ToString(); if (e.CommandName == "Add") { var message = TemplateService.GetTemplateArchiveFromRemoteServer(stringId); if (!message.IsNullOrEmpty()) { MsgErr(true); MsgErr(message); } } if (e.CommandName == "Delete") { UninstallTemplate(stringId); SettingsDesign.ChangeTemplate(_default); CacheManager.Clean(); } if (e.CommandName == "ApplyTheme") { SettingsDesign.ChangeTemplate(stringId); CacheManager.Clean(); } }
public new void SaveData() { if (!(Demo.IsDemoEnabled || TrialService.IsTrialEnabled)) { SettingsLic.LicKey = txtKey.Text; } if (!TemplateService.IsExistTemplate(SettingsDesign.Template)) { SettingsDesign.ChangeTemplate(TemplateService.DefaultTemplateId); } SettingsMain.ShopName = txtShopName.Text; SettingsMain.SiteUrl = txtUrl.Text; SettingsMain.LogoImageAlt = txtShopName.Text; if (fuLogo.HasFile) { FileHelpers.CreateDirectory(FoldersHelper.GetPathAbsolut(FolderType.Pictures)); FileHelpers.DeleteFile(FoldersHelper.GetPathAbsolut(FolderType.Pictures, SettingsMain.LogoImageName)); SettingsMain.LogoImageName = fuLogo.FileName; fuLogo.SaveAs(FoldersHelper.GetPathAbsolut(FolderType.Pictures, fuLogo.FileName)); } if (fuFavicon.HasFile) { FileHelpers.CreateDirectory(FoldersHelper.GetPathAbsolut(FolderType.Pictures)); FileHelpers.DeleteFile(FoldersHelper.GetPathAbsolut(FolderType.Pictures, SettingsMain.FaviconImageName)); SettingsMain.FaviconImageName = fuFavicon.FileName; fuLogo.SaveAs(FoldersHelper.GetPathAbsolut(FolderType.Pictures, fuFavicon.FileName)); } //SettingsSEO.DefaultMetaTitle = txtTitle.Text; //SettingsSEO.DefaultMetaDescription = txtMetadescription.Text; //SettingsSEO.DefaultMetaKeywords = txtMetakeywords.Text; var countryId = 0; int.TryParse(ddlCountry.SelectedValue, out countryId); SettingsMain.SellerCountryId = countryId; var regionId = RegionService.GetRegionIdByName(txtRegion.Text); SettingsMain.SellerRegionId = regionId; SettingsMain.City = txtCity.Text; SettingsMain.Phone = txtPhone.Text; SettingsBank.Director = txtDirector.Text; SettingsBank.Accountant = txtAccountant.Text; SettingsBank.Manager = txtManager.Text; }
private void UninstallTemplate(string templateName) { if (templateName == _default) { return; } MsgErr(true); try { SettingsDesign.ChangeTemplate(_default); FileHelpers.DeleteDirectory(Server.MapPath("~/Templates/" + templateName)); MsgErr(Resource.Admin_Templates_UninstallSuccess); } catch (Exception ex) { Debug.LogError(ex); MsgErr(Resource.Admin_Templates_UninstallFail); } }