Beispiel #1
0
    protected void btn_Submit_Click(object sender, EventArgs e)
    {
        try
        {
            StrAppend = new StringBuilder();

            _obj_Rec_InterviewAssessmentForm = new RECRUITMENT_INTERVIEWASSESSMENTFORM();

            _obj_Rec_InterviewAssessmentForm.IAF_APPLID  = Convert.ToInt32(Rcb_ApplicantID.SelectedItem.Value);
            _obj_Rec_InterviewAssessmentForm.IAF_JOBREID = Convert.ToInt32(Rcb_JobReq.SelectedItem.Value);
            //_obj_Rec_InterviewAssessmentForm.MODE = 7;

            //if (Recruitment_BLL.get_InterviewAssessment(_obj_Rec_InterviewAssessmentForm).Rows[0]["COUNT"].ToString() != "0")
            //{
            //    Recruitment_BLL.ShowMessage(this, "Sorry.Applicant had already attended the Interview");
            //    return;
            //}
            //else
            //{
            _obj_Rec_InterviewAssessmentForm.MODE             = 1;
            _obj_Rec_InterviewAssessmentForm.IAF_ADDLCOMMENTS = Convert.ToString(rtxt_AdditionalComments1.Text);
            _obj_Rec_InterviewAssessmentForm.IAF_CREATEDBY    = Convert.ToInt32(Session["UserId"]);
            _obj_Rec_InterviewAssessmentForm.IAF_CREATEDDATE  = DateTime.Now;
            _obj_Rec_InterviewAssessmentForm.IAF_LASTMDFBY    = Convert.ToInt32(Session["UserId"]);
            _obj_Rec_InterviewAssessmentForm.IAF_LASTMDFDATE  = DateTime.Now;

            switch (((Button)sender).ID.ToUpper())
            {
            case "BTN_SUBMIT":

                _obj_Rec_InterviewAssessmentForm.IAF_APPROVE = 1;
                //_obj_Rec_InterviewAssessmentForm.IAF_APPLID = Convert.ToInt32(Rcb_ApplicantID.SelectedItem.Value);
                //_obj_Rec_InterviewAssessmentForm.IAF_JOBREID = Convert.ToInt32(Rcb_JobReq.SelectedItem.Value);
                _obj_Rec_InterviewAssessmentForm.IAF_PHASEDEFID = Convert.ToInt32(Rcb_PhaseID.SelectedItem.Value);
                _obj_Rec_InterviewAssessmentForm.IAF_DATE       = DateTime.Now;   //Convert.ToDateTime(rdi_Date.Text);//

                foreach (GridDataItem Singleitem in RG_Skills1.Items)
                {
                    _obj_Rec_InterviewAssessmentForm.IAF_SKILLCAT_ID = Convert.ToInt32(Singleitem.Cells[2].Text);

                    RadComboBox chk = (RadComboBox)Singleitem.Cells[4].FindControl("Rcb_Assesment");
                    StrAppend.Append("Exec USP_SMHR_INTERVIEWASSESSMENTFORM @MODE = 1 , @IAF_APPLID = '" + _obj_Rec_InterviewAssessmentForm.IAF_APPLID + "'");
                    StrAppend.AppendLine(",@IAF_JOBREID = '" + _obj_Rec_InterviewAssessmentForm.IAF_JOBREID + "', @IAF_SKILLCAT_ID = '" + _obj_Rec_InterviewAssessmentForm.IAF_SKILLCAT_ID + "'");
                    StrAppend.AppendLine(",@IAF_APPLGRADE_ID = '" + chk.SelectedItem.Value + "',@IAF_ADDLCOMMENTS = '" + _obj_Rec_InterviewAssessmentForm.IAF_ADDLCOMMENTS + "'");
                    StrAppend.AppendLine(",@IAF_APPROVE = '" + _obj_Rec_InterviewAssessmentForm.IAF_APPROVE + "', @IAF_DATE = '" + _obj_Rec_InterviewAssessmentForm.IAF_DATE + "'");
                    StrAppend.AppendLine(",@IAF_CREATEDBY = '" + _obj_Rec_InterviewAssessmentForm.IAF_CREATEDBY + "',@IAF_CREATEDDATE = '" + _obj_Rec_InterviewAssessmentForm.IAF_CREATEDDATE + "' ");
                    StrAppend.AppendLine(",@IAF_LASTMDFBY = '" + _obj_Rec_InterviewAssessmentForm.IAF_LASTMDFBY + "' , @IAF_LASTMDFDATE = '" + _obj_Rec_InterviewAssessmentForm.IAF_LASTMDFDATE + "'");
                    StrAppend.AppendLine(",@IAF_PHASEDEFID ='" + _obj_Rec_InterviewAssessmentForm.IAF_PHASEDEFID + "'");
                }

                if (Recruitment_BLL.set_InterviewAssessment(_obj_Rec_InterviewAssessmentForm, StrAppend.ToString()))
                {
                    Recruitment_BLL.ShowMessage(this, "Record saved successfully");
                }
                else
                {
                    Recruitment_BLL.ShowMessage(this, "Record not saved");
                }

                ClearControls();
                RMP_InterviewAssesment.SelectedIndex = 0;

                break;

            case "BTN_REJECTED":

                _obj_Rec_InterviewAssessmentForm.IAF_APPROVE = 0;
                //_obj_Rec_InterviewAssessmentForm.IAF_APPLID = Convert.ToInt32(Rcb_ApplicantID.SelectedItem.Value);
                //_obj_Rec_InterviewAssessmentForm.IAF_JOBREID = Convert.ToInt32(Rcb_JobReq.SelectedItem.Value);
                _obj_Rec_InterviewAssessmentForm.IAF_PHASEDEFID = Convert.ToInt32(Rcb_PhaseID.SelectedItem.Value);
                _obj_Rec_InterviewAssessmentForm.IAF_DATE       = DateTime.Now;   //Convert.ToDateTime(rdi_Date.Text);

                foreach (GridDataItem Singleitem in RG_Skills1.Items)
                {
                    _obj_Rec_InterviewAssessmentForm.IAF_SKILLCAT_ID = Convert.ToInt32(Singleitem.Cells[2].Text);
                    RadComboBox chk = (RadComboBox)Singleitem.Cells[4].FindControl("Rcb_Assesment");
                    StrAppend.Append("Exec USP_SMHR_INTERVIEWASSESSMENTFORM @MODE = 1 , @IAF_APPLID = '" + _obj_Rec_InterviewAssessmentForm.IAF_APPLID + "'");
                    StrAppend.AppendLine(",@IAF_JOBREID = '" + _obj_Rec_InterviewAssessmentForm.IAF_JOBREID + "', @IAF_SKILLCAT_ID = '" + _obj_Rec_InterviewAssessmentForm.IAF_SKILLCAT_ID + "'");
                    StrAppend.AppendLine(",@IAF_APPLGRADE_ID = '" + chk.SelectedItem.Value + "',@IAF_ADDLCOMMENTS = '" + _obj_Rec_InterviewAssessmentForm.IAF_ADDLCOMMENTS + "'");
                    StrAppend.AppendLine(",@IAF_APPROVE = '" + _obj_Rec_InterviewAssessmentForm.IAF_APPROVE + "', @IAF_DATE = '" + _obj_Rec_InterviewAssessmentForm.IAF_DATE + "'");
                    StrAppend.AppendLine(",@IAF_CREATEDBY = '" + _obj_Rec_InterviewAssessmentForm.IAF_CREATEDBY + "',@IAF_CREATEDDATE = '" + _obj_Rec_InterviewAssessmentForm.IAF_CREATEDDATE + "' ");
                    StrAppend.AppendLine(",@IAF_LASTMDFBY = '" + _obj_Rec_InterviewAssessmentForm.IAF_LASTMDFBY + "' , @IAF_LASTMDFDATE = '" + _obj_Rec_InterviewAssessmentForm.IAF_LASTMDFDATE + "'");
                    StrAppend.AppendLine(",@IAF_PHASEDEFID ='" + _obj_Rec_InterviewAssessmentForm.IAF_PHASEDEFID + "'");
                }

                if (Recruitment_BLL.set_InterviewAssessment(_obj_Rec_InterviewAssessmentForm, StrAppend.ToString()))
                {
                    Recruitment_BLL.ShowMessage(this, "Record saved successfully");
                }
                else
                {
                    Recruitment_BLL.ShowMessage(this, "Record not saved");
                }

                ClearControls();
                RMP_InterviewAssesment.SelectedIndex = 0;

                break;

            case "BTN_NEXT":
                LoadApplicantDetails();
                RMP_InterviewAssesment.SelectedIndex = 1;
                break;

            default:
                break;
            }
//            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_InterviewAssesment", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }