Example #1
0
    protected void Assign()
    {
        if (txtEventDate.Text.ToString() != "")
        {
            int EventID = objCrew.CREATE_CrewChangeEvent(VesselId, UDFLib.ConvertToDefaultDt(txtEventDate.Text).ToString(), 0, GetSessionUserID(), 0);
            if (EventID > 0)
            {
                DataSet   ds          = BLL_Crew_CrewList.Get_VesselTypeForCrewMatrix(VesselId);
                DataTable dtEventDate = ds.Tables[1];
                ddlEvents.DataSource = dtEventDate;
                ddlEvents.DataBind();
                ddlEvents.Items.Insert(0, new ListItem("- SELECT -", "0"));
                ddlEvents.SelectedValue = EventID.ToString();

                txtEventDate.Text = "";

                AddCrewToEvent();
            }
            else if (EventID == -1)
            {
                string js = "alert('Event date is not inside the vessel arrival and departure dates!!');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alertUser", js, true);
            }
        }
        else
        {
            AddCrewToEvent();
        }
    }
Example #2
0
    protected void btnFilter_Click(object sender, EventArgs e)
    {
        DataSet   ds1      = new DataSet();
        DataTable dt       = new DataTable();
        DataTable ds       = new DataTable();
        int       VesselID = int.Parse(ddlVessel.SelectedValue);

        if (VesselID > 0)
        {
            int UserCompanyID = UDFLib.ConvertToInteger(getSessionString("USERCOMPANYID"));
            ds1 = BLL_Crew_CrewList.Get_VesselTypeForCrewMatrix(VesselID);
            dt  = ds1.Tables[0];
            hdnVesselID.Value   = Convert.ToString(VesselID);
            hdnVesselName.Value = ddlVessel.SelectedItem.Text;
            hdnVesselType.Value = Convert.ToString(dt.Rows[0]["Vessel_type"]);
            lblTankerType.Text  = Convert.ToString(dt.Rows[0]["VesselTypes"]) == "" ? "N/A" : Convert.ToString(dt.Rows[0]["VesselTypes"]);

            ds = BLL_Crew_CrewList.Get_CrewMatrix_Report(VesselID, UDFLib.ConvertIntegerToNull(hdnVesselType.Value), UserCompanyID);
            GridViewHelper helper = new GridViewHelper(this.GridView1);
            helper.RegisterGroup("Dept", true, true);
            helper.GroupHeader  += new GroupEvent(helper_GroupHeader);
            GridView1.DataSource = ds;
            GridView1.DataBind();
        }
        else
        {
            GridView1.DataSource = "";
            GridView1.DataBind();

            lblTankerType.Text = "";
        }
    }
Example #3
0
    protected void Search_SigningOff()
    {
        try
        {
            int iVesselID = 0;
            if (ddlVessel.Items.Count > 0)
            {
                iVesselID = int.Parse(ddlVessel.SelectedValue);
            }

            int PAGE_SIZE         = ucCustomPager_OffSigners.PageSize;
            int PAGE_INDEX        = ucCustomPager_OffSigners.CurrentPageIndex;
            int SelectRecordCount = ucCustomPager_OffSigners.isCountRecord;

            DataTable dt = BLL_Crew_CrewList.Get_DetailCrewAssignment_List(int.Parse(ddlFleet.SelectedValue), iVesselID, int.Parse(ddlRank.SelectedValue), int.Parse(ddlNationality_SOff.SelectedValue), UDFLib.ConvertToDefaultDt(txtFromDt.Text), UDFLib.ConvertToDefaultDt(txtToDt.Text), txtFreeText.Text, GetSessionUserID(), PAGE_SIZE, PAGE_INDEX, ref SelectRecordCount);

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

            gvSignOffCrew.DataSource = dt;
            gvSignOffCrew.DataBind();
        }
        catch { }
    }
Example #4
0
    protected void ImgExpExcel_Click(object sender, EventArgs e)
    {
        if (GridView1.Rows.Count > 0)
        {
            int VesselID      = int.Parse(hdnVesselID.Value);
            int UserCompanyID = UDFLib.ConvertToInteger(getSessionString("USERCOMPANYID"));

            DataTable dtexportdata = BLL_Crew_CrewList.Get_CrewMatrix_Report(VesselID, UDFLib.ConvertIntegerToNull(hdnVesselType.Value), UserCompanyID);
            if (dtexportdata.Rows.Count > 0)
            {
                string[] HeaderCaptions  = new string[] { "Department", "Rank", "Nationality", "Certificate Of Competency", " Issuing Country", "Adminstration Acceptance", "Tanker Certification", "STCW V Para For Current Cargo", "Radio Qualification", "Year With Operator", "Year in Rank", "Year in this type of Tanker", "Year on All types of Tanker", "Months on vessel this Tour of Duty", "English Proficiency" };
                string[] DataColumnsName = new string[] { "Dept", "Rank_Name", "Nationality", "Certificate_Of_Competency", "Country_Name", "Adminstration_Acceptance", "Tanker_Certification", "STCWVPara", "Radio_Qualification", "YearsOfOperator", "YearsOfRank", "YearsOfTanker", "YearsOfAllTanker", "Months", "English_Proficiency" };
                string   vesselType      = lblTankerType.Text == "N/A" ? "" : lblTankerType.Text + " - ";
                string   FileHeaderName  = "Crew Matrix: " + hdnVesselName.Value + " - " + vesselType + lblDate.Text;
                string   FileName        = "CrewMatrix-" + hdnVesselName.Value;
                GridViewExportUtil.ShowExcel(dtexportdata, HeaderCaptions, DataColumnsName, FileName, FileHeaderName);
            }
        }
        else
        {
            string CrewMatrix;
            if (ddlVessel.SelectedIndex == 0)
            {
                CrewMatrix = String.Format("alert('Select a vessel to export crew matrix.');");
            }
            else
            {
                CrewMatrix = String.Format("alert('No data found to export to excel.');");
            }
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "CrewMatrix", CrewMatrix, true);
        }
    }
