Exemplo n.º 1
0
 /// <summary>绑定Grid数据
 ///
 /// </summary>
 /// <param name="ht">查询参数</param>
 /// <param name="isSearch">是否重新查询</param>
 private void BindData(Hashtable ht, bool isSearch)
 {
     GridOrders.DataSource = mamagement.GetManagementOrders(ht);
     GridOrders.DataBind();
     if (isSearch)
     {
         int pagecount = mamagement.GetManagementOrdersCount(ht);
         ht["PageCount"] = GridOrders.RecordCount = pagecount;
     }
     else
     {
         GridOrders.RecordCount = Convert.ToInt32(ht["PageCount"]);
     }
 }
        //查询结果绑定
        private void BindData()
        {
            Hashtable ht = new Hashtable();

            if (string.IsNullOrWhiteSpace(datebegin.Text) || string.IsNullOrWhiteSpace(dateend.Text))
            {
                MessageBoxShow("请输入开始时间及结束时间查询!", MessageBoxIcon.Information);
                return;
            }
            PageUtil pageUtil = new PageUtil(GridOrders.PageIndex, GridOrders.PageSize);

            ht["DateStart"] = datebegin.Text;
            ht["DateEnd"]   = Convert.ToDateTime(dateend.Text).AddDays(1).ToString("yyyy-MM-dd");
            if (DropDictLab.SelectedValue == "0")
            {
                ht["labid"] = Userinfo.joinLabidstr;
            }
            else
            {
                ht["labid"] = DropDictLab.SelectedValue;
            }
            ht["realname"]   = tbxName.Text = TextUtility.ReplaceText(tbxName.Text);
            ht["ordernum"]   = tbxOrderNum.Text;
            ht["status"]     = dropStatus.SelectedIndex == 0 ? null : dropStatus.SelectedValue;
            ht["customerid"] = DropCustomer.SelectedValue == "-1" ? null : DropCustomer.SelectedValue;
            ht["iscancel"]   = DropIScancel.SelectedIndex == 0 ? null : DropIScancel.SelectedValue;
            ht["pageStart"]  = pageUtil.GetPageStartNum();
            ht["pageEnd"]    = pageUtil.GetPageEndNum();

            GridOrders.RecordCount = mamagement.GetManagementOrdersCount(ht);
            GridOrders.DataSource  = mamagement.GetManagementOrders(ht);
            GridOrders.DataBind();
        }
Exemplo n.º 3
0
        //数据绑定
        private void BindData()
        {
            try
            {
                Hashtable ht       = new Hashtable();
                PageUtil  pageUtil = new PageUtil(gvList.PageIndex, gvList.PageSize);
                ht["DateStart"]  = dtpStart.Text;
                ht["DateEnd"]    = Convert.ToDateTime(dtpEnd.Text).AddDays(1).ToString("yyyy-MM-dd");
                ht["labid"]      = dropLab.SelectedValue;
                ht["realname"]   = tbxName.Text = TextUtility.ReplaceText(tbxName.Text);
                ht["customerid"] = dropCustomer.SelectedValue == "-1" ? null : dropCustomer.SelectedValue;
                ht["ordernum"]   = TextUtility.ReplaceText(tbxordernum.Text);
                ht["sex"]        = null;
                ht["iscancel"]   = "0";
                ht["iolis"]      = dropIOLIS.SelectedValue == "-1" ? null : dropIOLIS.SelectedValue;
                ht["status"]     = dropStatus.SelectedValue == "-1" ? null : dropStatus.SelectedValue;
                ht["pageStart"]  = pageUtil.GetPageStartNum();
                ht["pageEnd"]    = pageUtil.GetPageEndNum();

                gvList.RecordCount = mamagement.GetManagementOrdersCount(ht);
                gvList.DataSource  = mamagement.GetManagementOrders(ht);
                gvList.DataBind();
            }
            catch (Exception ex)
            {
                MessageBoxShow(ex.Message, MessageBoxIcon.Error);
            }
        }