void btnUpdateOtherLanguage_Click(object sender, EventArgs e)
{
if (ViewState[CMSViewStateManager.CategoryID] != null)
{
try
{
CMS.Core.Entities.Article article =
ArticleManager.GetArticle(SelectedParentArticleObjID, ucPortalLanguage.SelectedLanguageID);
if (article != null)
{
article.CreationDate = ucAjaxDate.SelectedDateTime.Value;
article.CategoryID = Convert.ToInt32(ViewState[CMSViewStateManager.CategoryID]);
article.Description = txtDescription.Text;
article.Details = txtDetails.Text;
List<string> files = ucSWFUpload.GetFilesName();
if (files.Count > 0)
article.Image = files[0];
else
article.Image = string.Empty;
article.IsDeleted = false;
article.KeyWords = string.Empty;
article.ArticleType = (CMSEnums.ArticleType)Convert.ToInt32(cddArticleType.SelectedValue);
article.Name = txtName.Text;
article.Order = Convert.ToInt32(txtOrderNumber.Text);
article.Summary = txtSummary.Text;
article.PortalID = CMSContext.PortalID;
article.SEOName = string.Empty;
article.URL = txtURL.Text;
if (article.ArticleType == CMSEnums.ArticleType.Internal)
{
string articleURL = article.URL;
if (string.IsNullOrEmpty(articleURL))
{
//Get Default Value
articleURL = CMSConfig.CMSPage.GetNewsDetailsPage();
}
//NameValueCollection valueCollection = HttpUtility.ParseQueryString(articleURL);
string[] arrQueryString = articleURL.Split('?');
string queryString = string.Empty;
if (arrQueryString != null && arrQueryString.Length > 1)
{
queryString = arrQueryString[1];
}
if (string.IsNullOrEmpty(queryString))
{
//if (string.IsNullOrEmpty(valueCollection[CMSConfig.QueryString.ArticleID]))
//{
if (articleURL.Contains("?"))
{
articleURL += "&" + CMSConfig.QueryString.ArticleID + "=" + article.ID;
}
else
{
articleURL += "?" + CMSConfig.QueryString.ArticleID + "=" + article.ID;
}
}
//}
article.URL = articleURL;
}
ArticleManager.Update(article);
}
}
catch (Exception ex)
{
dvProblems.Visible = true;
dvProblems.InnerText = ex.ToString();
upnlArticle.Update();
}
}
}
#endregion