Ejemplo n.º 1
0
 private void bind(int weilanid)
 {
     Maticsoft.BLL.WeiLanInfo   weilanbll   = new Maticsoft.BLL.WeiLanInfo();
     Maticsoft.Model.WeiLanInfo weilanmodel = weilanbll.GetModel(weilanid);
     lblFatime.Text     = Convert.ToDateTime(weilanmodel.Fatime.ToString()).ToString("yyyy-MM-dd");
     lblWeicontent.Text = weilanmodel.Weicontent;
     lblWeiTitle.Text   = weilanmodel.WeiTitle;
     lblWrite.Text      = weilanmodel.Write;
     if (weilanmodel.HitNum == null)
     {
         int hitnum = 0;
         hitnum            += 1;
         weilanmodel.HitNum = hitnum;
         weilanbll.Update(weilanmodel);
         lblhitnum.Text = hitnum.ToString();
     }
     else
     {
         int hitnum = int.Parse(weilanmodel.HitNum.ToString());
         hitnum            += 1;
         weilanmodel.HitNum = hitnum;
         weilanbll.Update(weilanmodel);
         lblhitnum.Text = hitnum.ToString();
     }
 }
Ejemplo n.º 2
0
        protected void dataweilan_DeleteCommand(object source, DataListCommandEventArgs e)
        {
            int index = int.Parse(dataweilan.DataKeys[e.Item.ItemIndex].ToString());

            Maticsoft.BLL.WeiLanInfo weilanbll = new Maticsoft.BLL.WeiLanInfo();
            weilanbll.Delete(index);
            lblpage.Text = "";
            bind();
        }
