コード例 #1
0
    protected void btnExport_Click(object sender, EventArgs e)
    {
        int isfetch = 0;

        DataTable dtCtpList = BLL_PURC_CTP.Get_Ctp_Contract_List(UDFLib.ConvertStringToNull(uc_SupplierListCTP.SelectedValue),
                                                                 UDFLib.ConvertIntegerToNull(uc_Purc_DepartmentListctp.SelectedValue),
                                                                 UDFLib.ConvertDateToNull(txtEffdtFrom.Text),
                                                                 UDFLib.ConvertDateToNull(txtEffdtTo.Text),
                                                                 UDFLib.ConvertStringToNull(chkQtnStatus.SelectedValue),
                                                                 UDFLib.ConvertIntegerToNull(chkContractStatus.SelectedValue),
                                                                 UDFLib.ConvertIntegerToNull(ctlPortListctp.SelectedValue),
                                                                 UDFLib.ConvertStringToNull(txtItemSearch.Text),
                                                                 null,
                                                                 null,
                                                                 ref isfetch);

        string[] HeaderCaptions  = new string[] { "Contract Code", "Effective Date", "Supplier Name", "Dept Name", "Catalogue Name", "Approved Item", "Not approved items", "Approved By", "Approved Date", "Status" };
        string[] DataColumnsName = new string[] { "QTN_Contract_Code", "Effective_Date", "Full_NAME", "Dept_Name", "System_Description", "APPROVED_ITEM_COUNT", "NOT_APPROVED_ITEM_COUNT", "First_Name", "Approved_Date", "QTN_STS" };
        string   FileHeaderName  = "Contract List";
        string   FileName        = "Contract_List";

        GridViewExportUtil.ShowExcel(dtCtpList, HeaderCaptions, DataColumnsName, FileName, FileHeaderName);
    }
コード例 #2
0
    protected void BindDataItems()
    {
        int is_Fetch_Count = ucCustomPagerctp.isCountRecord;

        gvContractList.DataSource = BLL_PURC_CTP.Get_Ctp_Contract_List(UDFLib.ConvertStringToNull(uc_SupplierListCTP.SelectedValue),
                                                                       UDFLib.ConvertIntegerToNull(uc_Purc_DepartmentListctp.SelectedValue),
                                                                       UDFLib.ConvertDateToNull(txtEffdtFrom.Text),
                                                                       UDFLib.ConvertDateToNull(txtEffdtTo.Text),
                                                                       UDFLib.ConvertStringToNull(chkQtnStatus.SelectedValue),
                                                                       UDFLib.ConvertIntegerToNull(chkContractStatus.SelectedValue),
                                                                       UDFLib.ConvertIntegerToNull(ctlPortListctp.SelectedValue),
                                                                       UDFLib.ConvertStringToNull(txtItemSearch.Text),
                                                                       ucCustomPagerctp.CurrentPageIndex,
                                                                       ucCustomPagerctp.PageSize,
                                                                       ref is_Fetch_Count);
        gvContractList.DataBind();

        if (ucCustomPagerctp.isCountRecord == 1)
        {
            ucCustomPagerctp.CountTotalRec = is_Fetch_Count.ToString();
            ucCustomPagerctp.BuildPager();
        }
    }