protected void Load_Next_Of_Kin(int CrewID)
    {
        DataTable dtNOK = objBLLCrew.Get_Crew_DependentsByCrewID(CrewID, 1);

        GridView_Dependents.DataBind();
        if (dtNOK.Rows.Count > 0)
        {
            lblNOKName.Text         = dtNOK.Rows[0]["FirstName"].ToString().ToUpper();
            lblNOKSurname.Text      = dtNOK.Rows[0]["Surname"].ToString().ToUpper();
            lblNOKDOB.Text          = UDFLib.ConvertUserDateFormat(Convert.ToString(dtNOK.Rows[0]["DOB"]));
            lblNOKrelationship.Text = dtNOK.Rows[0]["Relationship"].ToString();
            lblNOKAddress.Text      = dtNOK.Rows[0]["Address"].ToString();
            lblNOKCountry.Text      = dtNOK.Rows[0]["Country"].ToString().ToUpper();
            lblNOKPhone.Text        = dtNOK.Rows[0]["Phone"].ToString();
            lblA1.Text     = dtNOK.Rows[0]["Address1"].ToString();
            lblA2.Text     = dtNOK.Rows[0]["Address2"].ToString();
            lblNOKSSN.Text = dtNOK.Rows[0]["SSN"].ToString();
        }

        DataTable dtAddress = null;

        if (objAdmin.CRW_GetCDConfiguration("Addressformat").Tables.Count > 0)
        {
            dtAddress = objAdmin.CRW_GetCDConfiguration("Addressformat").Tables[0];
        }
        if (dtAddress.Rows.Count > 0)
        {
            if (dtAddress.Rows[0]["Value"].ToString() == "True")
            {
                tdA1.Visible        = false;
                tdA2.Visible        = false;
                tdA3.Visible        = false;
                tdA4.Visible        = false;
                tdIA1.Visible       = true;
                tdIA2.Visible       = true;
                trUSADDRESS.Visible = false;
                tdIPA1.Visible      = true;
                tdIPA2.Visible      = true;
                trCountry.Visible   = false;
                tdCountry1.Visible  = false;
                tdCountry2.Visible  = false;
            }
            else
            {
                tdA1.Visible        = true;
                tdA2.Visible        = true;
                tdA3.Visible        = true;
                tdA4.Visible        = true;
                tdIA1.Visible       = false;
                tdIA2.Visible       = false;
                trUSADDRESS.Visible = true;
                tdIPA1.Visible      = false;
                tdIPA2.Visible      = false;
                trCountry.Visible   = true;
                tdCountry1.Visible  = true;
                tdCountry2.Visible  = true;
            }
        }
    }
    private void bindGridView()
    {
        DataSet ds = obj.CRW_GetCDConfiguration(null);

        if (ds != null)
        {
            GridView1.DataSource = ds.Tables[0];
            GridView1.DataBind();
        }
    }
