private void createPreview() { // first delete any previews from before this.removePreviewArticle(); // now put the new preview in DataContainer dc = new DataContainer(this.dbTable); DataRow dr = dc.GetNewRow(); dr["nodeID"] = currentNode.Id; dr["templateID"] = int.Parse(articleTemplateID.SelectedValue); dr["version"] = 0; dr["lang"] = lang; dr["rank"] = rank; dr["title"] = title.Text; dr["summary"] = summary.Text; dr["keywords"] = keywords.Text; dr["body"] = body1.Value; dr["userID"] = ((UserIdentity)SFGlobal.GetCurrentUser().Identity).ID; dr["dateCreated"] = System.DateTime.Now; dr["dateModified"] = System.DateTime.Now; dr["publish"] = false; dr["preview"] = true; dr["active"] = true; dc.UpdateRow(dr); }
private void applySecurity() { if (SFGlobal.GetCurrentUser().Roles.Contains(SFGlobal.AdminstratorRoleName) || SFGlobal.GetCurrentUser().Roles.Contains(SFGlobal.PublisherRoleName)) { deleteLanguage.Enabled = true; deletePage.Enabled = true; publishNowButton.Enabled = true; } }
private void saveCurrentPage() { this.removePreviewArticle(); DataContainer dc = new DataContainer(this.dbTable); DataRow dr = dc.GetRowByCustomSql("SELECT * FROM " + dbTable + " WHERE nodeID = " + currentNode.Id + " AND rank = " + rank + " AND version = " + version); dr["templateID"] = int.Parse(articleTemplateID.SelectedValue); dr["title"] = title.Text; dr["summary"] = summary.Text; dr["keywords"] = keywords.Text; dr["body"] = content.Text; dr["userID"] = ((UserIdentity)SFGlobal.GetCurrentUser().Identity).ID; dr["dateModified"] = System.DateTime.Now; dr["publish"] = publishCheck.Checked; dr["active"] = activeCheck.Checked; dc.UpdateRow(dr); }
private void createArticlePage(string language, int rank) { DataContainer dc = new DataContainer(dbTable); DataRow dr = dc.GetNewRow(); dr["nodeID"] = currentNode.Id; dr["templateID"] = 1; dr["lang"] = language; dr["version"] = 1; dr["rank"] = rank; dr["title"] = currentNode.getName(SFGlobal.DefaultLanguage); dr["summary"] = "new summary"; dr["keywords"] = "new keywords"; dr["body"] = "new body for " + currentNode.getName(SFGlobal.DefaultLanguage); dr["userID"] = SFGlobal.GetCurrentUser().ID; dr["publish"] = false; dr["preview"] = false; dr["active"] = false; dr["dateCreated"] = dr["dateModified"] = System.DateTime.Now; dc.UpdateRow(dr); }
private void createNewVersion() { this.removePreviewArticle(); DataContainer dc = new DataContainer(this.dbTable); DataRow dr = dc.GetNewRow(); dr["nodeID"] = currentNode.Id; dr["templateID"] = int.Parse(articleTemplateID.SelectedValue); dr["version"] = versionCount() + 1; dr["lang"] = lang; dr["rank"] = rank; dr["title"] = title.Text; dr["summary"] = summary.Text; dr["keywords"] = keywords.Text; dr["body"] = content.Text; dr["userID"] = ((UserIdentity)SFGlobal.GetCurrentUser().Identity).ID; dr["dateCreated"] = dr["dateModified"] = System.DateTime.Now; dr["publish"] = false; dr["preview"] = false; dr["active"] = false; dc.UpdateRow(dr); loadPage(rank); }
private void removePreviewArticle() { string sql = String.Format("DELETE FROM " + dbTable + " WHERE preview = 1 AND nodeID = {0} AND lang = '{1}' AND userID = {2}", currentNode.Id, lang, ((UserIdentity)SFGlobal.GetCurrentUser().Identity).ID); dal.execNonQuery(sql); }