Exemple #1
0
        public void ShowArticleInfo(string strID)
        {
            DAL.CMS.ArticleDAL dal = new DAL.CMS.ArticleDAL();
            DataSet            ds  = dal.GetArticleDetail(strID);

            Model.CMS.CMS_Article model = DataConvert.DataRowToModel <Model.CMS.CMS_Article>(ds.Tables[0].Rows[0]);
            this.txtArticleTitle.Text          = model.Title;
            this.hd_content.Value              = model.Content;
            this.ddlCategory.SelectedIndex     = this.ddlCategory.Items.IndexOf(this.ddlCategory.Items.FindByValue(model.Category));
            this.ddlArticleIsTop.SelectedIndex = this.ddlArticleIsTop.Items.IndexOf(this.ddlArticleIsTop.Items.FindByValue(model.IsTop ? "是" : "否"));
            this.txtSummary.Text = model.Summary;
            this.txtOrder.Text   = model.Order.ToString();
            this.img0.Src        = "../../" + model.Pic;
            if (strAction == "show")
            {
                this.btnReset.Visible = false;
                this.btnSave.Visible  = false;
            }
        }