Ejemplo n.º 3
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtWeiTitle.Text.Trim().Length == 0)
            {
                strErr += "WeiTitle不能为空!\\n";
            }
            if (this.txtWeiKey.Text.Trim().Length == 0)
            {
                strErr += "WeiKey不能为空!\\n";
            }
            if (!PageValidate.IsDateTime(txtFatime.Text))
            {
                strErr += "Fatime格式错误!\\n";
            }
            if (this.txtWrite.Text.Trim().Length == 0)
            {
                strErr += "Write不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtHitNum.Text))
            {
                strErr += "HitNum格式错误!\\n";
            }
            if (this.txtWeicontent.Text.Trim().Length == 0)
            {
                strErr += "Weicontent不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int      WeiID      = int.Parse(this.lblWeiID.Text);
            string   WeiTitle   = this.txtWeiTitle.Text;
            string   WeiKey     = this.txtWeiKey.Text;
            DateTime Fatime     = DateTime.Parse(this.txtFatime.Text);
            string   Write      = this.txtWrite.Text;
            int      HitNum     = int.Parse(this.txtHitNum.Text);
            string   Weicontent = this.txtWeicontent.Text;


            Maticsoft.Model.WeiLanInfo model = new Maticsoft.Model.WeiLanInfo();
            model.WeiID      = WeiID;
            model.WeiTitle   = WeiTitle;
            model.WeiKey     = WeiKey;
            model.Fatime     = Fatime;
            model.Write      = Write;
            model.HitNum     = HitNum;
            model.Weicontent = Weicontent;

            Maticsoft.BLL.WeiLanInfo bll = new Maticsoft.BLL.WeiLanInfo();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
Ejemplo n.º 4
0
 private void ShowInfo(int WeiID)
 {
     Maticsoft.BLL.WeiLanInfo   bll   = new Maticsoft.BLL.WeiLanInfo();
     Maticsoft.Model.WeiLanInfo model = bll.GetModel(WeiID);
     this.lblWeiID.Text      = model.WeiID.ToString();
     this.txtWeiTitle.Text   = model.WeiTitle;
     this.txtWeiKey.Text     = model.WeiKey;
     this.txtFatime.Text     = model.Fatime.ToString();
     this.txtWrite.Text      = model.Write;
     this.txtHitNum.Text     = model.HitNum.ToString();
     this.txtWeicontent.Text = model.Weicontent;
 }
Ejemplo n.º 5
0
        private void bind()
        {
            Maticsoft.BLL.WeiLanInfo weilanbll = new Maticsoft.BLL.WeiLanInfo();
            int index = int.Parse(Request.QueryString["WeiID"].ToString());

            Maticsoft.Model.WeiLanInfo weilanmodel = weilanbll.GetModel(index);
            txtcontent.Text     = weilanmodel.Weicontent;
            txtFatime.Text      = Convert.ToDateTime(weilanmodel.Fatime.ToString()).ToString("yyyy-MM-dd");
            txtkeyword.Text     = weilanmodel.WeiKey;
            txtwrite.Text       = weilanmodel.Write;
            txtzhishititle.Text = weilanmodel.WeiTitle;
        }
Ejemplo n.º 6
0
        private void bind()
        {
            Maticsoft.BLL.WeiLanInfo weilanbll = new Maticsoft.BLL.WeiLanInfo();
            int pageSize = 15; //每页大小
            int page     = 1;  //当前第几页
            int recordCount;   //总共有多少条数据

            recordCount = weilanbll.GetweilanCount("");
            int pageCount = recordCount / pageSize + 1;//共有多少页

            if (recordCount % pageSize == 0)
            {
                pageCount--;
            }
            if (Request.QueryString["page"] != null)
            {
                if (Request.QueryString["page"].ToString() != "")
                {
                    page = int.Parse(Request.QueryString["page"].ToString());
                }
            }
            DataSet ds = weilanbll.GetweilanList(pageSize * (page - 1), pageSize, "");

            dataweilan.DataSource   = ds;
            dataweilan.DataKeyField = "WeiID";
            dataweilan.DataBind();
            if (ds.Tables[0].Rows.Count > 0)
            {
                this.lblpage.Text += "共有<b>" + recordCount + "</b>条记录&nbsp; ";
                this.lblpage.Text += "当前第<b>" + page + "</b>页&nbsp;&nbsp;";
                if (page == 1)
                {
                    this.lblpage.Text += "首页&nbsp;";
                    this.lblpage.Text += "上一页&nbsp;";
                }
                else
                {
                    this.lblpage.Text += "<a href='zhishi.aspx?page=" + 1 + " '>首页</a>&nbsp;";
                    this.lblpage.Text += "<a href='zhishi.aspx?page=" + (page - 1).ToString() + "  '>上一页</a>&nbsp;";
                }
                if (page == pageCount)
                {
                    this.lblpage.Text += "下一页&nbsp;";
                    this.lblpage.Text += "尾页&nbsp;";
                }
                else
                {
                    this.lblpage.Text += "<a href='zhishi.aspx?page=" + (page + 1).ToString() + "  '>下一页</a>&nbsp;";
                    this.lblpage.Text += "<a href='zhishi.aspx?page=" + pageCount.ToString() + " '>尾页</a>&nbsp;";
                }
            }
        }
Ejemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         bind();
         Maticsoft.BLL.WeiLanInfo weilanbll = new Maticsoft.BLL.WeiLanInfo();
         DataSet weilands = weilanbll.GetList(6, "", " Fatime desc");
         datazhishi.DataSource = weilands;
         datazhishi.DataBind();
         Maticsoft.BLL.FuWuInfo fuwubll = new Maticsoft.BLL.FuWuInfo();
         DataSet fuwuds = fuwubll.GetList(6, "", "Fatime desc");
         datafuwu.DataSource = fuwuds;
         datafuwu.DataBind();
     }
 }
Ejemplo n.º 8
0
        private void bind()
        {
            Maticsoft.BLL.NewsInfo newbll = new Maticsoft.BLL.NewsInfo();
            DataSet newds = newbll.GetList(7, "", " Fatime desc ");

            datanews.DataSource = newds;
            datanews.DataBind();
            Maticsoft.BLL.NicheInfo nichebll = new Maticsoft.BLL.NicheInfo();
            DataSet nicheds = nichebll.GetList(6, "", "Fatime desc");

            dataniche.DataSource = nicheds;
            dataniche.DataBind();
            Maticsoft.BLL.Product probll = new Maticsoft.BLL.Product();
            DataSet prods = probll.GetList(4, "", " Fatime desc");

            datapro.DataSource = prods;
            datapro.DataBind();
            Maticsoft.BLL.WeiLanInfo weilanbll = new Maticsoft.BLL.WeiLanInfo();
            DataSet weilands = weilanbll.GetList(6, "", " Fatime desc ");

            dataweilan.DataSource = weilands;
            dataweilan.DataBind();
            DataSet toujiands = probll.GetList(4, " Toujian=1 ", "  Fatime desc");

            datatoujian.DataSource = toujiands;
            datatoujian.DataBind();
            Maticsoft.BLL.ZiXunInfo zixunbll = new Maticsoft.BLL.ZiXunInfo();
            DataSet zixunds = zixunbll.GetList(6, "ZiXundaan is not null", " zixuntime desc ");

            dataxiangmo.DataSource = zixunds;
            dataxiangmo.DataBind();
            Maticsoft.BLL.JiShuInfo jishubll = new Maticsoft.BLL.JiShuInfo();
            DataSet jishuds = jishubll.GetList(6, "", " Fatime desc ");

            datajishu.DataSource = jishuds;
            datajishu.DataBind();
            Maticsoft.BLL.FuWuInfo fuwubll = new Maticsoft.BLL.FuWuInfo();
            DataSet fuwuds = fuwubll.GetList(6, "", "  Fatime desc ");

            datafuwu.DataSource = fuwuds;
            datafuwu.DataBind();
        }
