Esempio n. 1
0
    public void BindMakerGrid()
    {
        BLL_Infra_Supplier objSupp = new BLL_Infra_Supplier();

        int rowcount = ucCustomPagerItems.isCountRecord;

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


        DataTable dt = objSupp.Get_Suppliers_List_Search(txtfilter.Text != "" ? txtfilter.Text : null, sortbycoloumn, sortdirection, null, null, ref rowcount);


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

        if (dt.Rows.Count > 0)
        {
            gvSuppliers.DataSource = dt;
            gvSuppliers.DataBind();
        }
        else
        {
            gvSuppliers.DataSource = dt;
            gvSuppliers.DataBind();
        }
    }
Esempio n. 2
0
    protected void ImgExpExcel_Click(object sender, EventArgs e)
    {
        BLL_Infra_Supplier objSupp = new BLL_Infra_Supplier();

        int rowcount = ucCustomPagerItems.isCountRecord;

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


        DataTable dt = objSupp.Get_Suppliers_List_Search(txtfilter.Text != "" ? txtfilter.Text : null, sortbycoloumn, sortdirection, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);

        string[] HeaderCaptions  = { "Vessel", "Port", "Arrival", "Berthing", "Departure", "Remaks" };
        string[] DataColumnsName = { "Vessel_Name", "Port_Name", "Arrival", "Berthing", "Departure", "Port_Remarks" };

        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "PortCall", "Port Call", "");
    }
Esempio n. 3
0
    protected void ImgExpExcel_Click(object sender, EventArgs e)
    {
        BLL_Infra_Supplier objSupp = new BLL_Infra_Supplier();

        int rowcount = ucCustomPagerItems.isCountRecord;

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


        DataTable dt = objSupp.Get_Suppliers_List_Search(txtfilter.Text != "" ? txtfilter.Text : null, sortbycoloumn, sortdirection, null, null, ref rowcount);

        string[] HeaderCaptions  = { "Code", "Name", "Country", "Email", "Address", "Phone", "Fax" };
        string[] DataColumnsName = { "Supplier_Code", "Supplier_Name", "Country", "Email", "Address", "Phone", "fax" };

        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "Maker", "Maker", "");
    }