Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region Tab Pages
        //if (!NewMode)
        //     ShowDetails();
        //else
        //{
        //     RadMultiPage1.SelectedIndex = 0;
        //     tsComments.Tabs[0].Selected = true;
        //}
        #endregion
        BOLClass        = new BOLComments();
        lblSysName.Text = BOLClass.PageLable;

        if ((Code == null) && (!NewMode))
        {
            return;
        }
        if (!Page.IsPostBack)
        {
            //if (!NewMode) ShowDetails();


            #region Fill Combo
            cboHCCommentStatusCode.DataSource = new BOLHardCode().GetHCDataTable("HCCommentStatuses");
            cboHCSectionCode.DataSource       = new BOLHardCode().GetHCDataTable("HCSections");
            cboHCLanguageCode.DataSource      = new BOLHardCode().GetHCDataTable("HCLanguages");

            #endregion
            if (!NewMode)
            {
                LoadData((int)Code);
                BOLComments CommentsBOL   = new BOLComments();
                Comments    CurComment    = CommentsBOL.GetData((int)Code);
                int         HCSectionCode = CurComment.HCSectionCode;
                if (HCSectionCode == 1)//News
                {
                    BOLNews NewsBOL = new BOLNews();
                    News    CurNews = NewsBOL.GetData((int)CurComment.ItemCode);
                    if (CurNews != null)
                    {
                        hplItem.Text        = CurNews.Title;
                        hplItem.NavigateUrl = "~/Admin/News/EditNews.aspx?Code=" + CurComment.ItemCode;
                    }
                }
            }
        }
    }