/// <summary> /// Delete page specfic place holder /// </summary> /// <param name="pageSpecificPlaceholderId"></param> /// <param name="pageSpecificPlaceholder"></param> /// <returns></returns> public bool DeletePageSpecificPlaceholderConfig(int pageSpecificPlaceholderId, SolutionEnums.PageSpecificPlaceholder pageSpecificPlaceholder) { int result = 0; using (var fpCofigDataContext = new FPConfigEntities()) { var pageSpecificTempletePlaceHolder = fpCofigDataContext.tblPageSpecificPlaceholderConfigs.Find(pageSpecificPlaceholderId); switch (pageSpecificPlaceholder) { case SolutionEnums.PageSpecificPlaceholder.Top: pageSpecificTempletePlaceHolder.TopFrameHTML = string.Empty; break; case SolutionEnums.PageSpecificPlaceholder.Left: pageSpecificTempletePlaceHolder.LeftFrameHTML = string.Empty; break; case SolutionEnums.PageSpecificPlaceholder.Right: pageSpecificTempletePlaceHolder.RightFrameHTML = string.Empty; break; case SolutionEnums.PageSpecificPlaceholder.Bottom: pageSpecificTempletePlaceHolder.BottomFrameHTML = string.Empty; break; } result = fpCofigDataContext.SaveChanges(); } return true; }
/// <summary> /// Delete page specfic place holder to set empty string to place holder /// </summary> /// <param name="pageSpecificPlaceholderId"></param> /// <param name="pageSpecificPlaceholder"></param> /// <returns></returns> public bool DeletePageSpecificPlaceholderConfig(int pageSpecificPlaceholderId, SolutionEnums.PageSpecificPlaceholder pageSpecificPlaceholder) { var pageSpecificPlaceholderConfigBLL = new PageSpecificPlaceholderConfigBLL(); return pageSpecificPlaceholderConfigBLL.DeletePageSpecificPlaceholderConfig(pageSpecificPlaceholderId, pageSpecificPlaceholder); }
/// <summary> /// Save template to temporary phisical folder /// </summary> /// <param name="template"></param> private string SaveTemplate(HttpPostedFileBase template, string moduleName, SolutionEnums.PageSpecificPlaceholder modulePart) { string fileName = template.FileName; string directoryTemplatePath = Server.MapPath(ConfigurationManager.AppSettings["StaticHtmlPageDirectory"]); directoryTemplatePath = Path.Combine(directoryTemplatePath, moduleName, modulePart.ToString()); if (!Directory.Exists(directoryTemplatePath)) { Directory.CreateDirectory(directoryTemplatePath); } string templatePath = Path.Combine(directoryTemplatePath, fileName); template.SaveAs(templatePath); return fileName; }
/// <summary> /// Delete template to temporary phisical folder /// </summary> /// <param name="template"></param> private void DeleteTemplate(string moduleName, SolutionEnums.PageSpecificPlaceholder modulePart) { string directoryTemplatePath = Server.MapPath(ConfigurationManager.AppSettings["StaticHtmlPageDirectory"]); directoryTemplatePath = Path.Combine(directoryTemplatePath, moduleName, modulePart.ToString()); if (Directory.Exists(directoryTemplatePath)) { Directory.Delete(directoryTemplatePath, true); } }