Example #5
0
    protected void ImgExpExcel_Click(object sender, EventArgs e)
    {
        int rowcount = ucCustomPager.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 = BLL_Crew_CrewList.Get_HandOver_Search(UDFLib.ConvertIntegerToNull(ddlFleet.SelectedValue.ToString())
                                                             , UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue.ToString()), txtSearchText.Text, UDFLib.ConvertIntegerToNull(ddlRankFilter.SelectedValue), sortbycoloumn, sortdirection, null, null, ref rowcount);

        string[] HeaderCaptions  = { "Vessel Name", "Staff Code", "Staff Name", "Rank Name", "Hand Over Date", "Sign off Remark" };
        string[] DataColumnsName = { "Vessel_Name", "STAFF_CODE", "FULL_NAME", "Rank_Short_Name", "Handover_Date", "Sing_off_Remarks" };
        ChangeColumnDataType(dt, "Handover_Date", typeof(string));
        foreach (DataRow item in dt.Rows)
        {
            if (!string.IsNullOrEmpty(item["Handover_Date"].ToString()))
            {
                item["Handover_Date"] = UDFLib.ConvertUserDateFormat(Convert.ToString(item["Handover_Date"]), UDFLib.GetDateFormat());
            }
        }
        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "CrewHandOver.xls", "Crew Handover");
    }
Example #6
0
    public void BindMasterReview()
    {
        int PAGE_SIZE  = ucCustomPager.PageSize;
        int PAGE_INDEX = ucCustomPager.CurrentPageIndex;

        int SelectRecordCount = ucCustomPager.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 = BLL_Crew_CrewList.Get_HandOver_Search(UDFLib.ConvertIntegerToNull(ddlFleet.SelectedValue.ToString())
                                                             , UDFLib.ConvertIntegerToNull(ddlVessel.SelectedValue.ToString()), txtSearchText.Text, UDFLib.ConvertIntegerToNull(ddlRankFilter.SelectedValue.ToString()), sortbycoloumn, sortdirection, PAGE_SIZE, PAGE_INDEX, ref SelectRecordCount);


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

        gvMasterReview.DataSource = dt;
        gvMasterReview.DataBind();
    }
    protected void Search_UnAssigned()
    {
        lblStaffHistory.Text = "";

        int PAGE_SIZE         = ucCustomPager_OnSigners.PageSize;
        int PAGE_INDEX        = ucCustomPager_OnSigners.CurrentPageIndex;
        int SelectRecordCount = ucCustomPager_OnSigners.isCountRecord;

        DataTable dt = BLL_Crew_CrewList.Get_UnAssigned_CrewList(int.Parse(ddlManningOffice.SelectedValue), int.Parse(ddlNationality.SelectedValue), int.Parse(ddlRank_UA.SelectedValue), UDFLib.ConvertToDefaultDt(Convert.ToString(txtFromDt_UA.Text)), UDFLib.ConvertToDefaultDt(Convert.ToString(txtToDt_UA.Text)), txtFreeText_UA.Text, int.Parse(ddlVessel_UA.SelectedValue), int.Parse(UA_AvailableOptions.SelectedValue), GetSessionUserID(), PAGE_SIZE, PAGE_INDEX, ref SelectRecordCount);

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

        gvUnAssignedCrew.DataSource = dt;
        gvUnAssignedCrew.DataBind();

        if (Session["UTYPE"].ToString() == "ADMIN")
        {
            if (dt.Rows.Count == 0)
            {
                dt = BLL_Crew_CrewList.Get_UnAssigned_CrewList_History(txtFreeText_UA.Text, UDFLib.ConvertToInteger(Session["USERCOMPANYID"].ToString()));
                if (dt.Rows.Count > 0)
                {
                    lblStaffHistory.Text = "<br><br>Please find the below information which can help finding the staff.<br>";
                    foreach (DataRow dr in dt.Rows)
                    {
                        lblStaffHistory.Text += "<br>" + dr[0];
                    }
                }
            }
        }
    }
Example #8
0
    protected void ImgExportToExcel_Click(object sender, EventArgs e)
    {
        string Sign_On_From      = "";
        string Sign_On_To        = "";
        string SearchString      = txtSearch.Text;
        int    TotalDays         = 0;
        int    PAGE_SIZE         = -1;
        int    PAGE_INDEX        = -1;
        int    SelectRecordCount = 0;

        int FleetCode = UDFLib.ConvertToInteger(ddlFleet.SelectedValue);
        int VesselID  = UDFLib.ConvertToInteger(ddlVessel.SelectedValue);

        if (txtSignOnFrom.Text != "")
        {
            Sign_On_From = UDFLib.ConvertToDate(Convert.ToString(txtSignOnFrom.Text), UDFLib.GetDateFormat()).ToString();
        }

        if (txtSignOnTo.Text != "")
        {
            Sign_On_To = UDFLib.ConvertToDate(Convert.ToString(txtSignOnTo.Text), UDFLib.GetDateFormat()).ToString();
        }

        DataTable dt = BLL_Crew_CrewList.Get_Super_Att_Vessel_Report(FleetCode, VesselID, Sign_On_From, Sign_On_To, SearchString, GetSessionUserID(), PAGE_SIZE, PAGE_INDEX, ref SelectRecordCount, ref TotalDays);

        dt.Columns.Add("Joining_Date1");
        dt.Columns.Add("Sign_On_Date1");
        dt.Columns.Add("Sign_Off_Date1");

        foreach (DataRow dr in dt.Rows)
        {
            if (dr["Joining_Date"].ToString() != "" && dr["Joining_Date"] != null)
            {
                dr["Joining_Date1"] = "&nbsp;" + UDFLib.ConvertUserDateFormat(Convert.ToString(dr["Joining_Date"]), Convert.ToString(Session["User_DateFormat"]));
            }
            if (dr["Sign_On_Date"].ToString() != "" && dr["Sign_On_Date"] != null)
            {
                dr["Sign_On_Date1"] = "&nbsp;" + UDFLib.ConvertUserDateFormat(Convert.ToString(dr["Sign_On_Date"]));
            }

            if (dr["Sign_Off_Date"].ToString() != "" && dr["Sign_Off_Date"] != null)
            {
                dr["Sign_Off_Date1"] = "&nbsp;" + UDFLib.ConvertUserDateFormat(Convert.ToString(dr["Sign_Off_Date"]));
            }
        }
        dt.AcceptChanges();

        string[] HeaderCaptions  = { "Vessel", "S/Code", "Name", "Rank", "Contract Date", "S/On Date", "S/Off Date", "Days ONBD" };
        string[] DataColumnsName = { "Vessel_Short_Name", "Staff_Code", "Staff_Name", "Rank_Short_Name", "Joining_Date1", "Sign_On_Date1", "Sign_Off_Date1", "DaysOnBoard" };


        GridViewExportUtil.ExportToExcel(dt, HeaderCaptions, DataColumnsName, "Superintendents_attending_vessels.xls", "Superintendents attending vessels Report");
    }
