Esempio n. 1
0
    protected void Load_CrewProcessingFee()
    {
        int    FleetCode       = UDFLib.ConvertToInteger(ddlFleet.SelectedValue);
        int    VesselID        = UDFLib.ConvertToInteger(ddlVessel.SelectedValue);
        int    ManningOfficeID = UDFLib.ConvertToInteger(ddlManningOffice.SelectedValue);
        int    Rank_Category   = UDFLib.ConvertToInteger(ddlRankCategory.SelectedValue);
        int    Crew_Status     = UDFLib.ConvertToInteger(ddlStatus.SelectedValue);
        int    Fee_Type        = UDFLib.ConvertToInteger(ddlFeeType.SelectedValue);
        int    Approved_Status = UDFLib.ConvertToInteger(rdoApprovedStatus.SelectedValue);
        string Sign_On_From    = txtSignOnFrom.Text;
        string Sign_On_To      = txtSignOnTo.Text;
        string Approved_From   = txtApprovedFrom.Text;
        string Approved_To     = txtApprovedTo.Text;
        string SearchText      = txtSearchText.Text;

        int     PAGE_SIZE         = ucCustomPager_CrewList.PageSize;
        int     PAGE_INDEX        = ucCustomPager_CrewList.CurrentPageIndex;
        int     SelectRecordCount = ucCustomPager_CrewList.isCountRecord;
        decimal GrandTotal        = 0;

        DataTable dt = BLL_Crew_Disbursement.Get_AllCrewFeeStatus(FleetCode, VesselID, ManningOfficeID, Rank_Category, GetSessionUserID(), Crew_Status, Fee_Type, Approved_Status, UDFLib.ConvertToDefaultDt(Sign_On_From), UDFLib.ConvertToDefaultDt(Sign_On_To), UDFLib.ConvertToDefaultDt(Approved_From), UDFLib.ConvertToDefaultDt(Approved_To), PAGE_SIZE, PAGE_INDEX, ref SelectRecordCount, ref GrandTotal, int.Parse(ddlMonth.SelectedValue), int.Parse(ddlYear.SelectedValue), SearchText);

        lblGrandTotal.Text = GrandTotal.ToString();

        if (ucCustomPager_CrewList.isCountRecord == 1)
        {
            ucCustomPager_CrewList.CountTotalRec = SelectRecordCount.ToString();
            ucCustomPager_CrewList.BuildPager();
        }

        GridView_Crew.DataSource = dt;
        GridView_Crew.DataBind();
    }
Esempio n. 2
0
    protected void ImgExportToExcel_Click(object sender, EventArgs e)
    {
        try
        {
            int    FleetCode       = UDFLib.ConvertToInteger(ddlFleet.SelectedValue);
            int    VesselID        = UDFLib.ConvertToInteger(ddlVessel.SelectedValue);
            int    ManningOfficeID = UDFLib.ConvertToInteger(ddlManningOffice.SelectedValue);
            int    Rank_Category   = UDFLib.ConvertToInteger(ddlRankCategory.SelectedValue);
            int    Crew_Status     = UDFLib.ConvertToInteger(ddlStatus.SelectedValue);
            int    Fee_Type        = UDFLib.ConvertToInteger(ddlFeeType.SelectedValue);
            int    Approved_Status = UDFLib.ConvertToInteger(rdoApprovedStatus.SelectedValue);
            string Sign_On_From    = txtSignOnFrom.Text;
            string Sign_On_To      = txtSignOnTo.Text;
            string Approved_From   = txtApprovedFrom.Text;
            string Approved_To     = txtApprovedTo.Text;
            string SearchText      = txtSearchText.Text;

            string[] HeaderCaptions  = { "Manning Office", "Vessel", "S/Code", "Name", "Rank", "S/On Date", "S/Off Date", "Fee Type", "Due Date", "Due Amt", "Approved Amt", "Approved By", "Approved Date", "Remarks" };
            string[] DataColumnsName = { "manning_Office", "Vessel_Short_Name", "Staff_Code", "Staff_FullName", "Rank_Short_Name", "Sign_On_Date1", "Sign_Off_Date1", "FeeTypeName", "Due_Date1", "Due_Amount", "Approved_Amount", "ApprovedBy", "Approved_Date1", "Remarks" };


            int     PAGE_SIZE         = 0;
            int     PAGE_INDEX        = 0;
            int     SelectRecordCount = 0;
            decimal GrandTotal        = 0;

            DataTable dt = BLL_Crew_Disbursement.Get_AllCrewFeeStatus(FleetCode, VesselID, ManningOfficeID, Rank_Category, GetSessionUserID(), Crew_Status, Fee_Type, Approved_Status, UDFLib.ConvertToDefaultDt(Sign_On_From), UDFLib.ConvertToDefaultDt(Sign_On_To), UDFLib.ConvertToDefaultDt(Approved_From), UDFLib.ConvertToDefaultDt(Approved_To), UDFLib.ConvertIntegerToNull(PAGE_SIZE), UDFLib.ConvertIntegerToNull(PAGE_INDEX), ref SelectRecordCount, ref GrandTotal, int.Parse(ddlMonth.SelectedValue), int.Parse(ddlYear.SelectedValue), SearchText);

            DataTable dt1 = new DataTable();
            dt.Columns.Add("Sign_On_Date1", typeof(string));
            dt.Columns.Add("Sign_Off_Date1", typeof(string));
            dt.Columns.Add("Due_Date1", typeof(string));
            dt.Columns.Add("Approved_Date1", typeof(string));

            foreach (DataRow dr in dt.Rows)
            {
                dr["Sign_On_Date1"]  = " " + (Convert.ToString(dr["Sign_On_Date"])) != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr["Sign_On_Date"])) : "";
                dr["Sign_Off_Date1"] = " " + (Convert.ToString(dr["Sign_Off_Date"])) != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr["Sign_Off_Date"])) : "";
                dr["Due_Date1"]      = " " + (Convert.ToString(dr["Due_Date"])) != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString((dr["Due_Date"]))) : "";
                dr["Approved_Date1"] = " " + (Convert.ToString(dr["Approved_Date"])) != "" ? UDFLib.ConvertUserDateFormat(Convert.ToString(dr["Approved_Date"])) : "";
            }


            GridViewExportUtil.ExportToExcel(dt, HeaderCaptions, DataColumnsName, "AgencyFee.xls", "Agency Fee Export");
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }