/// <summary> /// Returns a File selector element that is represented by the specified expression. /// </summary> /// <typeparam name="TModel"></typeparam> /// <typeparam name="TProperty"></typeparam> /// <param name="htmlHelper"></param> /// <param name="expression"></param> /// <param name="resourceType"></param> /// <param name="className"></param> /// <param name="labelTooltip"></param> /// <returns></returns> public static MvcHtmlString BootstrapFilePathFor <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, string resourceType = "", string className = "", string labelTooltip = "") { GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); StringBuilder sb = new StringBuilder(); sb.AppendLine("<div class=\"form-group\">"); if (labelTooltip.IsNotEmptyOrWhiteSpace()) { sb.AppendLine(htmlHelper.LabelFor(expression, new { @data_toggle = "tooltip", @data_placement = "top", @title = labelTooltip }).ToString()); } else { sb.AppendLine(htmlHelper.LabelFor(expression).ToString()); } sb.AppendLine("<div class=\"input-group\">"); string placeholder = HttpUtility.HtmlDecode(htmlHelper.DisplayNameFor(expression).ToHtmlString()); if (className.IsNotEmptyOrWhiteSpace()) { className = " " + className; } sb.AppendLine(htmlHelper.TextBoxFor(expression, new { @class = "form-control ckfinder-file-textbox" + className, @placeholder = placeholder, @readonly = "readonly" }).ToString()); sb.AppendLine(htmlHelper.ValidationMessageFor(expression).ConvertTo <string>("", true)); sb.AppendLine("<span class=\"input-group-addon btn ckfinder-file-remove\" data-ckfinder-file=\"" + (expression.Body as MemberExpression).Member.Name + "\"><i class=\"fa fa-times\"></i></span>"); sb.AppendLine("<span class=\"input-group-addon btn ckfinder-file\" data-ckfinder-resourcetype=\"" + resourceType + "\" data-ckfinder-file=\"" + (expression.Body as MemberExpression).Member.Name + "\"><i class=\"fa fa-picture-o\"></i></span>"); sb.AppendLine("</div></div>"); sb.AppendLine("<img id=\"ckfinder-img-preview-" + (expression.Body as MemberExpression).Member.Name + "\" class=\"img-responsive hidden\" />"); sb.AppendLine("<div id=\"ckfinder-swf-preview-" + (expression.Body as MemberExpression).Member.Name + "\" class=\"hidden\"></div>"); sb.AppendLine("<a id=\"ckfinder-file-preview-" + (expression.Body as MemberExpression).Member.Name + "\" class=\"hidden\" target=\"_blank\"><i class=\"fa fa-external-link fa-3x\"></i></a>"); return(new MvcHtmlString(sb.ToString())); }
protected void Session_Start() { if (IsApplicationStart) { if (ConfigurationManager.ConnectionStrings["MainConnectionString"].IsNotNull()) { AdoHelper.ConnectionString = ConfigurationManager.ConnectionStrings["MainConnectionString"].ConnectionString; GlobalConfigurations.RegisterEmailHelper(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); //Removes Installation route if (RouteTable.Routes["Installation"].IsNotNull()) { RouteTable.Routes.Remove(RouteTable.Routes["Installation"]); } RouteConfig.RegisterRoutes(RouteTable.Routes); } IsApplicationStart = false; //After RouteConfig.RegisterRoutes was moved to Session_Start was introduced the following bug: // - If the first page hit on Application start was different from the home page a 404 error was raised. //To avoid the above issue it is necessary to restart the session using the following code. Session.Abandon(); Response.Redirect(Request.Url.AbsoluteUri); } }
/// <summary> /// Returns a File selector element that is represented by the specified expression. /// </summary> /// <typeparam name="TModel"></typeparam> /// <typeparam name="TProperty"></typeparam> /// <param name="htmlHelper"></param> /// <param name="expression"></param> /// <param name="resourceType"></param> /// <param name="className"></param> /// <param name="labelTooltip"></param> /// <returns></returns> public static MvcHtmlString BootstrapMultiFilePathFor <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, string resourceType = "", string className = "", string labelTooltip = "") { GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); StringBuilder sb = new StringBuilder(); sb.AppendLine("<div class=\"form-group\">"); if (labelTooltip.IsNotEmptyOrWhiteSpace()) { sb.AppendLine(htmlHelper.LabelFor(expression, new { @data_toggle = "tooltip", @data_placement = "top", @title = labelTooltip }).ToString()); } else { sb.AppendLine(htmlHelper.LabelFor(expression).ToString()); } sb.AppendLine("<div class=\"input-group\">"); string placeholder = HttpUtility.HtmlDecode(htmlHelper.DisplayNameFor(expression).ToHtmlString()); if (className.IsNotEmptyOrWhiteSpace()) { className = " " + className; } sb.AppendLine(htmlHelper.TextBoxFor(expression, new { @class = "form-control tokenfield-multifilepath" + className, @placeholder = placeholder }).ToString()); sb.AppendLine(htmlHelper.ValidationMessageFor(expression).ConvertTo <string>("", true)); sb.AppendLine("<span class=\"input-group-addon btn ckfinder-file-multiple\" data-ckfinder-resourcetype=\"" + resourceType + "\" data-ckfinder-file=\"" + (expression.Body as MemberExpression).Member.Name + "\"><i class=\"fa fa-picture-o\"></i></span>"); sb.AppendLine("</div></div>"); return(new MvcHtmlString(sb.ToString())); }
public ActionResult SubscriptionsEdit(string id) { GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); BackEndSubscriptionsEdit backEndSubscriptionsEdit = new BackEndSubscriptionsEdit(); Subscriptions subscriptions = new Subscriptions(); Subscription subscription = subscriptions.GetSubscriptionByEmail(id); if (subscription.IsNotNull()) { backEndSubscriptionsEdit.Email = subscription.Email; backEndSubscriptionsEdit.FirstName = subscription.FirstName; backEndSubscriptionsEdit.LastName = subscription.LastName; backEndSubscriptionsEdit.Birthdate = subscription.BirthDate.ToDateTimeString(); backEndSubscriptionsEdit.PhoneNumber = subscription.PhoneNumber; backEndSubscriptionsEdit.Address = subscription.Address; backEndSubscriptionsEdit.City = subscription.City; backEndSubscriptionsEdit.PostCode = subscription.PostCode; backEndSubscriptionsEdit.CountryCode = subscription.CountryCode; backEndSubscriptionsEdit.SubscriptionStatusId = subscription.SubscriptionStatusId; backEndSubscriptionsEdit.WantsNewsletter = subscription.WantsNewsletter; backEndSubscriptionsEdit.JoinDate = subscription.JoinDate.ToDateTimeString(); backEndSubscriptionsEdit.Notes = subscription.Notes; } else { ModelState.AddResult(ViewData, ModelStateResult.Error, Resources.Strings.ItemDoesNotExist); ViewData.IsFormVisible(false); } return(View(backEndSubscriptionsEdit)); }
/// <summary> /// Returns a TimePicker element that is represented by the specified expression. /// </summary> /// <typeparam name="TModel"></typeparam> /// <typeparam name="TProperty"></typeparam> /// <param name="htmlHelper"></param> /// <param name="expression"></param> /// <param name="className"></param> /// <param name="labelTooltip"></param> /// <returns></returns> public static MvcHtmlString BootstrapTimePickerFor <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, string className = "", string labelTooltip = "") { GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); StringBuilder sb = new StringBuilder(); sb.AppendLine("<div class=\"form-group\">"); if (labelTooltip.IsNotEmptyOrWhiteSpace()) { sb.AppendLine(htmlHelper.LabelFor(expression, new { @data_toggle = "tooltip", @data_placement = "top", @title = labelTooltip }).ToString()); } else { sb.AppendLine(htmlHelper.LabelFor(expression).ToString()); } sb.AppendLine("<div class=\"input-group date time-picker\" data-date-format=\"" + globalConfiguration.DateFormat.ToUpper() + "\" >"); string placeholder = HttpUtility.HtmlDecode(htmlHelper.DisplayNameFor(expression).ToHtmlString()); if (className.IsNotEmptyOrWhiteSpace()) { className = " " + className; } sb.AppendLine(htmlHelper.TextBoxFor(expression, new { @class = "form-control" + className, @placeholder = placeholder }).ToString()); sb.AppendLine(htmlHelper.ValidationMessageFor(expression).ConvertTo <string>("", true)); sb.AppendLine("<span class=\"input-group-addon btn\"><i class=\"fa fa-clock-o\"></i></span></div></div>"); return(new MvcHtmlString(sb.ToString())); }
public static IHtmlString GetFooterMenu(this HtmlHelper htmlHelper, FrontEndCmsPage model, string className = "nav nav-pills") { string footerMenu = string.Empty; List <CmsPage> pagesObj = new CmsPages().GetAllPages(); if (pagesObj != null) { pagesObj = (from page in pagesObj where page.ShowInBottomMenu && page.IsActive select page).ToList(); if (pagesObj != null && pagesObj.Count > 0) { footerMenu += "<ul class=\"" + className + "\">"; string url; GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); PagesLanguages backEndCmsPagesContent = new PagesLanguages(); PageLanguage backEndCmsPageLanguage; string pageTitle = string.Empty; foreach (CmsPage pageObj in pagesObj) { backEndCmsPageLanguage = backEndCmsPagesContent.GetPageLanguage(pageObj.PageId, model.LanguageCode); if (backEndCmsPageLanguage.IsNotNull() && backEndCmsPageLanguage.MenuName.IsNotEmptyOrWhiteSpace()) { pageTitle = backEndCmsPageLanguage.MenuName; } else { pageTitle = pageObj.PageName; } if (pageObj.PageTemplateId.IsNull()) { url = pageObj.Url; } else { url = "/"; if (!pageObj.IsHomePage || model.LanguageCode != globalConfiguration.DefaultLanguageCode) { if (pageObj.IsHomePage) { url += model.LanguageCode + "/"; } else { url += model.LanguageCode + "/" + pageObj.FullSegment + "/"; } } } footerMenu += "<li><a href=\"" + url + "\" target=\"" + pageObj.Target + "\" title=\"" + pageTitle + "\">" + pageTitle + "</a></li>"; } footerMenu += "</ul>"; } } return(htmlHelper.Raw(footerMenu)); }
public ActionResult GlobalConfiguration(BackEndGlobalConfigurationEdit backEndGlobalConfigurationEdit) { GlobalConfigurations backEndGlobalConfigurations = new GlobalConfigurations(); GlobalConfiguration globalConfiguration = backEndGlobalConfigurations.GetGlobalConfiguration(); int?result = backEndGlobalConfigurations.Edit( backEndGlobalConfigurationEdit.SiteName, backEndGlobalConfigurationEdit.MetaTitle, backEndGlobalConfigurationEdit.MetaKeywords, backEndGlobalConfigurationEdit.MetaDescription, backEndGlobalConfigurationEdit.Robots, backEndGlobalConfigurationEdit.NotificationEmail, backEndGlobalConfigurationEdit.IsCanonicalizeActive, backEndGlobalConfigurationEdit.HostNameLabel, backEndGlobalConfigurationEdit.DomainName, backEndGlobalConfigurationEdit.BingVerificationCode, backEndGlobalConfigurationEdit.GoogleVerificationCode, backEndGlobalConfigurationEdit.GoogleAnalyticsTrackingCode, backEndGlobalConfigurationEdit.GoogleSearchCode, backEndGlobalConfigurationEdit.IsOffline, backEndGlobalConfigurationEdit.OfflineCode, backEndGlobalConfigurationEdit.ServerTimeZone, backEndGlobalConfigurationEdit.DateFormat, backEndGlobalConfigurationEdit.TimeFormat, backEndGlobalConfigurationEdit.DefaultLanguageCode, backEndGlobalConfigurationEdit.DefaultErrorPageTemplateId, backEndGlobalConfigurationEdit.WhiteList); switch (result) { case 0: if (globalConfiguration.HostNameLabel != backEndGlobalConfigurationEdit.HostNameLabel) { //Updates RouteTable using (RouteTable.Routes.GetWriteLock()) { RouteTable.Routes.Clear(); RouteConfig.RegisterRoutes(RouteTable.Routes); } } ModelState.AddResult(ViewData, ModelStateResult.Success, Resources.Strings.ItemSuccessfullyEdited); break; case 2: ModelState.AddResult(ViewData, ModelStateResult.Error, Resources.Strings.ItemDoesNotExist); ViewData.IsFormVisible(false); break; default: ModelState.AddResult(ViewData, ModelStateResult.Error, Resources.Strings.UnexpectedError); break; } return(View(backEndGlobalConfigurationEdit)); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); GlobalConfigurations.AddIinstance(); IOperations Execute = GlobalConfigurations.Iinstance; Application.Run(new Form1(Execute)); GlobalConfigurations.RemoveIinstance(); }
/// <summary> /// /// </summary> /// <param name="str"></param> /// <returns></returns> public static string ReplaceGlobalTokens(this string str) { string result = str; GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); result = result.ReplaceWith(@"{\$DomainName}", globalConfiguration.DomainName, RegexOptions.IgnoreCase); result = result.ReplaceWith(@"{\$SiteName}", globalConfiguration.SiteName, RegexOptions.IgnoreCase); return(result); }
/// <summary> /// Converts a domain name into a fully qualified Url. /// <para>E.g. mydomainname.com becomes http://www.mydomainname.com</para> /// </summary> /// <param name="domainName">E.g. mydomainname.com</param> /// <returns></returns> public static string ToUrl(this string domainName) { string result; GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); UriBuilder uriBuilder = new UriBuilder(globalConfiguration.HostNameLabel + domainName); result = uriBuilder.Uri.AbsoluteUri; return(result); }
public ActionResult Index(FrontEndCmsPage page) { GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); FrontEndError error = new FrontEndError() { LanguageFolder = page.LanguageFolder, StatusCode = page.StatusCode.ConvertTo <int>(), ErroMessage = ("Error" + page.StatusCode.ConvertTo <int>().ToString()).GetStringFromResource() }; return(View(error)); }
public ActionResult Index(FrontEndCmsPage page, string k) { FrontEndSubscriptionRegister frontEndSubscriptionRegister = new FrontEndSubscriptionRegister() { LangugeCode = page.LanguageCode }; ViewBag.IsActivationPage = false; if (k.IsNotEmptyOrWhiteSpace()) { ViewBag.IsActivationPage = true; Subscriptions subscriptions = new Subscriptions(); int? result = subscriptions.ActivativateSubscription(k); switch (result) { case 0: Subscription subscription = subscriptions.GetSubscriptionByActivationKey(k); GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); CultureInfoHelper.ForceBackEndLanguage(); string subject = Resources.Strings_Subscription.EmailSubscriptionAddedSubject.Replace("{$Url}", globalConfiguration.DomainName.ToUrl()); string body = Resources.Strings_Subscription.EmailSubscriptionAddedBody .Replace("{$Url}", globalConfiguration.DomainName.ToUrl()) .Replace("{$subscriptionEmail}", subscription.Email) .Replace("{$ipAddress}", Request.UserHostAddress); CultureInfoHelper.RestoreFrontEndLanguage(); EmailHelper email = new EmailHelper(globalConfiguration.NotificationEmail, globalConfiguration.NotificationEmail, subject, body); email.Send(); ViewBag.ActivationResult = Resources.Strings_Subscription.ActivationKeySuccess; break; case 2: ViewBag.ActivationResult = Resources.Strings_Subscription.ActivationKeyInvalid; break; case 3: ViewBag.ActivationResult = Resources.Strings_Subscription.ActivationKeyAlreadyUsed; break; default: ViewBag.ActivationResult = Resources.Strings.UnexpectedError; break; } } return(View(frontEndSubscriptionRegister)); }
public ActionResult Index(FrontEndCmsPage page, FrontEndSubscriptionPasswordForgot frontEndSubscriptionPasswordForgot) { if (ModelState.IsValidOrRefresh()) { Subscriptions subscriptions = new Subscriptions(); Subscription subscription = subscriptions.GetSubscriptionByEmail(frontEndSubscriptionPasswordForgot.Email); if (subscription.IsNotNull()) { string PasswordResetKey = DateTime.Now.Ticks.ToBase36() + frontEndSubscriptionPasswordForgot.Email.EncodeBase64() + Session.SessionID; int?result = subscriptions.EditPasswordResetKey(frontEndSubscriptionPasswordForgot.Email, PasswordResetKey); switch (result) { case 0: GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); string subject = Resources.Strings_Subscription.EmailPwForgotSubject.Replace("{$SiteName}", globalConfiguration.SiteName); string body = Resources.Strings_Subscription.EmailPwForgotBody .Replace("{$FirstName}", subscription.FirstName) .Replace("{$SiteName}", globalConfiguration.SiteName) .Replace("{$PasswordResetUrl}", globalConfiguration.DomainName.ToUrl() + page.LanguageCode + "/reset-password?PasswordResetKey=" + PasswordResetKey) .Replace("{$Url}", globalConfiguration.DomainName.ToUrl()); EmailHelper email = new EmailHelper("subscription-pw-reset@" + globalConfiguration.DomainName, frontEndSubscriptionPasswordForgot.Email, subject, body); if (email.Send()) { ModelState.AddResult(ViewData, ModelStateResult.Success, Resources.Strings.FormSuccessfullySubmitted); ViewData.IsFormVisible(false); } else { ModelState.AddResult(ViewData, ModelStateResult.Error, Resources.Strings.UnexpectedError + " (Email)"); } break; case 2: ModelState.AddResult(ViewData, ModelStateResult.Error, Resources.Strings_Subscription.SubscriptionEmailNotValid); break; default: ModelState.AddResult(ViewData, ModelStateResult.Error, Resources.Strings.UnexpectedError + " (Database)"); break; } } else { ModelState.AddResult(ViewData, ModelStateResult.Error, Resources.Strings_Subscription.SubscriptionEmailNotValid); } } return(View(frontEndSubscriptionPasswordForgot)); }
private SyndicationFeed GetSyndicationFeed(string langCode) { Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(langCode); SyndicationFeed result = new SyndicationFeed(); NewsConfiguration newsConfiguration = new NewsConfigurations().GetNewsConfiguration(); if (newsConfiguration.IsNewsActive && newsConfiguration.NewsPageId.IsNotNull()) { CmsPages cmsPages = new CmsPages(); CmsPageActionlink cmsPageActionlink = cmsPages.GetCmsPageActionlink(newsConfiguration.NewsPageId, langCode); News news = new News(); List <SingleNews> newsList = news.GetNews( langCode, isActive: true, isCategoryActive: true ).OrderByDescending(i => i.NewsDate).Take(10).ToList(); if (newsList.IsNotNull()) { GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); result = new SyndicationFeed( Resources.Strings_News.NewsFeedTitle.Replace("{$SiteName}", globalConfiguration.SiteName), Resources.Strings_News.NewsFeedDescription.Replace("{$SiteName}", globalConfiguration.SiteName), Request.Url, Guid.NewGuid().ToString(), DateTime.Now); List <SyndicationItem> items = new List <SyndicationItem>(); SyndicationItem item; foreach (SingleNews singleNews in newsList) { item = new SyndicationItem( singleNews.NewsTitle, singleNews.NewsContent.StripHtml().TrimToMaxLength(255, "..."), new Uri(Request.Url.Scheme + "://" + Request.Url.Authority + cmsPageActionlink.Url + singleNews.NewsId + "-" + singleNews.NewsTitle.ToFriendlyUrlDashedString() + "/"), singleNews.NewsId.ToString(), singleNews.NewsDate); items.Add(item); } result.Items = items; } } return(result); }
private static void BuildBreadCrumbs(CmsPages pages, PagesLanguages pageLanguages, ref string breadCrumbs, int?pageId, string langCode, string separator, bool isPreviousHomePage) { CmsPage page = pages.GetPageByPageId(pageId); if (page.IsNotNull()) { PageLanguage pageLanguage = pageLanguages.GetPageLanguage(pageId, langCode); string title = page.PageName; if (pageLanguage.IsNotNull() && pageLanguage.MenuName.IsNotEmptyOrWhiteSpace()) { title = pageLanguage.MenuName; } if (breadCrumbs.IsEmptyOrWhiteSpace()) { breadCrumbs = "<li class=\"active\">" + title + "</li>"; } else { GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); string url = "/"; if (!page.IsHomePage || langCode != globalConfiguration.DefaultLanguageCode) { if (page.IsHomePage) { url += langCode + "/"; } else { url += langCode + "/" + page.FullSegment + "/"; } } breadCrumbs = "<li><a href=\"" + url + "\">" + title + "</a></li>" + breadCrumbs; } BuildBreadCrumbs(pages, pageLanguages, ref breadCrumbs, page.PageParentId, langCode, separator, page.IsHomePage); } else if (page.IsNull() && !isPreviousHomePage) { page = pages.GetHomePage(); if (page.IsNotNull()) { BuildBreadCrumbs(pages, pageLanguages, ref breadCrumbs, page.PageId, langCode, separator, page.IsHomePage); } } }
public ActionResult Index(FrontEndCmsPage page, FrontEndContact frontEndContact) { if (ModelState.IsValidOrRefresh()) { if (frontEndContact.Notes.IsEmpty()) //Honey pot to avoid spammers { GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); CultureInfoHelper.ForceBackEndLanguage(); string subject = Resources.Strings_Contact.EmailSubject.Replace("{$Url}", globalConfiguration.DomainName.ToUrl()); string body = Resources.Strings_Contact.EmailBody .Replace("{$fullName}", frontEndContact.FullName) .Replace("{$companyName}", frontEndContact.CompanyName) .Replace("{$phoneNumber}", frontEndContact.PhoneNumber) .Replace("{$email}", frontEndContact.Email) .Replace("{$message}", frontEndContact.Message) .Replace("{$ipAddress}", Request.UserHostAddress) .Replace("{$Url}", globalConfiguration.DomainName.ToUrl()); CultureInfoHelper.RestoreFrontEndLanguage(); EmailHelper email = new EmailHelper(globalConfiguration.NotificationEmail, globalConfiguration.NotificationEmail, subject, body); email.ReplyToList.Add(frontEndContact.Email); if (email.Send()) { ModelState.AddResult(ViewData, ModelStateResult.Success, Resources.Strings_Contact.Thanks); ViewData.IsFormVisible(false); } else { ModelState.AddResult(ViewData, ModelStateResult.Error, Resources.Strings.UnexpectedError); } } else { ModelState.AddResult(ViewData, ModelStateResult.Success, Resources.Strings_Contact.Thanks); ViewData.IsFormVisible(false); } } return(View(frontEndContact)); }
public PaymentToSupplierApplyListDAL() { try { GlobalConfigurations objConfig = new GlobalConfigurations(); objConfig.InitilizeConnectionString(); connectionString = objConfig.connectionString; commandTimeout = Convert.ToInt32(objConfig.commandTimeout); } catch (Exception exp) { logExcpUIobj.MethodName = "PaymentToSupplierApplyListDAL()"; logExcpUIobj.ResourceName = "PaymentToSupplierApplyListDAL.CS"; logExcpUIobj.RecordId = ""; logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString(); logExcpDALobj.SaveExceptionToDB(logExcpUIobj); throw new Exception("[PaymentToSupplierApplyListDAL : PaymentToSupplierApplyListDAL] ERROR: An error occured while connection to staging database. Please check the connection settings : [" + exp.ToString() + "]"); } }
/// <summary> /// Converts the specified string representation of a date (or a date time) to its DateTime equivalent using the Global Configuration Date Format and Time Format /// </summary> /// <param name="date"></param> /// <returns></returns> public static DateTime?ToDateTime(this string date) { DateTime?result = null; GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); string format = globalConfiguration.DateFormat; if (date.IfEmpty("").Length > 10) { format = globalConfiguration.DateFormat + " " + globalConfiguration.TimeFormat; } DateTime tempResult; if (DateTime.TryParseExact(date, format, CultureInfo.InvariantCulture, DateTimeStyles.None, out tempResult)) { result = tempResult; } return(result); }
public ActionResult GlobalConfiguration() { BackEndGlobalConfigurationEdit backEndGlobalConfigurationEdit = new BackEndGlobalConfigurationEdit(); GlobalConfigurations backEndGlobalConfigurations = new GlobalConfigurations(); GlobalConfiguration globalConfiguration = backEndGlobalConfigurations.GetGlobalConfiguration(); if (globalConfiguration.IsNotNull()) { backEndGlobalConfigurationEdit.SiteName = globalConfiguration.SiteName; backEndGlobalConfigurationEdit.MetaTitle = globalConfiguration.MetaTitle; backEndGlobalConfigurationEdit.MetaKeywords = globalConfiguration.MetaKeywords; backEndGlobalConfigurationEdit.MetaDescription = globalConfiguration.MetaDescription; backEndGlobalConfigurationEdit.Robots = globalConfiguration.Robots; backEndGlobalConfigurationEdit.NotificationEmail = globalConfiguration.NotificationEmail; backEndGlobalConfigurationEdit.IsCanonicalizeActive = globalConfiguration.IsCanonicalizeActive; backEndGlobalConfigurationEdit.HostNameLabel = globalConfiguration.HostNameLabel; backEndGlobalConfigurationEdit.DomainName = globalConfiguration.DomainName; backEndGlobalConfigurationEdit.BingVerificationCode = globalConfiguration.BingVerificationCode; backEndGlobalConfigurationEdit.GoogleVerificationCode = globalConfiguration.GoogleVerificationCode; backEndGlobalConfigurationEdit.GoogleAnalyticsTrackingCode = globalConfiguration.GoogleAnalyticsTrackingCode; backEndGlobalConfigurationEdit.GoogleSearchCode = globalConfiguration.GoogleSearchCode; backEndGlobalConfigurationEdit.IsOffline = globalConfiguration.IsOffline; backEndGlobalConfigurationEdit.OfflineCode = globalConfiguration.OfflineCode; backEndGlobalConfigurationEdit.ServerTimeZone = globalConfiguration.ServerTimeZone; backEndGlobalConfigurationEdit.DateFormat = globalConfiguration.DateFormat; backEndGlobalConfigurationEdit.TimeFormat = globalConfiguration.TimeFormat; backEndGlobalConfigurationEdit.DefaultLanguageCode = globalConfiguration.DefaultLanguageCode; backEndGlobalConfigurationEdit.DefaultErrorPageTemplateId = globalConfiguration.DefaultErrorPageTemplateId; backEndGlobalConfigurationEdit.WhiteList = globalConfiguration.WhiteList; } else { ModelState.AddResult(ViewData, ModelStateResult.Error, Resources.Strings.ItemDoesNotExist); ViewData.IsFormVisible(false); } return(View(backEndGlobalConfigurationEdit)); }
public static IHtmlString GetLanguagePicker(this HtmlHelper htmlHelper, FrontEndCmsPage model, string className = "") { StringBuilder result = new StringBuilder(); Languages languages = new Languages(); Language language = languages.GetLanguageByCode(model.LanguageCode); GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); result.AppendLine("<ul class=\"nav " + className + "\">"); result.AppendLine(" <li class=\"dropdown\">"); result.AppendLine(" <a class=\"dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\"><i class=\"fa fa-flag\"></i> " + language.LanguageNameOriginal + " <i class=\"fa fa-caret-down\"></i></a>"); result.AppendLine(" <ul class=\"dropdown-menu dropdown-user\">"); foreach (Language l in languages.GetAllLanguages(isActive: true)) { result.AppendLine(" <li><a href=\"/" + (l.LanguageCode == globalConfiguration.DefaultLanguageCode ? "" : l.LanguageCode) + "\">" + l.LanguageNameOriginal + "</a></li>"); } result.AppendLine(" </ul>"); result.AppendLine(" </li>"); result.AppendLine("</ul>"); return(htmlHelper.Raw(result.ToString())); }
public static void RegisterRoutes(RouteCollection routes) { GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); if (globalConfiguration.IsCanonicalizeActive) { if (globalConfiguration.HostNameLabel == "www.") { routes.Canonicalize().Www(); } else { routes.Canonicalize().NoWww(); } } //Introduced to support the FrontEndCmsPage.Parameter property in DefaultController routes.Canonicalize().TrailingSlash(); //routes.MapRoute( // name: "Sitemap", // url: "sitemap.xml", // defaults: new { controller = "Sitemap", action = "Index" } //); routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("favicon.ico"); routes.IgnoreRoute("{*AnyAppleTouchIconInTheRoot}", new { AnyAppleTouchIconInTheRoot = @"apple-touch-icon(.*)\.png" }); routes.IgnoreRoute("{*AllPngFiles}", new { AllPngFiles = @".*\.png(/.*)?" }); routes.IgnoreRoute("{*AllJpgFiles}", new { AllJpgFiles = @".*\.jpg(/.*)?" }); routes.IgnoreRoute("{*AllGifFiles}", new { AllGifFiles = @".*\.gif(/.*)?" }); routes.IgnoreRoute("{*AllPhpFiles}", new { AllPhpFiles = @".*\.php(/.*)?" }); routes.IgnoreRoute("{*AllXmlFiles}", new { AllXmlFiles = @".*\.xml(/.*)?" }); routes.IgnoreRoute("{*AllHtmFiles}", new { AllHtmFiles = @".*\.htm(/.*)?" }); routes.IgnoreRoute("{*AllHtmlFiles}", new { AllHtmlFiles = @".*\.html(/.*)?" }); routes.IgnoreRoute("{*AllCssFiles}", new { AllCssFiles = @".*\.css(/.*)?" }); routes.IgnoreRoute("{*AllBsFiles}", new { AllBsFiles = @".*\.bs(/.*)?" }); routes.IgnoreRoute("{*AllJsFiles}", new { AllBsFiles = @".*\.js(/.*)?" }); routes.IgnoreRoute("{*AllTxtFiles}", new { AllTxtFiles = @".*\.txt(/.*)?" }); routes.MapRoute( name: "Admin", url: "Admin/{action}/{id}", defaults: new { controller = "Admin", action = "Dashboard", id = UrlParameter.Optional } ); //Used to route FrontEnd child action modules routes.MapRoute( "FrontEnd", "{controller}/{action}/{id}", // URL with parameters new { action = "Index", id = UrlParameter.Optional } // Parameter defaults // ControllerHelper.GetRoutesConstraints("FrontEnd") ); //Used to route custom content type (E.g. xml, json, etc..). A clear example is the OutputNewsController. routes.MapRoute( "Output", "{controller}/{action}/{id}", // URL with parameters new { action = "Index", id = UrlParameter.Optional }, // Parameter defaults ControllerHelper.GetRoutesConstraints("Output") ); routes.MapRoute( "Default", "{languageCode}/{*segments}", new { controller = "Default", action = "Index", languageCode = globalConfiguration.DefaultLanguageCode, segments = UrlParameter.Optional } ); }
public ActionResult Index(FrontEndCmsPage page, FrontEndSubscriptionRegister frontEndSubscriptionRegister) { ViewBag.IsActivationPage = false; if (ModelState.IsValidOrRefresh()) { if (frontEndSubscriptionRegister.Notes.IsEmpty()) //Honey pot to avoid spammers { GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); //Add the subscription to the database and generate the {$VerificationUrl} string ActivationKey = DateTime.Now.Ticks.ToBase36() + Session.SessionID; Subscriptions subscriptions = new Subscriptions(); int? result = subscriptions.Add(frontEndSubscriptionRegister.Email, frontEndSubscriptionRegister.Password, frontEndSubscriptionRegister.FirstName, frontEndSubscriptionRegister.LastName, frontEndSubscriptionRegister.Birthdate.ToDateTime(), frontEndSubscriptionRegister.PhoneNumber, frontEndSubscriptionRegister.Address, frontEndSubscriptionRegister.City, frontEndSubscriptionRegister.PostCode, frontEndSubscriptionRegister.CountryCode, 1, //Not verified frontEndSubscriptionRegister.WantsNewsletter, DateTime.Now, Request.UserHostAddress, ActivationKey, null); switch (result) { case 0: //Send the email to the subscriber to confirm his identity string subject = Resources.Strings_Subscription.EmailVerifyAccountSubject.Replace("{$SiteName}", globalConfiguration.SiteName); string body = Resources.Strings_Subscription.EmailVerifyAccountBody .Replace("{$FirstName}", frontEndSubscriptionRegister.FirstName) .Replace("{$SiteName}", globalConfiguration.SiteName) .Replace("{$VerificationUrl}", globalConfiguration.DomainName.ToUrl() + page.LanguageCode + "/register?k=" + ActivationKey) .Replace("{$Url}", globalConfiguration.DomainName.ToUrl()); EmailHelper email = new EmailHelper("subscription-activation@" + globalConfiguration.DomainName, frontEndSubscriptionRegister.Email, subject, body); if (email.Send()) { ModelState.AddResult(ViewData, ModelStateResult.Success, Resources.Strings_Subscription.Thanks); ViewData.IsFormVisible(false); } else { subscriptions.Delete(frontEndSubscriptionRegister.Email); ModelState.AddResult(ViewData, ModelStateResult.Error, Resources.Strings.UnexpectedError + " (Email)"); } break; case 2: ModelState.AddResult(ViewData, ModelStateResult.Error, Resources.Strings.EmailAlreadyExists); break; default: ModelState.AddResult(ViewData, ModelStateResult.Error, Resources.Strings.UnexpectedError + " (Database)"); break; } } else { ModelState.AddResult(ViewData, ModelStateResult.Success, Resources.Strings_Subscription.Thanks); ViewData.IsFormVisible(false); } } return(View(frontEndSubscriptionRegister)); }
public ActionResult Index(string languageCode, string segments) { GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); if (!globalConfiguration.IsOffline || Request["OfflineCode"] == globalConfiguration.OfflineCode || Session["OfflineCode"].ConvertTo <string>(null, true) == globalConfiguration.OfflineCode) { if (Session["OfflineCode"].IsNull()) { Session["OfflineCode"] = Request["OfflineCode"]; } FrontEndCmsPage page = new FrontEndCmsPage() { PageId = null, LanguageCode = globalConfiguration.DefaultLanguageCode, LanguageFolder = "", Parameter = string.Empty, MetaTagTitle = globalConfiguration.MetaTitle, MetaTagKeywords = globalConfiguration.MetaKeywords, MetaTagDescription = globalConfiguration.MetaDescription, Robots = globalConfiguration.Robots, PageTemplateId = null, StatusCode = null }; CmsPages cmsPages = new CmsPages(); CmsPage cmsPage = cmsPages.GetHomePage(); bool isHomePageDefined = cmsPage.IsNotNull(); if (segments.IsNotEmptyOrWhiteSpace()) { segments = segments.TrimEnd('/'); cmsPage = cmsPages.GetPageBySegments(segments); if (cmsPage.IsNull() && segments.Contains('/')) { cmsPage = cmsPages.GetPageBySegments(segments.Remove(segments.LastIndexOf('/'))); page.Parameter = segments.Substring(segments.LastIndexOf('/') + 1); //the parameter can be a dash separated list of parameters. E.g. 2-today_the_weather_is_nice } } Language language = new Languages().GetLanguageByCode(languageCode); if ( cmsPage.IsNotNull() && //The page exists (cmsPage.IsActive || (Request["preview"] == "true" && BackEndSessions.CurrentUser.IsNotNull())) && //The page is active or the page is in preview mode with a user logged in the admin area language.IsNotNull() && //The language exists language.IsActive //The language is active ) { if (cmsPage.IsAccessRestricted && FrontEndSessions.CurrentSubscription.IsNull()) { SubscriptionConfiguration subscriptionConfiguration = new SubscriptionConfigurations().GetSubscriptionConfiguration(); CmsPageActionlink cmsPageActionlink = cmsPages.GetCmsPageActionlink(subscriptionConfiguration.SignInPageId, language.LanguageCode); if (cmsPageActionlink.IsNotNull()) { return(Redirect(cmsPageActionlink.Url + "?ReturnUrl=" + HttpUtility.UrlEncode(Request.Url.AbsoluteUri))); } } page.PageId = cmsPage.PageId; page.LanguageCode = language.LanguageCode; page.LanguageFolder = language.LanguageCode == globalConfiguration.DefaultLanguageCode ? "" : language.LanguageCode; page.PageTemplateId = cmsPage.PageTemplateId; PageLanguage pageLanguage = new PagesLanguages().GetPageLanguage(cmsPage.PageId, language.LanguageCode); if (pageLanguage.IsNotNull()) { if (pageLanguage.MetaTagTitle.IsNotEmptyOrWhiteSpace()) { page.MetaTagTitle = pageLanguage.MetaTagTitle.ReplaceGlobalTokens(); } if (pageLanguage.MetaTagKeywords.IsNotEmptyOrWhiteSpace()) { page.MetaTagKeywords = pageLanguage.MetaTagKeywords.ReplaceGlobalTokens(); } if (pageLanguage.MetaTagDescription.IsNotEmptyOrWhiteSpace()) { page.MetaTagDescription = pageLanguage.MetaTagDescription.ReplaceGlobalTokens(); } if (pageLanguage.Robots.IsNotEmptyOrWhiteSpace()) { page.Robots = pageLanguage.Robots; } } } else { if (language.IsNotNull()) { page.LanguageCode = language.LanguageCode; page.LanguageFolder = language.LanguageCode == globalConfiguration.DefaultLanguageCode ? "" : language.LanguageCode; } page.PageTemplateId = globalConfiguration.DefaultErrorPageTemplateId; if (isHomePageDefined) { page.StatusCode = 404; } else { page.StatusCode = 501; //Home page not defined in the database table tb_cms_pages } } Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture((language.IsNotNull() && language.IsActive) ? language.LanguageCode : page.LanguageCode); return(View(page)); } else { return(Redirect("~/_app_offline.htm")); } }
public static void SaveExceptionToDB(string methodName, string resourceName, string recordId, string exceptionDetails) { SqlConnection sqlCon = null; SqlCommand sqlCmd = null; try { GlobalConfigurations objConfig = new GlobalConfigurations(); objConfig.InitilizeConnectionString(); objConfig.InitilizeConnectionString(); string connectionString = objConfig.connectionString; int commandTimeout = Convert.ToInt32(objConfig.commandTimeout); sqlCon = new SqlConnection(connectionString); sqlCon.Open(); sqlCmd = new SqlCommand("SP_LogException", sqlCon); sqlCmd.Parameters.Add("@MethodName", SqlDbType.NVarChar); sqlCmd.Parameters["@MethodName"].Value = methodName; sqlCmd.Parameters.Add("@ResourceName", SqlDbType.NVarChar); sqlCmd.Parameters["@ResourceName"].Value = resourceName; sqlCmd.Parameters.Add("@RecordId", SqlDbType.NVarChar); sqlCmd.Parameters["@RecordId"].Value = recordId; sqlCmd.Parameters.Add("@ExceptionDetails", SqlDbType.NText); sqlCmd.Parameters["@ExceptionDetails"].Value = exceptionDetails; sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.CommandTimeout = commandTimeout; sqlCmd.ExecuteNonQuery(); sqlCon.Close(); sqlCon.Dispose(); } catch (Exception exp) { } finally { //Since these variables are in local scope it'll be auto dispose once thread exits the mehtod. //However good to add it explicitly. try { if (sqlCmd != null) { sqlCmd.Dispose(); } } catch { } try { if (sqlCon != null) { sqlCon.Close(); sqlCon.Dispose(); } } catch { } } }
public static string ToDateTimeString(this DateTime dateTime) { GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); return(dateTime.ToString(globalConfiguration.DateFormat + " " + globalConfiguration.TimeFormat, System.Globalization.CultureInfo.InvariantCulture)); }
public ActionResult Index(FrontEndCmsPage page, FrontEndNews frontEndNews) { News news = new News(); if (page.Parameter.IsNotEmptyOrWhiteSpace()) { SingleNews singleNews = news.GetSingleNews(page.Parameter.Split('-').FirstOrDefault().ConvertTo <int?>(null, true), page.LanguageCode); if (singleNews.IsNotNull()) { NewsComments newsComments = new NewsComments(); frontEndNews.LanguageCode = page.LanguageCode; frontEndNews.NewsList = null; frontEndNews.FilterCategoryId = null; frontEndNews.FilterNewsDate = null; frontEndNews.NewsId = singleNews.NewsId; frontEndNews.NewsDate = singleNews.NewsDate; frontEndNews.UserName = singleNews.UserName; frontEndNews.CategoryId = singleNews.CategoryId; frontEndNews.CategoryName = singleNews.CategoryName; frontEndNews.MainImageFilePath = singleNews.MainImageFilePath; frontEndNews.NewsTitle = singleNews.NewsTitle; frontEndNews.NewsContent = singleNews.NewsContent; frontEndNews.NewsCommentList = (newsComments.IsNotNull() ? newsComments.GetNewsComments(singleNews.NewsId, true) : null); } else { frontEndNews = null; } } if (ModelState.IsValidOrRefresh() && frontEndNews.IsNotNull()) { NewsConfiguration newsConfiguration = new NewsConfigurations().GetNewsConfiguration(); NewsComments newsComments = new NewsComments(); int? result = newsComments.Add((int)frontEndNews.NewsId, newsConfiguration.IsCommentAutoApproved, frontEndNews.NewsComment, DateTime.Now, FrontEndSessions.CurrentSubscription.Email); switch (result) { case 0: ModelState.AddResult(ViewData, ModelStateResult.Success, Resources.Strings_News.CommentAdded); ViewData.IsFormVisible(false); GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); CultureInfoHelper.ForceBackEndLanguage(); string subject = Resources.Strings_News.EmailSubject.Replace("{$Url}", globalConfiguration.DomainName.ToUrl()); string body = Resources.Strings_News.EmailBody .Replace("{$Url}", globalConfiguration.DomainName.ToUrl()) .Replace("{$subscriptionEmail}", FrontEndSessions.CurrentSubscription.Email) .Replace("{$comment}", frontEndNews.NewsComment) .Replace("{$ipAddress}", Request.UserHostAddress); CultureInfoHelper.RestoreFrontEndLanguage(); EmailHelper email = new EmailHelper(globalConfiguration.NotificationEmail, globalConfiguration.NotificationEmail, subject, body); email.Send(); break; default: ModelState.AddResult(ViewData, ModelStateResult.Error, Resources.Strings.UnexpectedError + " (Database)"); break; } } return(View(frontEndNews)); }
private static void BuildSitemap(List <CmsPage> backEndCmsPageList, PagesLanguages pagesLanguages, int currentLevel, int?pageParentId, ref string sitemap, string className, string langCode) { if (backEndCmsPageList != null) { List <CmsPage> pagesObj = (from page in backEndCmsPageList where page.PageParentId == pageParentId && page.ShowInSitemap && page.IsActive select page).ToList(); if (pagesObj != null && pagesObj.Count() > 0) { sitemap += Environment.NewLine + "<ul"; if (currentLevel == 1 && className.IsNotEmptyOrWhiteSpace()) { sitemap += " class=\"" + className + "\""; } sitemap += ">" + Environment.NewLine; GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); PageLanguage backEndCmsPageLanguage; string pageTitle; string url; foreach (CmsPage pageObj in pagesObj) { backEndCmsPageLanguage = pagesLanguages.GetPageLanguage(pageObj.PageId, langCode); pageTitle = pageObj.PageName; if (backEndCmsPageLanguage.IsNotNull() && backEndCmsPageLanguage.MenuName.IsNotEmptyOrWhiteSpace()) { pageTitle = backEndCmsPageLanguage.MenuName; } if (pageObj.PageTemplateId.IsNull()) { url = pageObj.Url; } else { if (!pageObj.IsHomePage || langCode != globalConfiguration.DefaultLanguageCode) { if (pageObj.IsHomePage) { url = "/" + langCode + "/"; } else { url = "/" + langCode + "/" + pageObj.FullSegment + "/"; } } else { url = "/"; } } sitemap += "<li><a href=\"" + url + "\" title=\"" + pageTitle + "\" target=\"" + pageObj.Target + "\">" + pageTitle + "</a>"; currentLevel++; BuildSitemap(backEndCmsPageList, pagesLanguages, currentLevel, pageObj.PageId, ref sitemap, className, langCode); currentLevel--; sitemap += "</li>" + Environment.NewLine; } sitemap += "</ul>" + Environment.NewLine; } } }
private static void BuildMainMenu(List <CmsPage> backEndCmsPageList, int currentLevel, int?pageParentId, ref string mainMenu, string savedNode, string className, string langCode) { if (backEndCmsPageList != null && currentLevel <= 2) { List <CmsPage> pagesObj = (from page in backEndCmsPageList where page.PageParentId == pageParentId && page.ShowInMainMenu && page.IsActive select page).ToList(); if (pagesObj != null && pagesObj.Count() > 0) { mainMenu += Environment.NewLine + "<ul"; if (currentLevel == 1) { mainMenu += " class=\"" + className + "\""; } else { mainMenu += " class=\"dropdown-menu\""; } mainMenu += ">" + Environment.NewLine; if (savedNode.IsNotEmptyOrWhiteSpace()) { mainMenu += savedNode + "<li class=\"divider\"></li>"; } GlobalConfiguration globalConfiguration = new GlobalConfigurations().GetGlobalConfiguration(); PagesLanguages backEndCmsPagesLanguages = new PagesLanguages(); PageLanguage backEndCmsPageLanguage; string pageTitle; foreach (CmsPage pageObj in pagesObj) { backEndCmsPageLanguage = backEndCmsPagesLanguages.GetPageLanguage(pageObj.PageId, langCode); if (backEndCmsPageLanguage.IsNotNull() && backEndCmsPageLanguage.MenuName.IsNotEmptyOrWhiteSpace()) { pageTitle = backEndCmsPageLanguage.MenuName; } else { pageTitle = pageObj.PageName; } bool hasChildren = (from page in backEndCmsPageList where page.PageParentId == pageObj.PageId && page.ShowInMainMenu && page.IsActive select page).Count() > 0; mainMenu += "<li"; if (hasChildren && currentLevel < 2) { savedNode = "<li><a href=\"/"; if (!pageObj.IsHomePage || langCode != globalConfiguration.DefaultLanguageCode) { if (pageObj.IsHomePage) { savedNode += langCode + "/"; } else { savedNode += langCode + "/" + pageObj.FullSegment + "/"; } } savedNode += "\" title=\"" + pageTitle + "\" target=\"" + pageObj.Target + "\">" + pageTitle + "</a></li>"; mainMenu += " class=\"dropdown\""; } mainMenu += ">"; if (hasChildren && currentLevel < 2) { mainMenu += "<a href=\"#\" title=\"" + pageTitle + "\" target=\"" + pageObj.Target + "\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">" + pageTitle + " <b class=\"caret\"></b></a>"; } else { mainMenu += "<a href=\"{$url}\" title=\"" + pageTitle + "\" target=\"" + pageObj.Target + "\">" + pageTitle + "</a>"; } if (pageObj.PageTemplateId.IsNull()) { mainMenu = mainMenu.Replace("{$url}", pageObj.Url); } else { if (!pageObj.IsHomePage || langCode != globalConfiguration.DefaultLanguageCode) { if (pageObj.IsHomePage) { mainMenu = mainMenu.Replace("{$url}", "/" + langCode + "/"); } else { mainMenu = mainMenu.Replace("{$url}", "/" + langCode + "/" + pageObj.FullSegment + "/"); } } else { mainMenu = mainMenu.Replace("{$url}", "/"); } } currentLevel++; BuildMainMenu(backEndCmsPageList, currentLevel, pageObj.PageId, ref mainMenu, savedNode, className, langCode); currentLevel--; mainMenu += "</li>" + Environment.NewLine; } mainMenu += "</ul>" + Environment.NewLine; } } }