Example #9
0
    public void Load_VesselList()
    {
        int UserCompanyID = UDFLib.ConvertToInteger(getSessionString("USERCOMPANYID"));

        ddlVessel.DataSource = BLL_Crew_CrewList.Get_VesselForCrewMatrix(UserCompanyID);

        ddlVessel.DataTextField  = "Vessel_Name";
        ddlVessel.DataValueField = "Vessel_ID";
        ddlVessel.DataBind();
        ddlVessel.Items.Insert(0, new ListItem("-SELECT-", "0"));
        ddlVessel.SelectedIndex = 0;
    }
Example #10
0
    protected void lnkExportToExcel_Click(object sender, EventArgs e)
    {
        string[] HeaderCaptions  = { };
        string[] DataColumnsName = { };

        DataTable dtFilters = GetSearchDataTable();

        DataTable dtExportColumns = new DataTable();

        dtExportColumns.Columns.Add("ParamName", typeof(String));
        dtExportColumns.Columns.Add("ParamValue", typeof(String));

        foreach (ListItem li in CheckBoxList1.Items)
        {
            if (li.Selected == true)
            {
                dtExportColumns.Rows.Add(li.Value.ToString(), "1");

                Array.Resize(ref HeaderCaptions, HeaderCaptions.Length + 1); HeaderCaptions[HeaderCaptions.Length - 1]     = li.Text.ToString();
                Array.Resize(ref DataColumnsName, DataColumnsName.Length + 1); DataColumnsName[DataColumnsName.Length - 1] = li.Value.ToString();
            }
        }
        if (dtExportColumns.Rows.Count == 0)
        {
            string js = "alert('Please Select at least one column!');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", js, true);
            return;
        }
        DataTable dt = BLL_Crew_CrewList.Get_Crewlist_Export(dtFilters, dtExportColumns, GetSessionUserID());

        ChangeColumnDataType(dt, "EOC", typeof(string));
        ChangeColumnDataType(dt, "Joining_date", typeof(string));
        ChangeColumnDataType(dt, "Staff_Birth_Date", typeof(string));

        foreach (DataRow item in dt.Rows)
        {
            if (!string.IsNullOrEmpty(item["EOC"].ToString()))
            {
                item["EOC"] = "&nbsp;" + UDFLib.ConvertUserDateFormat(Convert.ToString(item["EOC"]), UDFLib.GetDateFormat());
            }
            if (!string.IsNullOrEmpty(item["Joining_date"].ToString()))
            {
                item["Joining_date"] = "&nbsp;" + UDFLib.ConvertUserDateFormat(Convert.ToString(item["Joining_date"]), UDFLib.GetDateFormat());
            }
            if (!string.IsNullOrEmpty(item["Staff_Birth_Date"].ToString()))
            {
                item["Staff_Birth_Date"] = "&nbsp;" + UDFLib.ConvertUserDateFormat(Convert.ToString(item["Staff_Birth_Date"]), UDFLib.GetDateFormat());
            }
        }

        GridViewExportUtil.ExportToExcel(dt, HeaderCaptions, DataColumnsName, "CrewListExport.xls", "CrewList Export");
    }
