Beispiel #1
0
 private void ShowInfo(int zixunID)
 {
     Maticsoft.BLL.ZiXunInfo   bll   = new Maticsoft.BLL.ZiXunInfo();
     Maticsoft.Model.ZiXunInfo model = bll.GetModel(zixunID);
     this.lblzixunID.Text        = model.zixunID.ToString();
     this.lblzixunTitle.Text     = model.zixunTitle;
     this.lblzixuntime.Text      = model.zixuntime.ToString();
     this.lblzixuncontent.Text   = model.zixuncontent;
     this.lblzixunUserName.Text  = model.zixunUserName;
     this.lblzixunuserPhoto.Text = model.zixunuserPhoto;
 }
Beispiel #2
0
        private void bind()
        {
            Maticsoft.BLL.ZiXunInfo zixunbll = new Maticsoft.BLL.ZiXunInfo();
            int index = int.Parse(Request.QueryString["zixunID"].ToString());

            Maticsoft.Model.ZiXunInfo zixunmodel = zixunbll.GetModel(index);
            lblname.Text         = zixunmodel.zixunUserName;
            lbltitle.Text        = zixunmodel.zixunTitle;
            lblphoto.Text        = zixunmodel.zixunuserPhoto;
            txtzixuncontent.Text = zixunmodel.zixuncontent;
            txtzixundaan.Text    = zixunmodel.ZiXundaan;
        }
Beispiel #3
0
        protected void btnok_Click(object sender, EventArgs e)
        {
            Maticsoft.BLL.ZiXunInfo   zixunbll   = new Maticsoft.BLL.ZiXunInfo();
            Maticsoft.Model.ZiXunInfo zixunmodel = zixunbll.GetModel(1);
            if (txtusename.Text.Trim() == "")
            {
                lblusername.Text = "请填写提问人姓名";
                return;
            }
            zixunmodel.zixunUserName = txtusename.Text.Trim();
            lblusername.Text         = "";
            if (txtlinkphoto.Text.Trim() == "")
            {
                lbllinkphoto.Text = "请填写您的联系方式";
                return;
            }
            zixunmodel.zixunuserPhoto = txtlinkphoto.Text.Trim();
            lbllinkphoto.Text         = "";
            if (txtzixuntitle.Text.Trim() == "")
            {
                lbltitile.Text = "请填写提问标题";
                return;
            }
            zixunmodel.zixunTitle = txtzixuntitle.Text.Trim();
            lbltitile.Text        = "";
            if (txtzixuncontent.Text.Trim() == "")
            {
                lblcontent.Text = "请填写提问内容";
                return;
            }
            zixunmodel.zixuncontent = txtzixuncontent.Text.Trim();
            lblcontent.Text         = "";
            if (txtzixundaan.Text.Trim() == "")
            {
                lbldaan.Text = "请填写您的答案";
                return;
            }

            zixunmodel.ZiXundaan = txtzixundaan.Text.Trim();
            lbldaan.Text         = "";
            zixunbll.Update(zixunmodel);
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('信息添加成功!')</script>");
            bind();
        }