Exemplo n.º 1
0
    /// <summary>
    /// 绑定
    /// </summary>
    public void Bind()
    {
        Hi.Model.BD_ShopMessage model = OrderBll.GetModel(int.Parse(Request.QueryString["ID"].ToString()));

        this.lblname.InnerText   = model.Name;
        this.lblphone.InnerText  = model.Phone;
        this.lblremark.InnerText = model.Remark;
        this.lblread.InnerText   = model.IsRead == 0 ? "未读" : "已读";
        this.lblDate.InnerText   = model.CreateDate.ToString("yyyy-MM-dd");
        model.IsRead             = 1;
        model.ID = int.Parse(Request.QueryString["ID"].ToString());
        bool bol = new Hi.BLL.BD_ShopMessage().Update(model);
    }
Exemplo n.º 2
0
    public void DataBinds()
    {
        int    pageCount = 0;
        int    Counts    = 0;
        string strwhere  = " and compid=" + this.CompID + " and isnull(dr,0)=0";

        if (!string.IsNullOrEmpty(txtPhone.Value.Trim()))
        {
            strwhere += " and remark like '%" + txtPhone.Value.Trim() + "%'";
        }
        if (!string.IsNullOrEmpty(ddlRead.SelectedValue.Trim()))
        {
            if (ddlRead.SelectedValue.Trim() == "0" || ddlRead.SelectedValue.Trim() == "1")
            {
                strwhere += " and isread =" + ddlRead.SelectedValue.Trim();
            }
        }
        //ViewState["strwhere"] = where;
        //if (ViewState["strwhere"] != null)
        //{
        //    strwhere += ViewState["strwhere"].ToString();
        //}
        if (this.txtPageSize.Value.ToString() != "")
        {
            if (this.txtPageSize.Value.Trim().Length >= 5)
            {
                Pager.PageSize         = 100;
                this.txtPageSize.Value = "100";
            }
            else
            {
                Pager.PageSize = this.txtPageSize.Value.Trim().ToInt(0);
            }
        }

        List <Hi.Model.BD_ShopMessage> LDis = new Hi.BLL.BD_ShopMessage().GetList(Pager.PageSize, Pager.CurrentPageIndex, "Createdate", false, strwhere, out pageCount, out Counts);

        this.Rpt_Role.DataSource = LDis;
        this.Rpt_Role.DataBind();
        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
    }
Exemplo n.º 3
0
 //删除
 protected void btnDelate_Click(object sender, EventArgs e)
 {
     try
     {
         if (Request.QueryString["ID"] != "")
         {
             Hi.Model.BD_ShopMessage model = OrderBll.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
             model.dr = 1;
             model.ID = int.Parse(Request.QueryString["ID"].ToString());
             bool bol = new Hi.BLL.BD_ShopMessage().Update(model);
             if (bol)
             {
                 Response.Redirect("ShopMessage.aspx");
             }
         }
     }
     catch (Exception)
     {
         Response.Redirect("ShopMessage.aspx");
     }
 }