Example #11
0
    public void FillGridViewAfterSearch(int VesselID)
    {
        DataTable dtFilters = new DataTable();

        dtFilters.Columns.Add("VesselManager", typeof(int));
        dtFilters.Columns.Add("Fleet", typeof(int));
        dtFilters.Columns.Add("Vessel", typeof(int));
        dtFilters.Columns.Add("RankID", typeof(int));
        dtFilters.Columns.Add("Nationality", typeof(int));
        dtFilters.Columns.Add("Status", typeof(int));
        dtFilters.Columns.Add("CalculatedStatus", typeof(int));
        dtFilters.Columns.Add("ManningOfficeID", typeof(int));
        dtFilters.Columns.Add("EOCDueIn", typeof(int));
        dtFilters.Columns.Add("JoiningDateFrom", typeof(String));
        dtFilters.Columns.Add("JoiningDateTo", typeof(String));
        dtFilters.Columns.Add("SearchText", typeof(String));

        DateTime dtFrom = DateTime.Parse(UDFLib.ConvertUserDateFormat(Convert.ToString("1900/01/01")));
        DateTime dtTo   = DateTime.Parse(UDFLib.ConvertUserDateFormat(Convert.ToString("2900/01/01")));

        int       MainStatusId = 0;
        DataTable dtMainStatus = objCrewAdmin.Get_CrewMainStatus();

        dtMainStatus.DefaultView.RowFilter = "Value='Onboard'";
        if (dtMainStatus.DefaultView.Count > 0)
        {
            MainStatusId = int.Parse(dtMainStatus.DefaultView[0]["Id"].ToString());
        }

        dtFilters.Rows.Add(0, 0, VesselID, 0, 0, MainStatusId, 0, 0, 0, dtFrom.ToString(UDFLib.ConvertUserDateFormat(Convert.ToString("yyyy/MM/dd"))), dtTo.ToString(UDFLib.ConvertUserDateFormat(Convert.ToString("yyyy/MM/dd"))), "");

        int PAGE_SIZE         = 100;
        int PAGE_INDEX        = 1;
        int SelectRecordCount = 0;

        DataTable dt = BLL_Crew_CrewList.Get_Crewlist_Index(dtFilters, GetSessionUserID(), PAGE_SIZE, PAGE_INDEX, ref SelectRecordCount);

        GridView1.DataSource = dt;
        GridView1.DataBind();

        ltCrewCount.Text = "Total number of crew on board : " + dt.Rows.Count.ToString();
        DataSet ds = BLL_Crew_CrewList.Get_Crewlist_IconView(VesselID, GetSessionUserID());

        ds.Relations.Add(new DataRelation("NestedCat", ds.Tables[0].Columns["rank_category"], ds.Tables[1].Columns["rank_category"]));
        ds.Tables[1].TableName = "Members";

        rpt1.DataSource = ds;
        rpt1.DataBind();
    }
    /// <summary>
    /// Fill the grid with Unassigned Crews according to filter
    /// </summary>
    protected void Search_UnAssigned()
    {
        try
        {
            int    PAGE_SIZE           = ucCustomPager_UnAssignedCrew.PageSize;
            int    PAGE_INDEX          = ucCustomPager_UnAssignedCrew.CurrentPageIndex;
            int    SelectRecordCount   = ucCustomPager_UnAssignedCrew.isCountRecord;
            int    VesselId_OffSignner = int.Parse(ddlVessel_UA.SelectedValue.ToString());
            string sortbycoloumn       = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
            int?   sortdirection       = null; if (ViewState["SORTDIRECTION"] != null)
            {
                sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
            }

            //selected Vessel Type
            int       i             = 1;
            DataTable dtVesselTypes = new DataTable();
            dtVesselTypes.Columns.Add("PID");
            dtVesselTypes.Columns.Add("VALUE");

            foreach (DataRow dr in ddlVesselType.SelectedValues.Rows)
            {
                DataRow dr1 = dtVesselTypes.NewRow();
                dr1["PID"]   = i;
                dr1["VALUE"] = dr[0];
                dtVesselTypes.Rows.Add(dr1);
                i++;
            }

            DataTable dt = BLL_Crew_CrewList.Get_UnAssigned_CrewList(int.Parse(ddlManningOffice.SelectedValue), int.Parse(ddlNationality.SelectedValue), int.Parse(ddlRank_UA.SelectedValue), txtFromDt_UA.Text.Trim() == "" ? "" : UDFLib.ConvertToDate(txtFromDt_UA.Text).ToShortDateString(), txtToDt_UA.Text.Trim() == "" ? "" : UDFLib.ConvertToDate(txtToDt_UA.Text).ToShortDateString(), txtFreeText_UA.Text, int.Parse(ddlVessel_UA.SelectedValue), VesselId_OffSignner, int.Parse(UA_AvailableOptions.SelectedValue), GetSessionUserID(), PAGE_SIZE, PAGE_INDEX, ref SelectRecordCount, sortbycoloumn, sortdirection, int.Parse(ddlMinYearOperator.SelectedValue), int.Parse(ddlMinYearsRank.SelectedValue), int.Parse(ddlMinYearsAllTankers.SelectedValue), dtVesselTypes);

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

            gvUnAssignedCrew.DataSource = dt;
            gvUnAssignedCrew.DataBind();
            ScriptManager.RegisterStartupScript(this, this.GetType(), "SaveAddError", "BindHeight();", true);
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
Example #13
0
    public void FillGridViewAfterSearch()
    {
        DataTable dtFilters = GetSearchDataTable();

        int PAGE_SIZE  = ucCustomPager_CrewList.PageSize;
        int PAGE_INDEX = ucCustomPager_CrewList.CurrentPageIndex;

        int SelectRecordCount = ucCustomPager_CrewList.isCountRecord;

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

        //Passing selected Vessel type for filter
        int       i             = 1;
        DataTable dtVesselTypes = new DataTable();

        dtVesselTypes.Columns.Add("PID");
        dtVesselTypes.Columns.Add("VALUE");

        foreach (DataRow dr in ddlVesselType.SelectedValues.Rows)
        {
            DataRow dr1 = dtVesselTypes.NewRow();
            dr1["PID"]   = i;
            dr1["VALUE"] = dr[0];
            dtVesselTypes.Rows.Add(dr1);
            i++;
        }

        DataTable dt = BLL_Crew_CrewList.Get_Crewlist_Index(dtFilters, dtVesselTypes, GetSessionUserID(), PAGE_SIZE, PAGE_INDEX, ref SelectRecordCount, sortbycoloumn, sortdirection);


        GridView1.DataSource = dt;
        GridView1.DataBind();

        if (ucCustomPager_CrewList.isCountRecord == 1)
        {
            ucCustomPager_CrewList.CountTotalRec = SelectRecordCount.ToString();
            ucCustomPager_CrewList.BuildPager();
        }
        string js = "Timer();";

        ScriptManager.RegisterStartupScript(this, this.GetType(), "Timer", js, true);
    }
Example #14
0
    protected void Load_CrewList()
    {
        //DataTable dtFilters = new DataTable();
        //dtFilters.Columns.Add("VesselManager", typeof(int));
        //dtFilters.Columns.Add("Fleet", typeof(int));
        //dtFilters.Columns.Add("Vessel", typeof(int));
        //dtFilters.Columns.Add("RankID", typeof(int));
        //dtFilters.Columns.Add("Nationality", typeof(int));
        //dtFilters.Columns.Add("Status", typeof(String));
        //dtFilters.Columns.Add("ManningOfficeID", typeof(int));
        //dtFilters.Columns.Add("EOCDueIn", typeof(int));
        //dtFilters.Columns.Add("JoiningDateFrom", typeof(String));
        //dtFilters.Columns.Add("JoiningDateTo", typeof(String));
        //dtFilters.Columns.Add("SearchText", typeof(String));

        //DateTime dtFrom = DateTime.Parse("1900/01/01");
        //DateTime dtTo = DateTime.Parse("2900/01/01");

        //dtFilters.Rows.Add(
        //    1,
        //    0,
        //    0,
        //    0,
        //    0,
        //    "",
        //    0,
        //    0,
        //    dtFrom.ToString("yyyy/MM/dd"),
        //    dtTo.ToString("yyyy/MM/dd"),
        //    txtSearchText.Text);

        //int PAGE_SIZE = 100;
        //int PAGE_INDEX = 1;

        int SelectRecordCount = 1;

        //DataTable dt = BLL_Crew_CrewList.Get_Crewlist_Index(dtFilters, GetSessionUserID(), PAGE_SIZE, PAGE_INDEX, ref SelectRecordCount);

        string PBillDate = "01/" + ddlMonth.SelectedValue + "/" + ddlYear.SelectedValue;

        DataTable dt = BLL_Crew_CrewList.Get_CrewList_Allotment(0, txtSearchText.Text, PBillDate, GetSessionUserID(), 100, 1, ref SelectRecordCount);

        gvSelectedCrew.DataSource = dt;
        gvSelectedCrew.DataBind();
    }
    public void BindHandOver()
    {
        int PAGE_SIZE  = ucCustomPager.PageSize;
        int PAGE_INDEX = ucCustomPager.CurrentPageIndex;

        int SelectRecordCount = ucCustomPager.isCountRecord;

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

        DataSet ds = BLL_Crew_CrewList.Get_HandOverDetail_Search(int.Parse(Request.QueryString["ID"].ToString()), int.Parse(Request.QueryString["VESSELID"].ToString()), txtSearchText.Text, sortbycoloumn, sortdirection, PAGE_SIZE, PAGE_INDEX, ref SelectRecordCount);

        if (ds.Tables[0].Rows.Count > 0)
        {
            DataRow dr = ds.Tables[0].Rows[0];
            txtVesselName.Text            = dr["Vessel_Name"].ToString();
            txtStaffCode.Text             = dr["STAFF_CODE"].ToString();
            txtStaffName.Text             = dr["FULL_NAME"].ToString();
            txtStaffRank.Text             = dr["Rank_Name"].ToString();
            txtRelievingMasterRemark.Text = dr["Sing_off_Remarks"].ToString();
            txtRelievedMasterRemark.Text  = dr["Relieved_Master_Remark"].ToString();
            if (dr["Joining_Rank"].ToString() != "1")
            {
                CheckList.Visible = false;
            }
            if (dr["HANDOVER_DATE"] != null)
            {
                txtHandOverDate.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(dr["HANDOVER_DATE"]));
            }
            lbltxtRelievingMasterRemark.Text = "Relieving " + txtStaffRank.Text + "'s Remarks :";
            lbltxtRelievedMasterRemark.Text  = "Relieved " + txtStaffRank.Text + "'s Remarks :";
        }
        gvHandOver.DataSource = ds.Tables[1];
        gvHandOver.DataBind();

        if (ucCustomPager.isCountRecord == 1)
        {
            ucCustomPager.CountTotalRec = SelectRecordCount.ToString();
            ucCustomPager.BuildPager();
        }
    }
Example #16
0
    public void FillGridView()
    {
        string strFreeTextSearch = txtFreeTextSearch.Text;
        int    manningOfficeId   = int.Parse(ddlManningOfficeList.SelectedValue.ToString());
        int    PAGE_SIZE         = ucCustomPager_CrewList.PageSize;
        int    PAGE_INDEX        = ucCustomPager_CrewList.CurrentPageIndex;

        int       SelectRecordCount = ucCustomPager_CrewList.isCountRecord;
        DataTable dt = BLL_Crew_CrewList.Get_AdminCrewlist(strFreeTextSearch, manningOfficeId, GetSessionUserID(), PAGE_SIZE, PAGE_INDEX, ref SelectRecordCount);


        GridView1.DataSource = dt;
        GridView1.DataBind();

        if (ucCustomPager_CrewList.isCountRecord == 1)
        {
            ucCustomPager_CrewList.CountTotalRec = SelectRecordCount.ToString();
            ucCustomPager_CrewList.BuildPager();
        }
    }
Example #17
0
    public void FillGridViewAfterSearch(int VesselID)
    {
        DataTable dtFilters = new DataTable();

        dtFilters.Columns.Add("VesselManager", typeof(int));
        dtFilters.Columns.Add("Fleet", typeof(int));
        dtFilters.Columns.Add("Vessel", typeof(int));
        dtFilters.Columns.Add("RankID", typeof(int));
        dtFilters.Columns.Add("Nationality", typeof(int));
        dtFilters.Columns.Add("Status", typeof(int));
        dtFilters.Columns.Add("CalculatedStatus", typeof(int));
        dtFilters.Columns.Add("ManningOfficeID", typeof(int));
        dtFilters.Columns.Add("EOCDueIn", typeof(int));
        dtFilters.Columns.Add("JoiningDateFrom", typeof(String));
        dtFilters.Columns.Add("JoiningDateTo", typeof(String));
        dtFilters.Columns.Add("SearchText", typeof(String));

        DateTime dtFrom = DateTime.Parse("1900/01/01");
        DateTime dtTo   = DateTime.Parse("2900/01/01");

        int       MainStatusId = 0;
        DataTable dtMainStatus = objCrewAdmin.Get_CrewMainStatus();

        dtMainStatus.DefaultView.RowFilter = "Value='Onboard'";
        if (dtMainStatus.DefaultView.Count > 0)
        {
            MainStatusId = int.Parse(dtMainStatus.DefaultView[0]["Id"].ToString());
        }

        dtFilters.Rows.Add(0, 0, VesselID, 0, 0, MainStatusId, 0, 0, 0, UDFLib.ConvertUserDateFormat(Convert.ToString(dtFrom.ToString())), UDFLib.ConvertUserDateFormat(Convert.ToString(dtTo.ToString())), "");

        int PAGE_SIZE         = 100;
        int PAGE_INDEX        = 1;
        int SelectRecordCount = 0;

        DataTable dt = BLL_Crew_CrewList.Get_Crewlist_Index(dtFilters, GetSessionUserID(), PAGE_SIZE, PAGE_INDEX, ref SelectRecordCount);

        GridView1.DataSource = dt;
        GridView1.DataBind();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        BLL_Crew_CrewDetails objCrew = new BLL_Crew_CrewDetails();

        int Vessel_ID = 1;

        if (Request.QueryString["vid"] != null)
        {
            Vessel_ID = UDFLib.ConvertToInteger(Request.QueryString["vid"].ToString());
        }


        int       SelectRecordCount = 1;
        DataTable dtFilters         = new DataTable();

        dtFilters.Columns.Add("VesselManager", typeof(int));
        dtFilters.Columns.Add("Fleet", typeof(int));
        dtFilters.Columns.Add("Vessel", typeof(int));
        dtFilters.Columns.Add("RankID", typeof(int));
        dtFilters.Columns.Add("Nationality", typeof(int));
        dtFilters.Columns.Add("Status", typeof(String));
        dtFilters.Columns.Add("ManningOfficeID", typeof(int));
        dtFilters.Columns.Add("EOCDueIn", typeof(int));
        dtFilters.Columns.Add("JoiningDateFrom", typeof(String));
        dtFilters.Columns.Add("JoiningDateTo", typeof(String));
        dtFilters.Columns.Add("SearchText", typeof(String));

        DateTime dtFrom = DateTime.Parse("1900/01/01");
        DateTime dtTo   = DateTime.Parse("2900/01/01");

        dtFilters.Rows.Add(1, 0, Vessel_ID, 0, 0, "CURRENT", 0, 0, dtFrom.ToString("yyyy/MM/dd"), dtTo.ToString("yyyy/MM/dd"), "");

        DataTable dt = BLL_Crew_CrewList.Get_Crewlist_Index(dtFilters, GetSessionUserID(), 2000, 1, ref SelectRecordCount);

        //RepeaterRSS.DataSource = dt;
        //RepeaterRSS.DataBind();

        GenerateRSS(dt);
    }
Example #19
0
    protected void Load_Report()
    {
        int FleetCode = UDFLib.ConvertToInteger(ddlFleet.SelectedValue);
        int VesselID  = UDFLib.ConvertToInteger(ddlVessel.SelectedValue);

        string Sign_On_From = "";
        string Sign_On_To   = "";

        if (txtSignOnFrom.Text != "")
        {
            Sign_On_From = UDFLib.ConvertToDate(Convert.ToString(txtSignOnFrom.Text), UDFLib.GetDateFormat()).ToString();
        }

        if (txtSignOnTo.Text != "")
        {
            Sign_On_To = UDFLib.ConvertToDate(Convert.ToString(txtSignOnTo.Text), UDFLib.GetDateFormat()).ToString();
        }

        string SearchString = txtSearch.Text;

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

        DataTable dt = BLL_Crew_CrewList.Get_Super_Att_Vessel_Report(FleetCode, VesselID, Sign_On_From, Sign_On_To, SearchString, GetSessionUserID(), PAGE_SIZE, PAGE_INDEX, ref SelectRecordCount, ref TotalDays);

        if (ucCustomPager_CrewList.isCountRecord == 1)
        {
            ucCustomPager_CrewList.CountTotalRec = SelectRecordCount.ToString();
            ucCustomPager_CrewList.BuildPager();
        }
        GridView_Crew.DataSource = dt;
        GridView_Crew.DataBind();
        lblGrandTotal.Text = TotalDays.ToString();
    }
    public void BindCheckList()
    {
        int PAGE_SIZE  = ucCustomPager1.PageSize;
        int PAGE_INDEX = ucCustomPager1.CurrentPageIndex;

        int SelectRecordCount = ucCustomPager.isCountRecord;

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

        DataSet ds = BLL_Crew_CrewList.Get_ChechList_Search(int.Parse(Request.QueryString["ID"].ToString()), int.Parse(Request.QueryString["VESSELID"].ToString()), txtSearchText.Text, sortbycoloumn, sortdirection, PAGE_SIZE, PAGE_INDEX, ref SelectRecordCount);

        gvCheckList.DataSource = ds.Tables[0];
        gvCheckList.DataBind();

        if (ucCustomPager1.isCountRecord == 1)
        {
            ucCustomPager1.CountTotalRec = SelectRecordCount.ToString();
            ucCustomPager1.BuildPager();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            DateFormat = UDFLib.GetDateFormat();
            CalendarExtender6.Format = CalendarExtender5.Format = UDFLib.GetDateFormat();

            if (GetSessionUserID() == 0)
            {
                string Host = Request.Url.AbsoluteUri.ToString().Substring(0, Request.Url.AbsoluteUri.ToString().ToLower().IndexOf("/crew/")) + "/";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "redirecttologin", "window.parent.location = '" + Host + "Account/Login.aspx';", true);
                return;
            }
            else
            {
                UserAccessValidation();
            }

            if (!IsPostBack)
            {
                ViewState["SORTDIRECTION"] = null;
                ViewState["SORTBYCOLOUMN"] = null;

                Load_VesselList();
                Load_ManningAgentList();
                Load_RankList(ddlRank_UA);
                Load_Nationality(ddlNationality);
                Load_VesselTypes();
                int     RankID       = UDFLib.ConvertToInteger(Request.QueryString["RankID"]);
                int     CrewId       = UDFLib.ConvertToInteger(Request.QueryString["CrewId"]);
                int     VesselId     = UDFLib.ConvertToInteger(Request.QueryString["VesselId"]);
                string  VesselTypeId = "0";
                DataSet ds           = new DataSet();
                ds = BLL_Crew_CrewList.Get_VesselTypeForCrewMatrix(VesselId);
                if (ds != null)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        VesselTypeId = Convert.ToString(ds.Tables[0].Rows[0]["Vessel_Type"]) == "" ? "N/A" : Convert.ToString(ds.Tables[0].Rows[0]["Vessel_Type"]);
                    }
                }


                //To select the default Vessel type
                CheckBoxList chk = ddlVesselType.FindControl("CheckBoxListItems") as CheckBoxList;
                foreach (ListItem chkitem in chk.Items)
                {
                    if (chkitem.Value == VesselTypeId)
                    {
                        chkitem.Selected = true;
                    }
                }

                ViewState["RankId"] = RankID;

                ViewState["OffSignerCrewId"] = CrewId;
                ddlRank_UA.SelectedValue     = RankID.ToString();
            }
            hdnDefaultRankId.Value = ViewState["RankId"].ToString();
            string js = "$('.vesselinfo').InfoBox();";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "initscript", js, true);
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
Example #22
0
    protected void Search_UnAssigned()
    {
        try
        {
            lblStaffHistory.Text = "";

            int    PAGE_SIZE           = ucCustomPager_OnSigners.PageSize;
            int    PAGE_INDEX          = ucCustomPager_OnSigners.CurrentPageIndex;
            int    SelectRecordCount   = ucCustomPager_OnSigners.isCountRecord;
            int    VesselId_OffSignner = int.Parse(lblVesselIdOffsigner.Text);
            string sortbycoloumn       = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
            int?   sortdirection       = null; if (ViewState["SORTDIRECTION"] != null)
            {
                sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
            }

            //selected Vessel Type
            int       i             = 1;
            DataTable dtVesselTypes = new DataTable();
            dtVesselTypes.Columns.Add("PID");
            dtVesselTypes.Columns.Add("VALUE");

            foreach (DataRow dr in ddlVesselType.SelectedValues.Rows)
            {
                DataRow dr1 = dtVesselTypes.NewRow();
                dr1["PID"]   = i;
                dr1["VALUE"] = dr[0];
                dtVesselTypes.Rows.Add(dr1);
                i++;
            }

            DataTable dt = BLL_Crew_CrewList.Get_UnAssigned_CrewList(int.Parse(ddlManningOffice.SelectedValue), int.Parse(ddlNationality.SelectedValue), int.Parse(ddlRank_UA.SelectedValue), UDFLib.ConvertToDefaultDt(txtFromDt_UA.Text), UDFLib.ConvertToDefaultDt(txtToDt_UA.Text), txtFreeText_UA.Text, int.Parse(ddlVessel_UA.SelectedValue), VesselId_OffSignner, int.Parse(UA_AvailableOptions.SelectedValue), GetSessionUserID(), dtVesselTypes, PAGE_SIZE, PAGE_INDEX, ref SelectRecordCount, sortbycoloumn, sortdirection);

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


            gvUnAssignedCrew.DataSource = dt;
            gvUnAssignedCrew.DataBind();

            if (Session["UTYPE"].ToString() == "ADMIN")
            {
                if (dt.Rows.Count == 0)
                {
                    dt = BLL_Crew_CrewList.Get_UnAssigned_CrewList_History(txtFreeText_UA.Text, UDFLib.ConvertToInteger(Session["USERCOMPANYID"].ToString()));
                    if (dt.Rows.Count > 0)
                    {
                        lblStaffHistory.Text = "<br><br>Please find the below information which can help finding the staff.<br>";
                        foreach (DataRow dr in dt.Rows)
                        {
                            lblStaffHistory.Text += "<br>" + dr[0];
                        }
                    }
                }
            }
        }
        catch (Exception ex)
        {
            string js3 = "alert('" + ex.Message.Replace("'", "") + "');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "SaveAddError", js3, true);
        }
    }