Exemple #3
0
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            string strRowId           = DataBinder.Eval(e.Row.DataItem, "ID").ToString();
            string PlannedInterviewID = DataBinder.Eval(e.Row.DataItem, "PlannedInterviewID").ToString();
            string IQID                = DataBinder.Eval(e.Row.DataItem, "IQID").ToString();
            string Status_Remark       = DataBinder.Eval(e.Row.DataItem, "Status_Remark").ToString();
            string CrewName            = DataBinder.Eval(e.Row.DataItem, "staff_fullname").ToString();
            string ManningOfficeStatus = DataBinder.Eval(e.Row.DataItem, "ManningOfficeStatus").ToString();
            string CrewStatus          = DataBinder.Eval(e.Row.DataItem, "CrewStatus").ToString().ToUpper();
            string CrewID_UnAssigned   = DataBinder.Eval(e.Row.DataItem, "CrewID_UnAssigned").ToString();
            string CrewID_SigningOff   = DataBinder.Eval(e.Row.DataItem, "CrewID_SigningOff").ToString();

            string Staff_Code_OffSigner = DataBinder.Eval(e.Row.DataItem, "Staff_Code_OffSigner").ToString();
            string Staff_Name_OffSigner = DataBinder.Eval(e.Row.DataItem, "Staff_Name_OffSigner").ToString();
            string Staff_Code_OnSigner  = DataBinder.Eval(e.Row.DataItem, "Staff_Code_OnSigner").ToString();
            string Staff_Name_OnSigner  = DataBinder.Eval(e.Row.DataItem, "Staff_Name_OnSigner").ToString();

            string SignOffFromVessel = DataBinder.Eval(e.Row.DataItem, "OffSignerVessel").ToString();
            string SignOnToVessel    = DataBinder.Eval(e.Row.DataItem, "Vessel_Name").ToString();

            string Available_From_Date = DataBinder.Eval(e.Row.DataItem, "Available_From_Date").ToString();
            string Sign_Off_Date       = DataBinder.Eval(e.Row.DataItem, "Sign_Off_Date").ToString();
            string MDFStaff            = DataBinder.Eval(e.Row.DataItem, "MDFStaff").ToString();

            int Marks  = UDFLib.ConvertToInteger(DataBinder.Eval(e.Row.DataItem, "Marks").ToString());
            int AllAvg = UDFLib.ConvertToInteger(DataBinder.Eval(e.Row.DataItem, "AllAvg").ToString());
            int Last_Evaluation_Days = UDFLib.ConvertToInteger(DataBinder.Eval(e.Row.DataItem, "Last_Evaluation_Days").ToString());

            string CrewID_Sign_On_Validation = DataBinder.Eval(e.Row.DataItem, "Sign_On_Validation").ToString();
            if (CrewID_Sign_On_Validation.Contains("Passport is expiring/expired on :"))
            {
                CrewID_Sign_On_Validation = CrewID_Sign_On_Validation.Replace("Passport is expiring/expired on :", "");
                string str = CrewID_Sign_On_Validation.Substring(0, 10);
                CrewID_Sign_On_Validation = CrewID_Sign_On_Validation.Replace(str, "");
                if (!string.IsNullOrEmpty(str))
                {
                    str = UDFLib.ConvertUserDateFormat(str, UDFLib.GetDateFormat());
                }
                CrewID_Sign_On_Validation = "Passport is expiring/expired on :" + str + CrewID_Sign_On_Validation;
            }
            if (CrewID_Sign_On_Validation.Contains("Seaman is expiring/expired on :"))
            {
                CrewID_Sign_On_Validation = CrewID_Sign_On_Validation.Replace("Seaman is expiring/expired on :", "");
                string str = CrewID_Sign_On_Validation.Substring(0, 10);
                CrewID_Sign_On_Validation = CrewID_Sign_On_Validation.Replace(str, "");
                if (!string.IsNullOrEmpty(str))
                {
                    str = UDFLib.ConvertUserDateFormat(str, UDFLib.GetDateFormat());
                }
                CrewID_Sign_On_Validation = "Seaman is expiring/expired on :" + str + CrewID_Sign_On_Validation;
            }
            DataRow[] dr;
            DataTable dt = objCrewAdmin.CRW_GetCDConfiguration(null).Tables[0];
            if (dt.Rows.Count > 0)
            {
                // string confSSN=dt.row
                string str = "Age";
                dr = dt.Select("Key ='" + str + "'");
                if (dr.Length > 0)
                {
                    if (dr[0].ItemArray[3].ToString() == "True" && dr[0].ItemArray[4].ToString() == "False")
                    {
                        GridView1.Columns[GetColumnIndexByName("Age")].Visible = true;
                    }
                    else
                    {
                        GridView1.Columns[GetColumnIndexByName("Age")].Visible = false;
                    }
                }
            }
            switch (CrewStatus)
            {
            case "ONBOARD":
                e.Row.Cells[e.Row.Cells.Count - 2].CssClass = "CrewStatus_Current";
                break;

            case "EOC DUE":
                e.Row.Cells[e.Row.Cells.Count - 2].CssClass = "CrewStatus_SigningOff";
                break;

            case "ON LEAVE":
                e.Row.Cells[e.Row.Cells.Count - 2].CssClass = "CrewStatus_SignedOff";
                break;

            case "SIGNON-PLANNED":
                e.Row.Cells[e.Row.Cells.Count - 2].CssClass = "CrewStatus_Assigned";
                break;

            case "SIGNOFF-PLANNED":
                e.Row.Cells[e.Row.Cells.Count - 2].CssClass = "CrewStatus_Assigned";
                break;

            case "SIGNON-EVENT":
                e.Row.Cells[e.Row.Cells.Count - 2].CssClass = "CrewStatus_Planned";
                break;

            case "SIGNOFF-EVENT":
                e.Row.Cells[e.Row.Cells.Count - 2].CssClass = "CrewStatus_Planned";
                break;

            case "CANDIDATE":
                e.Row.Cells[e.Row.Cells.Count - 2].CssClass = "CrewStatus_Pending";
                break;

            case "NO VOYAGE":
                e.Row.Cells[e.Row.Cells.Count - 2].CssClass = "CrewStatus_NoVoyage";
                if (Available_From_Date != "")
                {
                    if (DateTime.Parse(Available_From_Date) < DateTime.Today)
                    {
                        //Available - No Voyage
                        Label lblAvailable_From_Date = (Label)e.Row.FindControl("lblAvailable_From_Date");
                        if (lblAvailable_From_Date != null)
                        {
                            lblAvailable_From_Date.CssClass = "Ready_NoVoyage";
                        }
                    }
                }
                break;

            case "INACTIVE":
                e.Row.Cells[e.Row.Cells.Count - 2].CssClass = "CrewStatus_Inactive";
                break;

            case "NTBR":
                e.Row.Cells[e.Row.Cells.Count - 2].CssClass = "CrewStatus_NTBR";
                e.Row.CssClass = "CrewStatus_NTBR_Row";
                break;

            case "REJECTED":
                e.Row.Cells[e.Row.Cells.Count - 2].CssClass = "CrewStatus_Rejected";
                break;
            }

            if (Status_Remark != "")
            {
                Status_Remark = Status_Remark.Replace("\n", "<br>");
                e.Row.Cells[e.Row.Cells.Count - 2].Attributes.Add("Title", "cssbody=[dvbdy1] cssheader=[dvhdr1] header=[" + Status_Remark + "]");
            }


            if (UDFLib.ConvertToInteger(PlannedInterviewID) > 0)
            {
                ImageButton ImgInterview = (ImageButton)(e.Row.FindControl("ImgInterview"));
                if (ImgInterview != null)
                {
                    if (UDFLib.ConvertToInteger(IQID) > 0)
                    {
                        ImgInterview.Attributes.Add("onclick", "window.open('CrewInterview.aspx?ID=" + PlannedInterviewID + "&CrewID=" + strRowId + "');");
                    }
                    else
                    {
                        ImgInterview.Attributes.Add("onclick", "window.open('Interview.aspx?ID=" + PlannedInterviewID + "&CrewID=" + strRowId + "');");
                    }

                    ImgInterview.ImageUrl = "~/Images/Interview_1.png";
                }
            }
            else
            {
                ImageButton ImgInterview = (ImageButton)(e.Row.FindControl("ImgInterview"));
                if (ImgInterview != null)
                {
                    ImgInterview.Visible = false;
                }
            }
            if (CrewID_UnAssigned != "")
            {
                ImageButton ImgCrewAssigned = (ImageButton)(e.Row.FindControl("ImgCrewAssigned"));
                if (ImgCrewAssigned != null)
                {
                    ImgCrewAssigned.Attributes.Add("onclick", "window.open('CrewDetails.aspx?ID=" + CrewID_UnAssigned + "');");
                    ImgCrewAssigned.ImageUrl = "~/Images/crew-on.png";
                    ImgCrewAssigned.Attributes.Add("Title", "cssbody=[dvbdy1] cssheader=[dvhdr1] header=[On-Signer] body=[" + Staff_Code_OnSigner + " - " + Staff_Name_OnSigner + "<br>To Vessel: " + SignOnToVessel + "]");
                }
            }
            else
            {
                ImageButton ImgCrewAssigned = (ImageButton)(e.Row.FindControl("ImgCrewAssigned"));
                if (ImgCrewAssigned != null)
                {
                    ImgCrewAssigned.Visible = false;
                }
            }
            if (CrewID_Sign_On_Validation != "")
            {
                ImageButton ImgMissingDocuments = (ImageButton)(e.Row.FindControl("ImgMissingDocuments"));
                if (ImgMissingDocuments != null)
                {
                    ImgMissingDocuments.Attributes.Add("Title", "cssbody=[dvbdy1] cssheader=[dvhdr1] header=[Missing Data] body=[" + CrewID_Sign_On_Validation + "]");
                    ImgMissingDocuments.Visible  = true;
                    ImgMissingDocuments.ImageUrl = "~/Images/folder-error.png";
                }
            }
            if (CrewID_SigningOff != "")
            {
                ImageButton ImgCrewSigningOff = (ImageButton)(e.Row.FindControl("ImgCrewSigningOff"));
                if (ImgCrewSigningOff != null)
                {
                    ImgCrewSigningOff.Attributes.Add("onclick", "window.open('CrewDetails.aspx?ID=" + CrewID_SigningOff + "');");
                    ImgCrewSigningOff.ImageUrl = "~/Images/crew-off.png";
                    ImgCrewSigningOff.Attributes.Add("Title", "cssbody=[dvbdy1] cssheader=[dvhdr1] header=[Off-Signer] body=[" + Staff_Code_OffSigner + " - " + Staff_Name_OffSigner + "<br>From Vessel: " + SignOffFromVessel + "]");
                }
            }
            else
            {
                ImageButton ImgCrewSigningOff = (ImageButton)(e.Row.FindControl("ImgCrewSigningOff"));
                if (ImgCrewSigningOff != null)
                {
                    ImgCrewSigningOff.Visible = false;
                }
            }

            if (objUA.Edit > 0)
            {
                ImageButton ImgEdit = (ImageButton)(e.Row.FindControl("ImgEdit"));
                if (ImgEdit != null)
                {
                    //ImgEdit.Attributes.Add("onclick", "window.open('AddEditCrew.aspx?ID=" + strRowId + "');");
                    ImgEdit.Attributes.Add("onclick", "window.open('AddEditCrewNew.aspx?crewid=" + strRowId + "');");
                    ImgEdit.ImageUrl = "~/Images/edit.gif";
                }
            }
            else
            {
                ImageButton ImgEdit = (ImageButton)(e.Row.FindControl("ImgEdit"));
                if (ImgEdit != null)
                {
                    ImgEdit.Visible = false;
                }
            }
            Image ImbCOCModified = (Image)e.Row.FindControl("ImbCOCModified");
            if (ImbCOCModified != null)
            {
                if (DataBinder.Eval(e.Row.DataItem, "COCRemark").ToString() == "")
                {
                    ImbCOCModified.Visible = false;
                }
                else
                {
                    ImbCOCModified.Attributes.Add("Title", "cssbody=[dvbdy1] cssheader=[dvhdr1] header=[COC Modified] body=[" + DataBinder.Eval(e.Row.DataItem, "COCRemark").ToString().Replace("\n", "<br>") + "]");
                }
            }
            Label lblX = (Label)e.Row.FindControl("lblX");
            if (lblX != null)
            {
                int iCount = UDFLib.ConvertToInteger(DataBinder.Eval(e.Row.DataItem, "InterviewCount").ToString());

                if (iCount > 0 && iCount <= 2)
                {
                    lblX.Text = "*";
                }
                if (iCount > 2)
                {
                    lblX.Text = "**";
                }
            }
            //Added a check so that only Office User or Admin can Propose or Approve Red/Yellow card(Manning agent should not be able to propose/approve card)
            if (Session["UTYPE"].ToString() == "OFFICE USER" || Session["UTYPE"].ToString() == "ADMIN")
            {
                Image ImgCard = (Image)e.Row.FindControl("ImgCard");
                if (ImgCard != null)
                {
                    if (DataBinder.Eval(e.Row.DataItem, "CardType").ToString() == "")
                    {
                        ImgCard.Visible = false;
                    }
                    else
                    {
                        ImgCard.ImageUrl = "../images/" + DataBinder.Eval(e.Row.DataItem, "CardType").ToString().Replace(" ", "") + "_" + DataBinder.Eval(e.Row.DataItem, "CardsTATUS").ToString() + ".png";
                        ImgCard.Visible  = true;
                        ImgCard.Attributes.Add("onclick", "showDiv('dvProposeYellowCard','" + DataBinder.Eval(e.Row.DataItem, "ID").ToString() + "');");

                        ImgCard.Attributes.Add("onmouseover", "showRemarks(" + DataBinder.Eval(e.Row.DataItem, "CardID").ToString() + ",event,this);");
                    }
                }
            }
            if (MDFStaff == "1")
            {
                e.Row.Cells[e.Row.Cells.Count - 10].Text = "";
            }

            Label lblMarks = (Label)e.Row.FindControl("lblMarks");
            if (lblMarks != null)
            {
                if (Marks < AllAvg)
                {
                    e.Row.Cells[e.Row.Cells.Count - 4].CssClass = "eval-background-pink";
                }
                if (Marks > AllAvg)
                {
                    e.Row.Cells[e.Row.Cells.Count - 4].CssClass = "eval-background-lightgreen";
                }

                if (Last_Evaluation_Days > 90)
                {
                    e.Row.Cells[e.Row.Cells.Count - 4].CssClass = "eval-background-yellow";
                }

                e.Row.Cells[e.Row.Cells.Count - 4].ToolTip = "Last evaluation done before: " + Last_Evaluation_Days.ToString() + " days";
            }
        }

        if (e.Row.RowType == DataControlRowType.Header)
        {
            if (ViewState["SORTBYCOLOUMN"] != null)
            {
                HtmlImage img = (HtmlImage)e.Row.FindControl(ViewState["SORTBYCOLOUMN"].ToString());
                if (img != null)
                {
                    if (ViewState["SORTDIRECTION"] == null || ViewState["SORTDIRECTION"].ToString() == "0")
                    {
                        img.Src = "~/Images/arrowUp.png";
                    }
                    else
                    {
                        img.Src = "~/Images/arrowDown.png";
                    }

                    img.Visible = true;
                }
            }
        }
    }
