Exemple #1
0
    protected void ddlRank_SelectedIndexChanged(object sender, EventArgs e)
    {
        int       InterviewID = int.Parse(getQueryString("ID"));
        DataTable dt          = BLL_Crew_Interview.getInterviewDetails(InterviewID);

        if (dt.Rows.Count > 0)
        {
            int IQID   = UDFLib.ConvertToInteger(dt.Rows[0]["IQID"]);
            int RankID = UDFLib.ConvertToInteger(ddlRank.SelectedValue);

            if (dt.Rows[0]["RankID"].ToString() != ddlRank.SelectedValue)
            {
                //BLL_Crew_Interview.UPDATE_CrewInterviewPlanning(InterviewID, dt.Rows[0]["InterviewPlanDate"].ToString(), UDFLib.ConvertToInteger(dt.Rows[0]["PlannedInterviewerID"].ToString()), RankID, GetSessionUserID());
            }

            lblMaxMarks.Text    = "";
            lblUserMarks_P.Text = "";
            lblUserMarks.Text   = "";
            lblOutOf5.Text      = "";

            DataSet dsQA = BLL_Crew_Interview.Get_InterviewQuestionAnswers(InterviewID, RankID);
            GridView_AssignedCriteria.DataSource = dsQA.Tables[0];
            GridView_AssignedCriteria.DataBind();
        }
    }
Exemple #2
0
    protected void CalculateMarks(int InterviewID)
    {
        decimal UserMarks = 0;
        decimal FullMark  = 0;
        decimal Avg       = 0;
        string  js        = "";

        DataSet dsQA = BLL_Crew_Interview.Get_InterviewQuestionAnswers(InterviewID, GetSessionUserID());

        foreach (DataRow dr in dsQA.Tables[0].Rows)
        {
            if (UDFLib.ConvertToDecimal(dr["NotApplicable"].ToString()) == 0)
            {
                FullMark  += UDFLib.ConvertToDecimal(dr["Max"].ToString());
                UserMarks += UDFLib.ConvertToDecimal(dr["UserAnswer"].ToString());
                if (FullMark > 0)
                {
                    Avg = UserMarks / FullMark * 100;
                }
            }
        }

        lblMaxMarks.Text    = FullMark.ToString();
        lblUserMarks_P.Text = Avg.ToString("0.0");
        lblUserMarks.Text   = UserMarks.ToString("0.0");

        if (FullMark > 0)
        {
            lblOutOf5.Text = (UserMarks / FullMark * 5).ToString("0.0");
            if ((UserMarks / FullMark * 5) > 2)
            {
                js = "setDotColor('green');";
            }
            else
            {
                js = "setDotColor('red');";
            }
        }
        else
        {
            lblOutOf5.Text = "0.0";
            js             = "setDotColor('red');";
        }
        ScriptManager.RegisterStartupScript(this, this.GetType(), "setDotColor_", js, true);
    }