Example #23
0
    protected void lnkExportToText_Click(object sender, EventArgs e)
    {
        string[]  HeaderCaptions  = { };
        string[]  DataColumnsName = { };
        DataTable dtFilters       = GetSearchDataTable();

        DataTable dtExportColumns = new DataTable();

        dtExportColumns.Columns.Add("ParamName", typeof(String));
        dtExportColumns.Columns.Add("ParamValue", typeof(String));

        foreach (ListItem li in CheckBoxList1.Items)
        {
            if (li.Selected == true)
            {
                dtExportColumns.Rows.Add(li.Value.ToString(), "1");

                Array.Resize(ref HeaderCaptions, HeaderCaptions.Length + 1); HeaderCaptions[HeaderCaptions.Length - 1]     = li.Text.ToString();
                Array.Resize(ref DataColumnsName, DataColumnsName.Length + 1); DataColumnsName[DataColumnsName.Length - 1] = li.Value.ToString();
            }
        }
        if (dtExportColumns.Rows.Count == 0)
        {
            string js = "alert('Please select at least one column in Export Options!');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "least", js, true);
            return;
        }
        DataTable dt = BLL_Crew_CrewList.Get_Crewlist_Export(dtFilters, dtExportColumns, GetSessionUserID());

        ChangeColumnDataType(dt, "EOC", typeof(string));
        ChangeColumnDataType(dt, "Joining_date", typeof(string));
        ChangeColumnDataType(dt, "Staff_Birth_Date", typeof(string));

        foreach (DataRow item in dt.Rows)
        {
            if (!string.IsNullOrEmpty(item["EOC"].ToString()))
            {
                item["EOC"] = UDFLib.ConvertUserDateFormat(Convert.ToString(item["EOC"]), UDFLib.GetDateFormat());
            }
            if (!string.IsNullOrEmpty(item["Joining_date"].ToString()))
            {
                item["Joining_date"] = UDFLib.ConvertUserDateFormat(Convert.ToString(item["Joining_date"]), UDFLib.GetDateFormat());
            }
            if (!string.IsNullOrEmpty(item["Staff_Birth_Date"].ToString()))
            {
                item["Staff_Birth_Date"] = UDFLib.ConvertUserDateFormat(Convert.ToString(item["Staff_Birth_Date"]), UDFLib.GetDateFormat());
            }
        }
        using (StringWriter sw = new StringWriter())
        {
            for (int i = 0; i <= dt.Rows.Count - 1; i++)
            {
                sw.WriteLine((i + 1).ToString());
                sw.WriteLine("------------------------------");
                foreach (ListItem li in CheckBoxList1.Items)
                {
                    if (li.Selected == true)
                    {
                        sw.WriteLine(li.Text + ": " + dt.Rows[i][li.Value.ToString()].ToString());
                    }
                }
                sw.WriteLine("        ");
            }
            string fileName = "CrewList.txt";
            HttpContext.Current.Response.Clear();
            HttpContext.Current.Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", fileName));
            HttpContext.Current.Response.ContentType = "text/plain";
            HttpContext.Current.Response.Write(sw.ToString());
            HttpContext.Current.Response.End();
        }
    }
