Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["USERID"] == null)
        {
            Response.Redirect("~/Account/Login.aspx");
        }

        DateFormat      = CalendarExtender4.Format = CalendarExtender2.Format = CalendarExtender15.Format = CalendarExtender1.Format = CalendarExtender3.Format = UDFLib.GetDateFormat();
        TodayDateFormat = UDFLib.DateFormatMessage();
        lblMessage.Text = "";

        DataTable dt = objBLLCrew.Get_CrewPersonalDetailsByID(GetCrewID());

        Staff_Nationality = int.Parse(dt.Rows[0]["Staff_Nationality"].ToString());

        DataTable dtWages = objCrewAdmin.GetWagesSettings();

        if (dtWages != null && dtWages.Rows.Count > 0)
        {
            if (Convert.ToBoolean(dtWages.Rows[0]["NationalityConsidered"]) == true)
            {
                NationalityConsidered = 1;
            }
            if (Convert.ToBoolean(dtWages.Rows[0]["RankScaleConsidered"]) == true)
            {
                RankScaleConsidered = 1;
                trRankScale.Visible = true;
            }
            else
            {
                trRankScale.Visible = false;
            }
        }
        if (!IsPostBack)
        {
            UserAccessValidation();
            BindGrid();
        }
    }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (GetSessionUserID() == 0)
        {
            Response.Redirect("~/account/login.aspx");
        }
        else
        {
            UserAccessValidation();
        }

        if (!IsPostBack)
        {
            DataTable dt = objCrewAdmin.GetInterviewSettings();
            Load_RankList();
            if (dt != null && dt.Rows.Count > 0)
            {
                chkInterview_Mandatory.Checked = Convert.ToBoolean(dt.Rows[0]["Interview_Mandatory"]);
                chkRejectedCheck.Checked       = Convert.ToBoolean(dt.Rows[0]["Check_Rejected_Interview"]);
            }
            DataTable dtRankList = objRank.Get_RankMandatoryList();
            gvRankList.DataSource = dtRankList;
            gvRankList.DataBind();

            DataTable dtWages = objCrewAdmin.GetWagesSettings();
            if (dtWages != null && dtWages.Rows.Count > 0)
            {
                chkNationality.Checked = Convert.ToBoolean(dtWages.Rows[0]["NationalityConsidered"]);
                chkRankScale.Checked   = Convert.ToBoolean(dtWages.Rows[0]["RankScaleConsidered"]);
                chkVesselFlag.Checked  = Convert.ToBoolean(dtWages.Rows[0]["VesselFlagConsidered"]);
            }


            DataTable dtMandatorySettings = objCrewAdmin.GetMandatorySettings();
            if (dtMandatorySettings != null && dtMandatorySettings.Rows.Count > 0)
            {
                chkNOK.Checked            = Convert.ToBoolean(dtMandatorySettings.Rows[0]["Value"]);
                chkCrewPhoto.Checked      = Convert.ToBoolean(dtMandatorySettings.Rows[1]["Value"]);
                chkBankAccDetails.Checked = Convert.ToBoolean(dtMandatorySettings.Rows[2]["Value"]);
                chkSeniority.Checked      = Convert.ToBoolean(dtMandatorySettings.Rows[3]["Value"]);
                ddlRank.SelectedValue     = dtMandatorySettings.Rows[4]["Value"].ToString();
                chkLeaveWithhold.Checked  = Convert.ToBoolean(dtMandatorySettings.Rows[5]["Value"]);

                DataRow[] dr = dtMandatorySettings.Select("key_Name='EvaluationDigitalSignature'");
                if (dr.Length > 0)
                {
                    chkEvalSign.Checked = Convert.ToBoolean(dtMandatorySettings.Rows[6]["Value"]);
                }
            }

            DataTable dtDocument = objCrewAdmin.GetDocumentSettings();
            if (dtDocument != null && dtDocument.Rows.Count > 0)
            {
                if (Convert.ToBoolean(dtDocument.Rows[0]["VesselFlagConsidered"]) == true)
                {
                    rdbConsider.SelectedValue = "VesselFlag";
                }
                else
                {
                    rdbConsider.SelectedValue = "Vessel";
                }

                chkSTCWDeck.Checked   = Convert.ToBoolean(dtDocument.Rows[0]["STCW_Deck_Considered"]);
                chkSTCWEngine.Checked = Convert.ToBoolean(dtDocument.Rows[0]["STCW_Engine_Considered"]);
            }

            DataTable dtSeniorityReset = objCrewAdmin.GetSeniorityResetSettings();
            if (dtSeniorityReset != null && dtSeniorityReset.Rows.Count > 0)
            {
                if (Convert.ToBoolean(dtSeniorityReset.Rows[0]["AutomaticResetConsidered"]) == true)
                {
                    chkSeniorityReset.Checked      = true;
                    ddlSeniorityYear.Enabled       = true;
                    ddlSeniorityYear.SelectedValue = dtSeniorityReset.Rows[0]["ResetYears"].ToString();
                }
                else
                {
                    chkSeniorityReset.Checked = false;
                    ddlSeniorityYear.Enabled  = false;
                }
            }
            else
            {
                chkSeniorityReset.Checked = false;
                ddlSeniorityYear.Enabled  = false;
            }
        }
    }
Esempio n. 3
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;
    }