Exemple #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        calFrom.Format = Convert.ToString(Session["User_DateFormat"]);

        if (!IsPostBack)
        {
            UserAccessValidation();
            string InterviewPlannedDate = "";
            int    InterviewID          = 0;
            int    iUserID = GetSessionUserID();

            Load_RankList();
            if (getQueryString("ID") != "")
            {
                InterviewID = int.Parse(getQueryString("ID"));
                DataTable dt = BLL_Crew_Interview.getInterviewDetails(InterviewID);

                if (dt.Rows.Count > 0)
                {
                    pnlEdit_InterviewResult.Visible = true;

                    hdnInterviewID.Value = InterviewID.ToString();
                    hdnCrewID.Value      = dt.Rows[0]["CrewID"].ToString();

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

                    InterviewPlannedDate       = dt.Rows[0]["InterviewPlanDate"].ToString();
                    lnkOpenProfile.NavigateUrl = "CrewDetails.aspx?ID=" + iCrewID;

                    lblPlannedInterviewer.Text = dt.Rows[0]["PlannedInterviewer"].ToString();
                    lblPlannedDate.Text        = UDFLib.ConvertUserDateFormatTime(Convert.ToString(dt.Rows[0]["InterviewPlanDate"]));
                    lblPlannedBy.Text          = dt.Rows[0]["PlannedBy"].ToString();
                    lblPlannedTimeZone.Text    = dt.Rows[0]["DisplayName"].ToString();

                    txtPersonInterviewed.Text    = dt.Rows[0]["CandidateName"].ToString();
                    txtPersonInterviewed.Enabled = false;
                    if (dt.Rows[0]["InterviewDate"].ToString().Trim() != "")
                    {
                        txtInterviewDate.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(dt.Rows[0]["InterviewDate"]));
                    }
                    else
                    {
                        txtInterviewDate.Text = DateTime.Today.ToString(Convert.ToString(Session["User_DateFormat"]));
                    }

                    txtInterviewDate.Enabled = false;

                    if (dt.Rows[0]["RANKID"].ToString() != "")
                    {
                        ddlRank.SelectedValue = dt.Rows[0]["RANKID"].ToString();
                        ddlRank.Enabled       = false;
                    }
                    txtStaffCode.Text = dt.Rows[0]["staff_code"].ToString();
                    if (dt.Rows[0]["Interviewer"].ToString().Trim() != "")
                    {
                        ddlUserList.Items.Clear();
                        ddlUserList.Items.Add(new ListItem(dt.Rows[0]["Interviewer"].ToString(), dt.Rows[0]["InterviewerID"].ToString()));
                        ddlUserList.SelectedIndex      = 0;
                        btnSaveInterviewResult.Enabled = false;
                    }
                    else
                    {
                        ddlUserList.DataBind();
                        ddlUserList.SelectedValue      = GetSessionUserID().ToString();
                        btnSaveInterviewResult.Enabled = true;
                    }
                    ddlUserList.Enabled = false;

                    lblPlannedDate.Text = UDFLib.ConvertUserDateFormatTime(Convert.ToString(dt.Rows[0]["InterviewPlanDate"]));
                    lblPlannedBy.Text   = dt.Rows[0]["PlannedBy"].ToString();

                    // int IQID = UDFLib.ConvertToInteger(dt.Rows[0]["IQID"]);

                    DataSet dsQA = BLL_Crew_Interview.Get_InterviewQuestionAnswers(InterviewID, GetSessionUserID());
                    GridView_AssignedCriteria.DataSource = dsQA.Tables[0];
                    GridView_AssignedCriteria.DataBind();
                }
            }
            else
            {
                int       CrewID = GetCrewID();
                DataTable dtCD   = objCrewBLL.Get_CrewPersonalDetailsByID(CrewID);
                if (dtCD.Rows.Count > 0)
                {
                    txtInterviewDate.Text    = DateTime.Today.ToString(Convert.ToString(Session["User_DateFormat"]));
                    txtInterviewDate.Enabled = false;
                    //ddlRank.Text = dtCD.Rows[0]["Rank_Applied"].ToString();

                    pnlEdit_InterviewResult.Visible = false;
                    lblMessage.Text = "Interview is not yet planned for the crew. Please fill the interview plan";
                }
                else
                {
                    Response.Redirect("Crewlist.aspx");
                }
            }
        }

        ScriptManager.RegisterStartupScript(this, this.GetType(), "alertUser1", "initScript();", true);
    }