Example #24
0
    public void BindCrewHistoryGrid()
    {
        DateTime dtFrom = DateTime.Parse("1900/01/01");
        DateTime dtTo   = DateTime.Parse("2900/01/01");


        if (txtSearchJoinFromDate.Text != "")
        {
            dtFrom = UDFLib.ConvertToDate(Convert.ToString(txtSearchJoinFromDate.Text), UDFLib.GetDateFormat());
        }

        if (txtSearchJoinToDate.Text != "")
        {
            dtTo = UDFLib.ConvertToDate(Convert.ToString(txtSearchJoinToDate.Text), UDFLib.GetDateFormat());
        }

        int PAGE_SIZE  = ucCustomPager_CrewList.PageSize;
        int PAGE_INDEX = ucCustomPager_CrewList.CurrentPageIndex;

        int PAGE_SIZE1  = ucCustomPager1.PageSize;
        int PAGE_INDEX1 = ucCustomPager1.CurrentPageIndex;

        int SelectRecordCount  = ucCustomPager_CrewList.isCountRecord;
        int SelectRecordCount1 = ucCustomPager1.isCountRecord;

        DataSet ds = BLL_Crew_CrewList.Get_Crewlist_History(Convert.ToInt32(DDLVessel.SelectedValue), UDFLib.ConvertToInteger(ddlCountry.SelectedValue.ToString()), UDFLib.ConvertToInteger(ddlRank.SelectedValue.ToString()),
                                                            dtFrom, dtTo, PAGE_SIZE, PAGE_INDEX, PAGE_SIZE1, PAGE_INDEX1, ref SelectRecordCount, ref SelectRecordCount1);

        gvCrwHistroy.DataSource = ds.Tables[0];
        gvCrwHistroy.DataBind();

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


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

        ds.Relations.Add(new DataRelation("NestedCat", ds.Tables[1].Columns["rank_category"], ds.Tables[2].Columns["rank_category"]));
        ds.Tables[2].TableName = "Members";

        rpt1.DataSource = ds.Tables[1];
        rpt1.DataBind();

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

        if (ucCustomPager1.isCountRecord == 1)
        {
            ucCustomPager1.CountTotalRec = SelectRecordCount1.ToString();
            ucCustomPager1.BuildPager();
        }
    }
