private void BuildOrigPage() { AccountProperty property = new AccountProperty(appEnv.GetConnection()); DataRow dr = dt.Rows[0]; lbContentID.Text = dr["ContentID"].ToString(); lbVersion.Text = dr["Version"].ToString(); tbHeadline.Text = dr["Headline"].ToString(); tbSource.Text = dr["Source"].ToString(); lbBylineNum.Text = dr["Byline"].ToString(); lbByline.Text = property.GetValue(Convert.ToInt32(dr["Byline"]), "UserName").Trim(); tbTeaser.Text = dr["Teaser"].ToString(); tbBody.Text = dr["Body"].ToString(); tbTagline.Text = dr["Tagline"].ToString(); lbEditorNum.Text = dr["Editor"].ToString(); lbEditor.Text = property.GetValue(Convert.ToInt32(dr["Editor"]), "UserName").Trim(); lbApproverNum.Text = dr["Approver"].ToString(); lbApprover.Text = property.GetValue(Convert.ToInt32(dr["Approver"]), "UserName").Trim(); lbStatusNum.Text = dr["Status"].ToString(); lbStatus.Text = StatusCodes.ToString(Convert.ToInt32(dr["Status"])); lbModifiedDate.Text = dr["ModifiedDate"].ToString(); lbCreationDate.Text = dr["CreationDate"].ToString(); }
private void Page_Load(object sender, System.EventArgs e) { int cid = Convert.ToInt32(Request.QueryString["ID"]); int ver = Convert.ToInt32(Request.QueryString["Ver"]); if (cid == 0) { Page_Error("ContentID Missing"); } if (ver == 0) { Page_Error("Version Missing"); } dr = new Content(appEnv.GetConnection()).GetContentForIDVer(cid, ver); if (!IsPostBack) { AccountProperty property = new AccountProperty(appEnv.GetConnection()); lbContentID.Text = dr["ContentID"].ToString(); lbVersion.Text = dr["Version"].ToString(); lbHeadline.Text = dr["Headline"].ToString(); lbSource.Text = dr["Source"].ToString() + " "; lbByline.Text = property.GetValue(Convert.ToInt32(dr["Byline"]), "UserName").Trim(); lbTeaser.Text = dr["Teaser"].ToString() + " "; lbBody.Text = dr["Body"].ToString(); lbTagline.Text = dr["Tagline"].ToString() + " "; lbStatus.Text = dr["Status"].ToString(); lbUpdateUser.Text = property.GetValue(Convert.ToInt32(dr["UpdateUserID"]), "UserName").Trim(); lbModifiedDate.Text = dr["ModifiedDate"].ToString(); lbCreationDate.Text = dr["CreationDate"].ToString(); } }
private void BuildPage(int cver) { AccountProperty property = new AccountProperty(appEnv.GetConnection()); DataRow dr = dt.Rows[cver]; lbContentID.Text = dr["ContentID"].ToString(); lbVersion.Text = dr["Version"].ToString(); lbHeadline.Text = dr["Headline"].ToString(); lbSource.Text = dr["Source"].ToString() + " "; lbByline.Text = property.GetValue(Convert.ToInt32(dr["Byline"]), "UserName").Trim(); lbTeaser.Text = dr["Teaser"].ToString() + " "; lbBody.Text = dr["Body"].ToString(); lbTagline.Text = dr["Tagline"].ToString() + " "; lbStatus.Text = StatusCodes.ToString(Convert.ToInt32(dr["Status"])); lbEditor.Text = property.GetValue(Convert.ToInt32(dr["Editor"]), "UserName").Trim(); lbApprover.Text = property.GetValue(Convert.ToInt32(dr["Approver"]), "UserName").Trim(); lbUpdateUser.Text = property.GetValue(Convert.ToInt32(dr["UpdateUserID"]), "UserName").Trim(); lbModifiedDate.Text = dr["ModifiedDate"].ToString(); lbCreationDate.Text = dr["CreationDate"].ToString(); if (cver > 0) { bnNext.Enabled = true; int tmp = cver - 1; bnNext.CommandArgument = tmp.ToString(); } else { bnNext.Enabled = false; } if (cver < dt.Rows.Count - 1) { bnPrevious.Enabled = true; int tmp = cver + 1; bnPrevious.CommandArgument = tmp.ToString(); } else { bnPrevious.Enabled = false; } bnUpdate.Visible = (cver == 0 && StatusCodes.isCreating(dr["Status"].ToString())); bnRemove.Visible = (cver == 0 && StatusCodes.isCreating(dr["Status"].ToString())); }
protected void Page_Load(object sender, System.EventArgs e) { if (!IsPostBack) { AppEnv appEnv = new AppEnv(Context); MyContent content = new MyContent(appEnv.GetConnection()); AccountProperty property = new AccountProperty(appEnv.GetConnection()); DataRow dr = content.GetContentForIDVer(m_contentid, m_version); if (dr != null) { lbHeadline.Text = dr["Headline"].ToString(); lbSource.Text = dr["Source"].ToString(); lbByline.Text = property.GetValue(Convert.ToInt32(dr["Byline"]), "UserName").Trim(); lbTeaser.Text = dr["Teaser"].ToString(); hlReadMore.NavigateUrl = buildDirectory(dr) + "StoryPg.aspx?ID=" + m_contentid + "&Ver=" + m_version; } else { lbHeadline.Text = "No Stories"; hlReadMore.Visible = false; lbBy.Visible = false; imgPlus.Visible = false; } } }
private void Page_Load(object sender, System.EventArgs e) { int Domain = Convert.ToInt32(Request.QueryString["Domain"]); // First Time in no Domain specified if (Domain == 0) { Domain = 1; } MainNavBar.Domain = Domain; Account account = new Account(appEnv.GetConnection()); int accountID = account.GetAccountID(User.Identity.Name); if (!IsPostBack) { AccountProperty property = new AccountProperty(appEnv.GetConnection()); string strZoneIds = property.GetValue(accountID, "ZoneCards"); if (strZoneIds.Length <= 0) { property.Insert(accountID, "ZoneCards", "0,0,0,0,0,0"); } } for (int i = 0; i < 6; i++) { ZoneCards[i].Card = i; ZoneCards[i].AccountID = accountID; } }
private void Page_Load(object sender, System.EventArgs e) { nid = Convert.ToInt32(Request.QueryString["NoteID"]); origin = Request.QueryString["Origin"]; if (nid == 0) { Page_Error("NoteID Missing"); } if (!IsPostBack) { Account account = new Account(appEnv.GetConnection()); AccountProperty property = new AccountProperty(appEnv.GetConnection()); DataRow dr = new ContentNotes(appEnv.GetConnection()).GetNote(nid); lbWho.Text = origin; lbContentID.Text = dr["ContentID"].ToString(); lbNote.Text = dr["Note"].ToString(); lbAuthor.Text = property.GetValue(Convert.ToInt32(dr["Author"]), "UserName").Trim(); lbModifiedDate.Text = dr["ModifiedDate"].ToString(); lbCreationDate.Text = dr["CreationDate"].ToString(); if (account.GetAccountID(User.Identity.Name) != Convert.ToInt32(dr["Author"])) { bnUpdate.Visible = false; bnRemove.Visible = false; } } }
private void Page_Load(object sender, System.EventArgs e) { account = new Account(appEnv.GetConnection()); property = new AccountProperty(appEnv.GetConnection()); DataTable dt = account.GetAccounts(); LiteralControl lit; TableCell cell; foreach (DataRow dr in dt.Rows) { TableRow row = new TableRow(); tblView.Rows.Add(row); lit = new LiteralControl(dr["UserName"].ToString()); cell = new TableCell(); cell.Controls.Add(lit); row.Cells.Add(cell); lit = new LiteralControl(property.GetValue(Convert.ToInt32(dr["AccountID"]), "UserName") + " "); cell = new TableCell(); cell.Controls.Add(lit); row.Cells.Add(cell); lit = new LiteralControl(dr["Email"].ToString()); cell = new TableCell(); cell.Controls.Add(lit); row.Cells.Add(cell); if (dr["AccountID"].ToString().Trim().Equals("1")) { int i = 0; // is the cuurent user the administrator allow viewing and updating if (dr["UserName"].ToString().Trim().Equals(User.Identity.Name.Trim())) { BuildImageButton(row, "AdmAcntView.aspx?AccountID=" + dr["AccountID"].ToString()); BuildImageButton(row, "AdmAcntUpdate.aspx?AccountID=" + dr["AccountID"].ToString()); i = 2; } // never allow delete button for administrator account for ( ; i < 3; i++) { lit = new LiteralControl(" "); cell = new TableCell(); cell.Controls.Add(lit); row.Cells.Add(cell); } } else { BuildImageButton(row, "AdmAcntView.aspx?AccountID=" + dr["AccountID"].ToString()); BuildImageButton(row, "AdmAcntUpdate.aspx?AccountID=" + dr["AccountID"].ToString()); BuildImageButton(row, "AdmAcntRemove.aspx?AccountID=" + dr["AccountID"].ToString()); } } }
protected void Page_Load(object sender, System.EventArgs e) { aid = Convert.ToInt32(Request.QueryString["AccountID"]); if (aid == 0) { Page_Error("AccountID Missing"); } if (aid == 1) { bnRemove.Visible = false; } account = new Account(appEnv.GetConnection()); property = new AccountProperty(appEnv.GetConnection()); roles = new AccountRoles(appEnv.GetConnection()); dr = account.GetAccountForID(aid); if (!IsPostBack) { tbUserID.Text = dr["UserName"].ToString().Trim(); tbUserName.Text = property.GetValue(aid, "UserName").Trim(); tbEmail.Text = dr["Email"].ToString().Trim(); DataTable roledt = roles.GetRolesForID(aid); string Cmd = "Select * FROM Roles"; SqlDataAdapter DAdpt = new SqlDataAdapter(Cmd, appEnv.GetConnection()); DataSet ds = new DataSet(); DAdpt.Fill(ds, "Roles"); DataTable allRolesdt = ds.Tables["Roles"]; foreach (DataRow drr in allRolesdt.Rows) { ListItem li = new ListItem(drr["Role"].ToString()); foreach (DataRow adr in roledt.Rows) { if (drr["Role"].ToString().Equals(adr["Role"].ToString())) { li.Selected = true; } } lbRoles.Items.Add(li); } if (aid == 1) { bnRemove.Visible = false; lbRoles.Enabled = false; } } }
private void BuildOrigPage() { AccountProperty property = new AccountProperty(appEnv.GetConnection()); DataRow dr = new ContentNotes(appEnv.GetConnection()).GetNote(nid); lbContentID.Text = dr["ContentID"].ToString(); tbNote.Text = dr["Note"].ToString(); lbAuthor.Text = property.GetValue(Convert.ToInt32(dr["Author"]), "UserName").Trim(); lbModifiedDate.Text = dr["ModifiedDate"].ToString(); lbCreationDate.Text = dr["CreationDate"].ToString(); }
private void Page_Load(object sender, System.EventArgs e) { appEnv = new AppEnv(Context); zone = new Zone(appEnv.GetConnection()); property = new AccountProperty(appEnv.GetConnection()); if (!IsPostBack) { DataTable dtz = zone.GetAllZones(); ddlZones.Items.Add(new ListItem("Select a zone", "0")); foreach (DataRow dr in dtz.Rows) { ddlZones.Items.Add(new ListItem(dr["Title"].ToString(), dr["ZoneID"].ToString())); } } strZoneIds = property.GetValue(AccountID, "ZoneCards").Split(','); ZoneID = Convert.ToInt32(strZoneIds[Card]); if (ZoneID == 0) { pnlTitle.Visible = false; pnlBody.Visible = false; ibnEditNew.Visible = true; lbEmpty.Visible = true; return; } if (ZoneID > 0) { DataRow drz = zone.GetZone(ZoneID); hlZoneName.Text = drz["Title"].ToString(); hlZoneName.NavigateUrl = "ZonePg.aspx?zone=" + drz["ZoneID"]; BuildBody(); } else { DataRow drz = zone.GetZone(-ZoneID); hlZoneName.Text = drz["Title"].ToString(); hlZoneName.NavigateUrl = "ZonePg.aspx?zone=" + drz["ZoneID"]; pnlBody.Visible = false; } }
protected void Page_Load(object sender, System.EventArgs e) { aid = Convert.ToInt32(Request.QueryString["AccountID"]); if (aid == 0) { Page_Error("AccountID Missing"); } account = new Account(appEnv.GetConnection()); property = new AccountProperty(appEnv.GetConnection()); dr = account.GetAccountForID(aid); lbUserID.Text = dr["UserName"].ToString(); lbUserName.Text = property.GetValue(Convert.ToInt32(dr["AccountID"]), "UserName"); lbEmail.Text = dr["Email"].ToString(); }
protected void Page_Load(object sender, System.EventArgs e) { int curId = Convert.ToInt32(Request.QueryString["ID"]); int curVer = Convert.ToInt32(Request.QueryString["Ver"]); if (!Request.IsAuthenticated) { ucLogin.Visible = true; } else { ucLogout.Visible = true; } MyContent content = new MyContent(appEnv.GetConnection()); AccountProperty property = new AccountProperty(appEnv.GetConnection()); DataRow dr = content.GetContentForIDVer(curId, curVer); if (Convert.ToInt32(dr["Protected"]) > 0) { if (!Request.IsAuthenticated) { Response.Redirect("../Login.aspx?URL=" + HttpUtility.UrlEncode(Request.RawUrl)); } } if (dr != null) { lbHeadline.Text = dr["Headline"].ToString(); lbSource.Text = dr["Source"].ToString(); lbByline.Text = property.GetValue(Convert.ToInt32(dr["Byline"]), "UserName").Trim(); lbDate.Text = dr["ModifiedDate"].ToString(); lbTeaser.Text = dr["Teaser"].ToString(); lbBody.Text = dr["Body"].ToString(); lbTagline.Text = dr["Tagline"].ToString(); } else { lbHeadline.Text = "No Stories"; lbBy.Visible = false; lbDashes.Visible = false; } }
private void BuildBody() { Distribution dist = new Distribution(appEnv.GetConnection()); DataTable dtd = dist.GetOrdered(ZoneID); int contentid = 0; int version = 0; if (dtd.Rows.Count > 0) { contentid = Convert.ToInt32(dtd.Rows[0]["ContentID"]); version = Convert.ToInt32(dtd.Rows[0]["Version"]); } Content content = new Content(appEnv.GetConnection()); DataRow dr = content.GetContentForIDVer(contentid, version); if (dr != null) { lbHeadline.Text = dr["Headline"].ToString(); lbSource.Text = dr["Source"].ToString().Trim(); lbByline.Text = property.GetValue(Convert.ToInt32(dr["Byline"]), "UserName").Trim(); lbTeaser.Text = dr["Teaser"].ToString().Trim(); hlReadMore.NavigateUrl = "StoryPg.aspx?ID=" + contentid + "&Ver=" + version; hlReadMore.Visible = true; lbBy.Visible = true; imgPlus.Visible = true; } else { lbHeadline.Text = "No Stories"; lbSource.Text = ""; lbByline.Text = ""; lbTeaser.Text = ""; hlReadMore.Visible = false; lbBy.Visible = false; imgPlus.Visible = false; } }
protected void Page_Load(object sender, System.EventArgs e) { aid = Convert.ToInt32(Request.QueryString["AccountID"]); if (aid == 0) { Page_Error("AccountID Missing"); } if (aid == 1) { bnRemove.Visible = false; } account = new Account(appEnv.GetConnection()); property = new AccountProperty(appEnv.GetConnection()); roles = new AccountRoles(appEnv.GetConnection()); dr = account.GetAccountForID(aid); lbUserID.Text = dr["UserName"].ToString(); lbUserName.Text = property.GetValue(aid, "UserName"); lbEmail.Text = dr["Email"].ToString(); DataTable roledt = roles.GetRolesForID(aid); foreach (DataRow drr in roledt.Rows) { lbRoles.Items.Add(drr["Role"].ToString()); } if (roledt.Rows.Count == 0) { lbRoles.Items.Add("User"); } }
private void Page_Load(object sender, System.EventArgs e) { cid = Convert.ToInt32(Request.QueryString["ContentID"]); origin = Request.QueryString["Origin"]; if (cid == 0) { Page_Error("ContentID Missing"); } AccountProperty property = new AccountProperty(appEnv.GetConnection()); account = new Account(appEnv.GetConnection()); note = new ContentNotes(appEnv.GetConnection()); DataTable dt = note.GetNotesForID(cid); LiteralControl lit; TableCell cell; lbWho.Text = origin; foreach (DataRow dr in dt.Rows) { TableRow row = new TableRow(); tblView.Rows.Add(row); lit = new LiteralControl(dr["ModifiedDate"].ToString()); cell = new TableCell(); cell.Font.Size = new FontUnit(FontSize.XSmall); cell.Controls.Add(lit); row.Cells.Add(cell); lit = new LiteralControl(property.GetValue(Convert.ToInt32(dr["Author"]), "UserName").Trim()); cell = new TableCell(); cell.Controls.Add(lit); cell.HorizontalAlign = HorizontalAlign.Center; row.Cells.Add(cell); string tmp = dr["Note"].ToString(); if (tmp.Length > 80) { tmp = tmp.Substring(0, 80); tmp += "..."; } lit = new LiteralControl(tmp); cell = new TableCell(); cell.Controls.Add(lit); row.Cells.Add(cell); BuildImageButton(row, "NoteView.aspx?NoteID=" + dr["NoteID"].ToString() + "&Origin=" + origin); if (account.GetAccountID(User.Identity.Name) == Convert.ToInt32(dr["Author"])) { BuildImageButton(row, "NoteUpdate.aspx?NoteID=" + dr["NoteID"].ToString() + "&Origin=" + origin); BuildImageButton(row, "NoteRemove.aspx?NoteID=" + dr["NoteID"].ToString() + "&Origin=" + origin); } else { BuildImageButton(row, null); BuildImageButton(row, null); } } }