Exemple #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        calFrom.Format = Convert.ToString(Session["User_DateFormat"]);

        if (!IsPostBack)
        {
            UserAccessValidation();
            string InterviewPlannedDate = "";
            int    InterviewID          = 0;
            int    iUserID = GetSessionUserID();

            Load_RankList();
            Load_VesselList();

            if (getQueryString("ID") != "")
            {
                InterviewID = int.Parse(getQueryString("ID"));
                DataTable dt = BLL_Crew_Interview.getInterviewDetails(InterviewID);

                if (dt.Rows.Count > 0)
                {
                    pnlInterviewPlanning.Visible    = false;
                    pnlEdit_InterviewResult.Visible = true;

                    hdnInterviewID.Value = InterviewID.ToString();
                    hdnCrewID.Value      = dt.Rows[0]["CrewID"].ToString();

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

                    InterviewPlannedDate       = dt.Rows[0]["InterviewPlanDate"].ToString();
                    lnkOpenProfile.NavigateUrl = "CrewDetails.aspx?ID=" + iCrewID;

                    lblPlannedInterviewer.Text = dt.Rows[0]["PlannedInterviewer"].ToString();
                    lblPlannedDate.Text        = UDFLib.ConvertUserDateFormatTime(Convert.ToString(dt.Rows[0]["InterviewPlanDate"]));
                    lblPlannedBy.Text          = dt.Rows[0]["PlannedBy"].ToString();
                    lblPlannedTimeZone.Text    = dt.Rows[0]["DisplayName"].ToString();

                    txtPersonInterviewed.Text    = dt.Rows[0]["CandidateName"].ToString();
                    txtPersonInterviewed.Enabled = false;

                    if (dt.Rows[0]["InterviewDate"].ToString().Trim() != "")
                    {
                        txtInterviewDate.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(dt.Rows[0]["InterviewDate"]));
                        lblInterviewDate.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(dt.Rows[0]["InterviewDate"]));
                    }
                    else
                    {
                        txtInterviewDate.Text = DateTime.Today.ToString(Convert.ToString(Session["User_DateFormat"]));
                    }

                    txtInterviewDate.Enabled = false;

                    if (dt.Rows[0]["RANKID"].ToString() != "")
                    {
                        txtInterviewRank.Text = dt.Rows[0]["Rank_Short_Name"].ToString();
                        ddlRank.SelectedValue = dt.Rows[0]["RANKID"].ToString();
                        ddlRank.Enabled       = false;
                    }

                    txtStaffCode.Text = dt.Rows[0]["staff_code"].ToString();

                    if (dt.Rows[0]["Interviewer"].ToString().Trim() != "")
                    {
                        ddlUserList.Items.Clear();
                        ddlUserList.Items.Add(new ListItem(dt.Rows[0]["Interviewer"].ToString(), dt.Rows[0]["InterviewerID"].ToString()));
                        ddlUserList.SelectedIndex      = 0;
                        btnSaveInterviewResult.Enabled = false;
                        lnkEditSchedule.Visible        = false;
                    }
                    else
                    {
                        ddlUserList.DataBind();
                        ddlUserList.SelectedValue      = GetSessionUserID().ToString();
                        btnSaveInterviewResult.Enabled = true;
                        lnkEditSchedule.Visible        = true;
                        lnkEditSchedule.Attributes.Add("onclick", "EditInterviewSchedule('CrewInterview.aspx'," + InterviewID.ToString() + "); return false;");
                    }
                    ddlUserList.Enabled = false;

                    lblInterviewSheet_Name.Text     = dt.Rows[0]["Interview_Name"].ToString();
                    txtPlanInterviewerPosition.Text = dt.Rows[0]["Designation"].ToString();

                    lblPlannedDate.Text = UDFLib.ConvertUserDateFormatTime(Convert.ToString(dt.Rows[0]["InterviewPlanDate"]));
                    lblPlannedBy.Text   = dt.Rows[0]["PlannedBy"].ToString();

                    rdoSelected.SelectedValue = dt.Rows[0]["Result"].ToString();
                    txtResultText.Text        = dt.Rows[0]["ResultText"].ToString();

                    int IQID   = UDFLib.ConvertToInteger(dt.Rows[0]["IQID"]);
                    int RankID = UDFLib.ConvertToInteger(dt.Rows[0]["RankID"]);

                    DataSet dsQA = BLL_Crew_Interview.Get_InterviewQuestionAnswers(InterviewID, GetSessionUserID());
                    GridView_AssignedCriteria.DataSource = dsQA.Tables[0];
                    GridView_AssignedCriteria.DataBind();

                    if (dsQA.Tables[1].Rows.Count > 0)
                    {
                        foreach (DataRow dr in dsQA.Tables[1].Rows)
                        {
                            for (var i = 1; i < lstVessels.Items.Count; i++)
                            {
                                if (lstVessels.Items[i].Value == dr["vesselid"].ToString())
                                {
                                    lstVessels.Items[i].Selected = true;
                                }
                            }
                        }
                    }
                    if (dsQA.Tables[1].Rows.Count > 0)
                    {
                        foreach (DataRow dr in dsQA.Tables[2].Rows)
                        {
                            for (var i = 0; i < chkTradingArea.Items.Count; i++)
                            {
                                if (chkTradingArea.Items[i].Value == dr["zoneid"].ToString())
                                {
                                    chkTradingArea.Items[i].Selected = true;
                                }
                            }
                        }
                    }

                    CalculateMarks(InterviewID);
                }
                else
                {
                    pnlInterviewPlanning.Visible    = true;
                    pnlEdit_InterviewResult.Visible = false;

                    int       CrewID = GetCrewID();
                    DataTable dtCrew = objCrewBLL.Get_CrewPersonalDetailsByID(CrewID);
                    if (dtCrew.Rows.Count > 0)
                    {
                        txtPlanCrewName.Text    = dtCrew.Rows[0]["staff_fullname"].ToString();
                        txtPlanCrewName.Enabled = false;

                        txtInterviewDate.Text    = DateTime.Today.ToString("dd/MM/yyyy");
                        txtInterviewDate.Enabled = false;

                        ddlPlanRank.Text = dtCrew.Rows[0]["Rank_Applied"].ToString();
                        ddlRank.Text     = dtCrew.Rows[0]["Rank_Applied"].ToString();

                        pnlInterviewPlanning.Visible    = true;
                        pnlEdit_InterviewResult.Visible = false;

                        lblMessage.Text = "Interview is not yet planned for the crew. Please fill the interview plan";
                    }
                }
            }
            else
            {
                int       CrewID = GetCrewID();
                DataTable dtCD   = objCrewBLL.Get_CrewPersonalDetailsByID(CrewID);
                if (dtCD.Rows.Count > 0)
                {
                    txtPlanCrewName.Text    = dtCD.Rows[0]["staff_fullname"].ToString();
                    txtPlanCrewName.Enabled = false;

                    txtInterviewDate.Text    = DateTime.Today.ToString("dd/MM/yyyy");
                    txtInterviewDate.Enabled = false;

                    ddlPlanRank.Text = dtCD.Rows[0]["Rank_Applied"].ToString();
                    ddlRank.Text     = dtCD.Rows[0]["Rank_Applied"].ToString();

                    pnlInterviewPlanning.Visible    = true;
                    pnlEdit_InterviewResult.Visible = false;

                    lblMessage.Text = "Interview is not yet planned for the crew. Please fill the interview plan";
                }
                else
                {
                    Response.Redirect("Crewlist.aspx");
                }
            }
        }

        ScriptManager.RegisterStartupScript(this, this.GetType(), "alertUser1", "initScript();", true);
    }