Example #25
0
    public void FillGridViewAfterSearch()
    {
        int    FleetID          = 0;
        int    VesselID         = 0;
        int    Nationality      = 0;
        int    RankID           = 0;
        string SearchText       = "";
        int    Status           = 0;
        int    CalculatedStatus = 0;

        int    ManningOfficeID = 0;
        int    COCDueIn        = 0;
        string JoiningFrom     = "";
        string JoiningTo       = "";

        VesselID         = UDFLib.ConvertToInteger(Request.QueryString["vid"]);
        FleetID          = UDFLib.ConvertToInteger(Request.QueryString["flt"]);
        Nationality      = UDFLib.ConvertToInteger(Request.QueryString["nat"]);
        RankID           = UDFLib.ConvertToInteger(Request.QueryString["rank"]);
        SearchText       = Request.QueryString["search"];
        Status           = UDFLib.ConvertToInteger(Request.QueryString["st"]);
        CalculatedStatus = UDFLib.ConvertToInteger(Request.QueryString["cst"]);

        ManningOfficeID = UDFLib.ConvertToInteger(Request.QueryString["mo"]);
        COCDueIn        = UDFLib.ConvertToInteger(Request.QueryString["coc"]);
        JoiningFrom     = Request.QueryString["jFrom"];
        JoiningTo       = Request.QueryString["jTo"];
        int VesselOwnerID = 0;


        DataTable dtFilters = new DataTable();

        dtFilters.Columns.Add("VesselManager", typeof(int));
        dtFilters.Columns.Add("Fleet", typeof(int));
        dtFilters.Columns.Add("Vessel", typeof(int));
        dtFilters.Columns.Add("RankID", typeof(int));
        dtFilters.Columns.Add("Nationality", typeof(int));
        dtFilters.Columns.Add("Status", typeof(int));
        dtFilters.Columns.Add("CalculatedStatus", typeof(int));

        dtFilters.Columns.Add("ManningOfficeID", typeof(int));
        dtFilters.Columns.Add("EOCDueIn", typeof(int));
        dtFilters.Columns.Add("JoiningDateFrom", typeof(String));
        dtFilters.Columns.Add("JoiningDateTo", typeof(String));
        dtFilters.Columns.Add("SearchText", typeof(String));

        DateTime dtFrom = DateTime.Parse("1900/01/01");
        DateTime dtTo   = DateTime.Parse("2900/01/01");

        dtFilters.Rows.Add(VesselOwnerID, FleetID, VesselID, RankID, Nationality, Status, CalculatedStatus, ManningOfficeID, COCDueIn, dtFrom.ToString("yyyy/MM/dd"), dtTo.ToString("yyyy/MM/dd"), SearchText);

        int PAGE_SIZE  = ucCustomPager_CrewList.PageSize;
        int PAGE_INDEX = ucCustomPager_CrewList.CurrentPageIndex;

        int SelectRecordCount = ucCustomPager_CrewList.isCountRecord;

        DataTable dt = BLL_Crew_CrewList.Get_Crewlist_Index(dtFilters, GetSessionUserID(), PAGE_SIZE, PAGE_INDEX, ref SelectRecordCount);

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

        GridView_CrewList.DataSource = dt;
        GridView_CrewList.DataBind();
    }
