示例#1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            cid = Convert.ToInt32(Request.QueryString["ID"]);
            ver = Convert.ToInt32(Request.QueryString["Ver"]);

            if (cid == 0)
            {
                Page_Error("ContentID Missing");
            }

            if (ver == 0)
            {
                Page_Error("Version Missing");
            }

            zone = new Zone(appEnv.GetConnection());
            dtz  = zone.GetAllZones();

            foreach (DataRow dr in dtz.Rows)
            {
                lbZones.Items.Add(new ListItem(dr["Title"].ToString(),
                                               dr["ZoneID"].ToString()));
            }

            content = new MyContent(appEnv.GetConnection());
            drc     = content.GetContentForIDVer(cid, ver);

            tbWhichHeadline.Text = drc["Headline"].ToString();
            tbWhichBody.Text     = drc["Body"].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;
                }
            }
        }
示例#3
0
        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;
            }
        }
示例#4
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            cid = Convert.ToInt32(Request.QueryString["ID"]);
            ver = Convert.ToInt32(Request.QueryString["Ver"]);

            if (cid == 0)
            {
                Page_Error("ContentID Missing");
            }

            if (ver == 0)
            {
                Page_Error("Version Missing");
            }

            content = new MyContent(appEnv.GetConnection());

            dr = content.GetContentForIDVer(cid, ver);
            lbWhichHeadline.Text = dr["Headline"].ToString();
            lbWhichBody.Text     = dr["Body"].ToString();
        }
示例#5
0
        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"]);
            }

            MyContent content = new MyContent(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;
            }
        }
示例#6
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            zone    = new Zone(appEnv.GetConnection());
            dist    = new Distribution(appEnv.GetConnection());
            content = new MyContent(appEnv.GetConnection());

            LiteralControl lit;
            TableCell      cell;
            DropDownList   ddlRank;
            DataTable      AllRanks = null;

            string inZone = Request.QueryString["Zone"];

            DataTable dtz = zone.GetAllZones();

            DataTable dt = content.GetHeadlines();

            if (dt.Rows.Count > 0)
            {
                int prv = -1;
                int cur;

                foreach (DataRow dr in dt.Rows)
                {
                    cur = Convert.ToInt32(dr["ContentID"]);

                    if (cur != prv)
                    {
                        prv = cur;

                        if (StatusCodes.isApproved(dr["Status"].ToString()))
                        {
                            TableRow row = new TableRow();
                            tblNewContent.Rows.Add(row);

                            lit  = new LiteralControl(dr["Headline"].ToString());
                            cell = new TableCell();
                            cell.Controls.Add(lit);
                            row.Cells.Add(cell);

                            BuildImageButton(row, "DeployView.aspx?ID=" + dr["ContentID"] +
                                             "&Ver=" + dr["Version"]);
                            BuildImageButton(row, "DeployDeploy.aspx?ID=" + dr["ContentID"] +
                                             "&Ver=" + dr["Version"]);
                            BuildImageButton(row, "DeployReturn.aspx?ID=" + dr["ContentID"] +
                                             "&Ver=" + dr["Version"]);
                        }
                    }
                }
            }

            if (!IsPostBack)
            {
                if (inZone == null)
                {
                    inZone = "None";
                }

                ListItem item;

                ddlZones.Items.Add(new ListItem("None"));

                ddlZones.Items.Add(item = new ListItem("All"));
                if (inZone.Equals("All"))
                {
                    item.Selected = true;
                }

                foreach (DataRow dr in dtz.Rows)
                {
                    ddlZones.Items.Add(item = new ListItem(dr["Title"].ToString()));

                    if (dr["Title"].ToString().Trim().Equals(inZone))
                    {
                        item.Selected = true;
                    }
                }
            }

//          else
//          {
            foreach (DataRow dr in dtz.Rows)
            {
                DataTable dtd = dist.GetOrdered(Convert.ToInt32(dr["ZoneID"]));


                if (ddlZones.SelectedItem.Text.Equals("All") ||
                    ddlZones.SelectedItem.Text.Equals(dr["Title"]))
                {
                    if (dtd.Rows.Count == 0)
                    {
                        TableRow row = new TableRow();
                        tblSiteContent.Rows.Add(row);

                        lit  = new LiteralControl(dr["Title"].ToString());
                        cell = new TableCell();
                        cell.Controls.Add(lit);
                        row.Cells.Add(cell);

                        lit             = new LiteralControl("No Content");
                        cell            = new TableCell();
                        cell.ColumnSpan = 4;
                        cell.Controls.Add(lit);
                        row.Cells.Add(cell);
                    }
                    foreach (DataRow drd in dtd.Rows)
                    {
                        TableRow row = new TableRow();
                        tblSiteContent.Rows.Add(row);

                        lit  = new LiteralControl(dr["Title"].ToString());
                        cell = new TableCell();
                        cell.Controls.Add(lit);
                        row.Cells.Add(cell);

                        DataRow drc = content.GetContentForIDVer(Convert.ToInt32(drd["ContentID"]),
                                                                 Convert.ToInt32(drd["Version"]));

                        lit  = new LiteralControl(drc["Headline"].ToString());
                        cell = new TableCell();
                        cell.Controls.Add(lit);
                        row.Cells.Add(cell);

                        if (AllRanks == null)
                        {
                            AllRanks = new ContentRank(appEnv.GetConnection()).GetRanks();
                        }

                        cell    = new TableCell();
                        ddlRank = new DropDownList();
                        foreach (DataRow drr in AllRanks.Rows)
                        {
                            ddlRank.Items.Add(new ListItem(drr["Rank"].ToString(),
                                                           drr["RankID"].ToString()));
                        }
                        ddlRank.Items.FindByValue(drd["Ranking"].ToString()).Selected = true;
                        cell.Controls.Add(ddlRank);
                        row.Cells.Add(cell);

                        BuildImageButton(row, "DeployView.aspx?ID=" + drd["ContentID"] +
                                         "&Ver=" + drd["Version"]);
                        BuildImageButton(row, "DeployArchive.aspx?ID=" + drd["ContentID"] +
                                         "&Ver=" + drd["Version"]);
                    }
                }
            }
//          }
        }