コード例 #1
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;
            }
        }
    }