Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.ddlbClassID.Items.Clear();
         PaducnSoft.DAL.ay_newsclass dal_class = new PaducnSoft.DAL.ay_newsclass();
         DataSet dsClass = dal_class.GetList("");
         this.ddlbClassID.DataTextField  = "bName";
         this.ddlbClassID.DataValueField = "bId";
         this.ddlbClassID.DataSource     = dsClass;
         this.ddlbClassID.DataBind();
         this.ddlbClassID.Items.Insert(0, new ListItem("--全部分类--", "0"));
         BindDataList();
     }
 }
Exemplo n.º 2
0
        protected void InitControls()
        {
            this.bTitle.Text = "";
            this.bClassID.Items.Clear();
            PaducnSoft.DAL.ay_newsclass dal_class = new PaducnSoft.DAL.ay_newsclass();
            DataSet dsClass = dal_class.GetList("");

            this.bClassID.DataTextField  = "bName";
            this.bClassID.DataValueField = "bId";
            this.bClassID.DataSource     = dsClass;
            this.bClassID.DataBind();
            this.bClassID.Items.Insert(0, new ListItem("----选择分类----", "0"));
            this.bKeywords.Text  = "";
            this.bPic.Text       = "";
            this.bIsTop.Checked  = false;
            this.bIsBest.Checked = false;
            this.bIsPass.Checked = true;
            this.bClick.Text     = "0";
            this.bContent.Text   = "";
            ScriptManager1.SetFocus(this.bTitle);
        }
Exemplo n.º 3
0
        private void ShowInfo(int bId)
        {
            this.bClassID.Items.Clear();
            PaducnSoft.DAL.ay_newsclass dal_class = new PaducnSoft.DAL.ay_newsclass();
            DataSet dsClass = dal_class.GetList("");

            this.bClassID.DataTextField  = "bName";
            this.bClassID.DataValueField = "bId";
            this.bClassID.DataSource     = dsClass;
            this.bClassID.DataBind();
            this.bClassID.Items.Insert(0, new ListItem("----选择分类----", "0"));

            PaducnSoft.Model.ay_news model = dal.GetModel(bId);
            this.bId.Value              = model.bId.ToString();
            this.bTitle.Text            = model.bTitle;
            this.bClassID.SelectedValue = model.bClassID.ToString();
            this.bKeywords.Text         = model.bKeywords;
            this.bPic.Text              = model.bPic;
            this.bClick.Text            = model.bClick.ToString();
            this.bContent.Text          = Server.HtmlDecode(model.bContent);
            this.bIsTop.Checked         = model.bIsTop.ToString() == "1" ? true : false;
            this.bIsBest.Checked        = model.bIsBest.ToString() == "1" ? true : false;
            this.bIsPass.Checked        = model.bIsPass.ToString() == "1" ? true : false;
        }