示例#1
0
    protected void grdFYD_Sorting(object sender, GridViewSortEventArgs e)
    {
        if (string.IsNullOrEmpty(this.hidsort.Value))
        {
            this.hidsort.Value = "DESC";
        }
        else
        {
            if (this.hidsort.Value.Trim() == "DESC")
            {
                this.hidsort.Value = "ASC";
            }
            else
            {
                this.hidsort.Value = "DESC";
            }
        }
        string sortField = e.SortExpression.ToString();
        string strsort   = " order by " + sortField + "  " + this.hidsort.Value;

        this.hidStrSort.Value = strsort;

        string sqlWhere = GetSqlWhere();

        sqlWhere += strsort;

        DataSet ds = InDoorParam.GetFYDInfoSort(sqlWhere);

        this.grdFYD.DataSource = ds;
        this.grdFYD.DataBind();
    }
示例#2
0
    //protected void btnPrintFYD_Click(object sender, ImageClickEventArgs e)
    //{
    //    try
    //    {
    //        if (this.grdFYD.Rows.Count < 1)
    //        {
    //            this.PrintfError("没有要打印的记录!");
    //            return;
    //        }
    //        string sql = GetSqlWhere();
    //        sql = Server.UrlEncode(sql);
    //        this.WriteClientJava("window.open(\"../../Print.aspx?TYPE=3&QUERYSQL=" + sql + "\")");
    //    }
    //    catch (Exception ex)
    //    {
    //        String strEx = ex.Message;
    //        this.PrintfError("数据访问错误,请重试!");
    //        return;
    //    }
    //}
    #endregion

    protected void grdFYD_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.grdFYD.PageIndex = e.NewPageIndex;
        string sqlWhere = GetSqlWhere();

        if (string.IsNullOrEmpty(this.hidStrSort.Value))
        {
            sqlWhere += " order by FYDH ";
        }
        else
        {
            sqlWhere += this.hidStrSort.Value;
        }
        DataSet ds = InDoorParam.GetFYDInfoSort(sqlWhere);

        this.grdFYD.DataSource = ds;
        this.grdFYD.DataBind();
    }