private void Save() { string lastLocale = (string)(ViewState["ViewStateLastLanguageCode"]); if ((!string.IsNullOrEmpty(lastLocale)) && NewsId.Value != "0") { MLNewsController.UpdateNews(int.Parse(NewsId.Value), txtHeadline.Text, Server.HtmlDecode(txtDescription.Text), Server.HtmlDecode(txtContent.Text), lastLocale); } }
protected void BindNews() { if (ddlNews.SelectedValue == "" || ddlCat.SelectedValue == "") { NewsId.Value = "0"; return; } MLNewsInfo mlNews = MLNewsController.GetNews(int.Parse(ddlNews.SelectedValue), ddlLocale.SelectedValue, false); lblHeadline.Text = mlNews.Headline; //Headline bool HeadlineTranslated = false; if (mlNews.MLHeadline != null) { HeadlineTranslated = !mlNews.MLHeadline.StringTextIsNull; } else { HeadlineTranslated = false; } if (!HeadlineTranslated) { txtHeadline.Style.Add("border-color", "Red"); txtHeadline.ToolTip = Localization.GetString("notTranslated", this.LocalResourceFile); txtHeadline.Text = ""; } if (mlNews.MLHeadline != null) { txtHeadline.Style.Remove("border-color"); txtHeadline.ToolTip = ""; txtHeadline.Text = mlNews.MLHeadline.StringText; } //Description bool DescriptionTranslated = false; if (mlNews.MLDescription != null) { DescriptionTranslated = !mlNews.MLDescription.StringTextIsNull; } else { DescriptionTranslated = false; } if (!DescriptionTranslated) { pnlDescription.Style.Add("border-color", "Red"); txtDescription.Text = ""; } if (mlNews.MLDescription != null) { pnlDescription.Style.Remove("border-color"); txtDescription.Text = mlNews.MLDescription.StringText; } //Content bool ContentTranslated = false; if (mlNews.MLContent != null) { ContentTranslated = !mlNews.MLContent.StringTextIsNull; } else { ContentTranslated = false; } if (!ContentTranslated) { pnlContent.Style.Add("border-color", "Red"); txtContent.Text = ""; } if (mlNews.MLContent != null) { pnlContent.Style.Remove("border-color"); txtContent.Text = mlNews.MLContent.StringText; } NewsId.Value = mlNews.ID.ToString(); }