Ejemplo n.º 9
0
 protected void btnok_Click(object sender, EventArgs e)
 {
     Maticsoft.BLL.WeiLanInfo   weilanbll   = new Maticsoft.BLL.WeiLanInfo();
     Maticsoft.Model.WeiLanInfo weilanmodel = new Maticsoft.Model.WeiLanInfo();
     if (txtzhishititle.Text.Trim() == "")
     {
         lbltitle.Text = "请填写围栏标题";
         return;
     }
     weilanmodel.WeiTitle = txtzhishititle.Text.Trim();
     lbltitle.Text        = "";
     if (txtkeyword.Text.Trim() == "")
     {
         lblkeyword.Text = "请填写关键字";
         return;
     }
     weilanmodel.WeiKey = txtkeyword.Text.Trim();
     lblkeyword.Text    = "";
     if (txtFatime.Text.Trim() == "")
     {
         lblfatime.Text = "请填写发布时间";
         return;
     }
     weilanmodel.Fatime = Convert.ToDateTime(txtFatime.Text.Trim());
     lblfatime.Text     = "";
     if (txtwrite.Text.Trim() == "")
     {
         lblwrite.Text = "请填写发布人";
         return;
     }
     weilanmodel.Write      = txtwrite.Text.Trim();
     lblwrite.Text          = "";
     weilanmodel.Weicontent = txtcontent.Text.Trim();
     weilanbll.Add(weilanmodel);
     Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('信息添加成功!')</script>");
     txtcontent.Text     = string.Empty;
     txtFatime.Text      = string.Empty;
     txtkeyword.Text     = string.Empty;
     txtwrite.Text       = string.Empty;
     txtzhishititle.Text = string.Empty;
 }
Ejemplo n.º 10
0
        protected void btnok_Click(object sender, EventArgs e)
        {
            Maticsoft.BLL.WeiLanInfo weilanbll = new Maticsoft.BLL.WeiLanInfo();
            int index = int.Parse(Request.QueryString["WeiID"].ToString());

            Maticsoft.Model.WeiLanInfo weilanmodel = weilanbll.GetModel(index);
            if (txtzhishititle.Text.Trim() == "")
            {
                lbltitle.Text = "请填写围栏标题";
                return;
            }
            weilanmodel.WeiTitle = txtzhishititle.Text.Trim();
            lbltitle.Text        = "";
            if (txtkeyword.Text.Trim() == "")
            {
                lblkeyword.Text = "请填写关键字";
                return;
            }
            weilanmodel.WeiKey = txtkeyword.Text.Trim();
            lblkeyword.Text    = "";
            if (txtFatime.Text.Trim() == "")
            {
                lblfatime.Text = "请填写发布时间";
                return;
            }
            weilanmodel.Fatime = Convert.ToDateTime(txtFatime.Text.Trim());
            lblfatime.Text     = "";
            if (txtwrite.Text.Trim() == "")
            {
                lblwrite.Text = "请填写发布人";
                return;
            }
            weilanmodel.Write      = txtwrite.Text.Trim();
            lblwrite.Text          = "";
            weilanmodel.Weicontent = txtcontent.Text.Trim();
            weilanbll.Update(weilanmodel);
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('信息添加成功!')</script>");
            bind();
        }