示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string querystring = Request.QueryString["ID"];

            if (querystring != null)
            {
                if (!IsPostBack)
                {
                    loadDropDown(ddCategory, csql.getAnnouncementsCategory("SmartConcepcion"), true);
                    p_AnnouncementID = Convert.ToInt64(querystring);
                    p_dtAnnouncement = csql.getAnnouncementsInfo("SmartConcepcion", p_AnnouncementID.Value);

                    if (p_dtAnnouncement.Rows.Count > 0)
                    {
                        txtTitle.Text    = p_dtAnnouncement.Rows[0]["title"].ToString();
                        txtSubtitle.Text = p_dtAnnouncement.Rows[0]["subtitle"].ToString();
                        txtContent.Text  = p_dtAnnouncement.Rows[0]["body_content"].ToString();
                        txtDate.Text     = Convert.ToDateTime(p_dtAnnouncement.Rows[0]["publisheddate"].ToString()).ToString("yyyy-MM-ddTHH:mm:ss");

                        ddCategory.SelectedValue = p_dtAnnouncement.Rows[0]["category_code"].ToString();
                    }
                }
            }
            else
            {
                if (!IsPostBack)
                {
                    loadDropDown(ddCategory, csql.getAnnouncementsCategory("SmartConcepcion"), true);
                    pnlZone.Visible  = false;
                    p_AnnouncementID = null;
                }
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string _id = Request.QueryString["ID"];

            if (_id == null)
            {
                Response.Redirect("News");
            }

            if (!IsPostBack)
            {
                p_AnnouncementID     = Convert.ToInt64(_id);
                p_dtAnnouncementInfo = csql.getAnnouncementsInfo("SmartConcepcion", p_AnnouncementID.Value);

                p_dtTopAnnouncement = csql.getTopAnnoucements("SmartConcepcion");

                loadGridView(gvTopAnnouncement, p_dtTopAnnouncement);
                loadProfilePicture();
                loadInfo();
                loadComment();
            }
        }