Exemplo n.º 1
0
    protected void ddlJoiningRank_SelectedIndexChanged(object sender, EventArgs e)
    {
        int RankID   = 0;
        int VesselId = int.Parse(ddlVessel.SelectedValue.ToString());

        if (ddlJoiningRank.SelectedValue != "0" && ddlJoiningRank.SelectedValue != "")
        {
            RankID = int.Parse(ddlJoiningRank.SelectedValue);
        }
        if (RankScaleConsidered == 1)
        {
            Load_RankScaleList(RankID);
        }
        // load rank based salary

        int CurrentVoyageID = UDFLib.ConvertToInteger(Request.QueryString["VoyID"]);
        int WageContractID = 0;
        int Contract_Type = 0, CountryId = 0, RankScaleId = 0;

        try
        {
            //Get Current voyage details
            DataTable dtVoy = objBLLCrew.Get_CrewVoyages(GetCrewID(), CurrentVoyageID);

            if (dtVoy.Rows.Count > 0)
            {
                Contract_Type = int.Parse(dtVoy.Rows[0]["Vessel_Flag"].ToString());
            }
            DataSet ds = new DataSet();
            if (RankScaleConsidered == 0)
            {
                ds = BLL_PortageBill.Get_Rank_WageContract(RankID, Contract_Type, 0, NationalityConsidered, CountryId, RankScaleId, VesselId);
                hdWageContractId.Value      = ds.Tables[1].Rows[0]["WageContractID"].ToString();
                GridViewaddwages.DataSource = ds.Tables[1];
                GridViewaddwages.DataBind();
            }
            else
            {
                GridViewaddwages.DataSource = null;
                GridViewaddwages.DataBind();
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
Exemplo n.º 2
0
    protected void ddlRankScale_SelectedIndexChanged(object sender, EventArgs e)
    {
        int       VoyID         = UDFLib.ConvertToInteger(Request.QueryString["VoyID"]);
        int       RankId        = int.Parse(ddlJoiningRank.SelectedValue.ToString());
        int       Contract_Type = 0;
        int       VesselId      = int.Parse(ddlVessel.SelectedValue.ToString());
        DataSet   ds            = BLL_PortageBill.Get_CrewWagesByVoyage(GetCrewID(), VoyID);
        DataTable dtVoy         = objBLLCrew.Get_CrewVoyages(GetCrewID(), VoyID);

        if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
        {
            Contract_Type = int.Parse(ds.Tables[0].Rows[0]["Contract_Type"].ToString());
        }
        if (dtVoy != null && dtVoy.Rows.Count > 0 && VesselId == 0)
        {
            VesselId = int.Parse(dtVoy.Rows[0]["Vessel_ID"].ToString());
        }
        DataTable dt          = objBLLCrew.Get_CrewPersonalDetailsByID(GetCrewID());
        int       RankScaleId = int.Parse(ddlRankScale.SelectedValue.ToString());
        int       CountryId   = int.Parse(dt.Rows[0]["Staff_Nationality"].ToString());

        Staff_Nationality = int.Parse(dt.Rows[0]["Staff_Nationality"].ToString());
        int     WageContractId = 0;
        DataSet ds1            = BLL_PortageBill.Get_Rank_WageContract(RankId, Contract_Type, WageContractId, NationalityConsidered, CountryId, RankScaleId, VesselId);

        if (ds1.Tables[0].Rows.Count > 0)
        {
            WageContractId              = int.Parse(ds1.Tables[0].Rows[0]["WageContractID"].ToString());
            hdWageContractId.Value      = ds1.Tables[0].Rows[0]["WageContractID"].ToString();
            GridViewaddwages.DataSource = ds1.Tables[1];
            GridViewaddwages.DataBind();
        }
        else
        {
            GridViewaddwages.DataSource = null;
            GridViewaddwages.DataBind();
        }
    }