Exemple #4
0
    protected void ConfidentialityCheck()
    {
        DataSet ds = objCrewAdmin.CRW_GetCDConfiguration(null);

        if (ds != null)
        {
            DataTable dt  = ds.Tables[0];
            string    str = "";
            DataRow[] dr;
            if (dt.Rows.Count > 0)
            {
                str = "PermanentStatus";
                dr  = dt.Select("Key ='" + str + "'");
                if (dr.Length > 0)
                {
                    if (dr[0].ItemArray[3].ToString() == "True" && dr[0].ItemArray[4].ToString() == "False")
                    {
                        lblPermanent.Visible   = true;
                        tdlblPermanent.Visible = true;
                        tdtxtPermanent.Attributes.Add("class", "data");
                        tdtxtPermanentEdit.Visible = true;
                        ddlPermamnent.Visible      = true;
                    }
                    else
                    {
                        lblPermanent.Visible   = false;
                        tdlblPermanent.Visible = false;
                        tdtxtPermanent.Attributes.Remove("class");
                        tdtxtPermanentEdit.Visible = false;
                        ddlPermamnent.Visible      = false;
                    }
                }


                str = "HireDate";
                dr  = dt.Select("Key ='" + str + "'");
                if (dr.Length > 0)
                {
                    if (dr[0].ItemArray[3].ToString() == "True" && dr[0].ItemArray[4].ToString() == "False")
                    {
                        tdHireDatelbl.Visible = true;
                        trHireDatetxt.Visible = true;
                    }
                    else
                    {
                        tdHireDatelbl.Visible = false;
                        trHireDatetxt.Visible = false;
                    }
                }
                str = "UUB";
                dr  = dt.Select("Key ='" + str + "'");
                if (dr.Length > 0)
                {
                    if (dr[0].ItemArray[3].ToString() == "True" && dr[0].ItemArray[4].ToString() == "False")
                    {
                        tdUnion.Visible            = true;
                        tdlblUnionBook.Visible     = true;
                        tdtxtUnionBook.Visible     = true;
                        trtxtUnion.Visible         = true;
                        tdlblUnionBookEdit.Visible = true;
                        tddrpUnionBookEdit.Visible = true;
                    }
                    else
                    {
                        tdUnion.Visible            = false;
                        tdlblUnionBook.Visible     = false;
                        tdtxtUnionBook.Visible     = false;
                        trtxtUnion.Visible         = false;
                        tdlblUnionBookEdit.Visible = false;
                        tddrpUnionBookEdit.Visible = false;
                    }
                }
            }
        }
    }