Example #26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DateFormat = UDFLib.GetDateFormat();//Get User date format
        CalendarExtender5.Format = DateFormat;
        if (GetSessionUserID() == 0)
        {
            string Host = Request.Url.AbsoluteUri.ToString().Substring(0, Request.Url.AbsoluteUri.ToString().ToLower().IndexOf("/crew/")) + "/";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "redirecttologin", "window.parent.location = '" + Host + "Account/Login.aspx';", true);
            return;
        }
        else
        {
            UserAccessValidation();
        }

        if (Request.QueryString.Count != 0)
        {
            if (Request.QueryString["OnSignnerCrewId"] != null)
            {
                OnSignnerCrewId = UDFLib.ConvertToInteger(Request.QueryString["OnSignnerCrewId"].ToString());
            }
            if (Request.QueryString["OffSignnerCrewId"] != null)
            {
                OffSignerCrewId = UDFLib.ConvertToInteger(Request.QueryString["OffSignnerCrewId"].ToString());
            }
            if (Request.QueryString["VesselId"] != null)
            {
                VesselId = UDFLib.ConvertToInteger(Request.QueryString["VesselId"].ToString());
            }
            if (Request.QueryString["RankId"] != null)
            {
                RankId = UDFLib.ConvertToInteger(Request.QueryString["RankId"].ToString());
            }
            ViewState["RankId"] = RankId;

            //Depending upon client configuration whether to consider Rank Scale or not.Depending upon Vessel flag, Rank Scale & Nationality wages are defined
            DataTable dtWages = objCrewAdmin.GetWagesSettings();
            if (dtWages != null && dtWages.Rows.Count > 0)
            {
                if (Convert.ToBoolean(dtWages.Rows[0]["RankScaleConsidered"]) == true)
                {
                    ViewState["RankScaleConsidered"] = 1;
                    gvSignOnCrew.Columns[gvSignOnCrew.Columns.Count - 4].Visible = true;
                }
                else
                {
                    ViewState["RankScaleConsidered"] = 0;
                    gvSignOnCrew.Columns[gvSignOnCrew.Columns.Count - 4].Visible = false;
                }
                if (Convert.ToBoolean(dtWages.Rows[0]["NationalityConsidered"]) == true)
                {
                    ViewState["NationalityConsidered"] = 1;
                }
                else
                {
                    ViewState["NationalityConsidered"] = 0;
                }
            }

            if (Request.QueryString["Method"] == "CheckAssign")
            {
                string    VesselName = "";
                DataTable dtCrewId   = new DataTable();
                dtCrewId.Columns.Add("CrewId");

                DataRow dr1 = dtCrewId.NewRow();
                dr1["CrewId"] = OnSignnerCrewId;
                dtCrewId.Rows.Add(dr1);

                CheckAssignment(OffSignerCrewId, OnSignnerCrewId, ref VesselName);
                return;
            }
            if (Request.QueryString["Method"] == "DeleteAssign")
            {
                DeleteAssignment(OnSignnerCrewId);
                return;
            }
        }
        if (!IsPostBack)
        {
            DataTable dtPersonalDetails = objCrew.Get_CrewPersonalDetailsByID(OnSignnerCrewId);
            gvSignOnCrew.DataSource = dtPersonalDetails;
            gvSignOnCrew.DataBind();
            ViewState["Staff_Nationality"] = int.Parse(dtPersonalDetails.Rows[0]["Staff_Nationality"].ToString());
            DataSet   ds          = BLL_Crew_CrewList.Get_VesselTypeForCrewMatrix(VesselId);
            DataTable dtEventDate = ds.Tables[1];
            string    PortName    = "";
            foreach (DataRow item in dtEventDate.Rows)
            {
                PortName = Convert.ToString(item["PORT_NAME"]);
                if (PortName != "")
                {
                    if (PortName.Split('-').Length == 2)
                    {
                        item["PORT_NAME"] = UDFLib.ConvertUserDateFormat(PortName.Split('-')[0]) + "  " + PortName.Split('-')[1];
                    }
                    else
                    {
                        item["PORT_NAME"] = UDFLib.ConvertUserDateFormat(Convert.ToString(item["PORT_NAME"]));
                    }
                }
            }

            ddlEvents.DataSource = dtEventDate;
            ddlEvents.DataBind();
            ddlEvents.Items.Insert(0, new ListItem("- SELECT -", "0"));
            ddlEvents.SelectedIndex = 0;
        }

        //disable history date
        CalendarExtender5.StartDate = DateTime.Now;
    }