Ejemplo n.º 1
0
    protected void ImgBtnExportUnion_OnClick(object sender, EventArgs e)
    {
        try
        {
            BLL_Crew_Admin objBLL  = new BLL_Crew_Admin();
            DataTable      dtUnion = objBLL.CRW_LIB_ExportUnionWithBranchs(txtfilter.Text.Trim());

            string[] HeaderCaptions  = null;
            string[] DataColumnsName = null;

            if (hdnAddressType.Value == "0")//US
            {
                HeaderCaptions = new string[10] {
                    "Union ", "Union Branch", "Address Line 1", "Address Line 2", "City", "State", "ZipCode", "Country", "Phone Number", "Email"
                };
                DataColumnsName = new string[10] {
                    "UnionName", "UnionBranch", "AddressLine1", "AddressLine2", "City", "State", "ZipCode", "Country_Name", "PhoneNumber", "Email"
                };
            }
            else if (hdnAddressType.Value == "1")///International
            {
                HeaderCaptions = new string[6] {
                    "Union ", "Union Branch", "Address", "Country", "Phone Number", "Email"
                };
                DataColumnsName = new string[6] {
                    "UnionName", "UnionBranch", "Address", "Country_Name", "PhoneNumber", "Email"
                };
            }
            GridViewExportUtil.ShowExcel(dtUnion, HeaderCaptions, DataColumnsName, "Union", "Union", "");
        }
        catch (Exception ex)
        {
        }
    }