コード例 #1
0
    protected void BindInvoiceApprovedGrid()
    {
        try
        {
            objChangeReqstMerge.AddMergedColumns(new int[] { 2, 3, 4 }, "PO", "HeaderStyle-center");
            objChangeReqstMerge.AddMergedColumns(new int[] { 5, 6, 7, 8, 9, 10, 11, 12, 13 }, "Invoice", "HeaderStyle-center");
            objChangeReqstMerge.AddMergedColumns(new int[] { 14, 15 }, "Invoice Approved", "HeaderStyle-center");

            int    rowcount      = ucCustomPager1.isCountRecord;
            string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
            int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
            {
                sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
            }
            string InvoiceStatus   = (ViewState["InvoiceStatus"] == null) ? null : (ViewState["InvoiceStatus"].ToString());
            string InvoiceWorkflow = (ViewState["InvoiceWorkflow"] == null) ? null : (ViewState["InvoiceWorkflow"].ToString());
            //string InvoiceWorkflow = (ViewState["InvoiceWorkflow"] == null) ? null : (ViewState["InvoiceWorkflow"].ToString());

            DataSet ds = BLL_POLOG_Register.POLOG_Get_Approved_Invoice_Search(UDFLib.ConvertStringToNull(ddlSupplier.SelectedValue),
                                                                              UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue), UDFLib.ConvertStringToNull(ddlOwner.SelectedValue), chkUrgent.Checked ? 1 : 0, InvoiceStatus, InvoiceWorkflow, UDFLib.ConvertIntegerToNull(GetSessionUserID()), sortbycoloumn, sortdirection
                                                                              , ucCustomPager1.CurrentPageIndex, ucCustomPager1.PageSize, ref rowcount);


            if (ucCustomPager1.isCountRecord == 1)
            {
                ucCustomPager1.CountTotalRec = rowcount.ToString();
                ucCustomPager1.BuildPager();
            }

            if (ds.Tables[0].Rows.Count > 0)
            {
                divApprovedInvoice.Visible = true;
                btnApprove.Visible         = true;
                //btnApproveAll.Visible = true;
                //btnRework.Visible = true;
                //btnRefresh.Visible = true;
                //btnUnApprove.Visible = false;
                gvApprovedInvoice.DataSource = ds.Tables[0];
                gvApprovedInvoice.DataBind();
            }
            else
            {
                divApprovedInvoice.Visible   = false;
                gvApprovedInvoice.DataSource = ds.Tables[0];
                gvApprovedInvoice.DataBind();
            }
        }
        catch { }
        {
        }
    }