Пример #1
0
    protected void LoadGrid()
    {
        try
        {
            SMHR_TRAINING_ONLINEASSESSMENT oSMHR_TRAINING_ONLINEASSESSMENT = new SMHR_TRAINING_ONLINEASSESSMENT();
            oSMHR_TRAINING_ONLINEASSESSMENT.OPERATION       = operation.Select;
            oSMHR_TRAINING_ONLINEASSESSMENT.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            DataTable dt = BLL.get_OnlineAssessment(oSMHR_TRAINING_ONLINEASSESSMENT);
            if (dt.Rows.Count != 0)
            {
                Rg_TrgFeedback.DataSource = dt;
            }
            else
            {
                DataTable dt1 = new DataTable();

                Rg_TrgFeedback.DataSource = dt1;

                Rg_TrgFeedback.DataBind();
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingFeedBack", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Пример #2
0
    protected void LoadGrid()
    {
        try
        {
            _obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION       = operation.Select;
            _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
            DataTable dt = BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE);
            if (dt.Rows.Count != 0)
            {
                Rg_TrgFeedback.DataSource = dt;
            }
            else
            {
                DataTable dt1 = new DataTable();

                Rg_TrgFeedback.DataSource = dt1;

                Rg_TrgFeedback.DataBind();
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingFeedBack", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Пример #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                LoadGrid();
                Rg_TrgFeedback.DataBind();
                Session.Remove("WRITEFACILITY");

                SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

                _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
                _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
                _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("ASSIGN FEEDBACK");
                DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
                if (dtformdtls.Rows.Count != 0)
                {
                    if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                    {
                        Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                    }
                }
                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    RG_FeedBack.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                    RG_FeedBack.Enabled = false;
                }
                else
                {
                    RG_FeedBack.Enabled = true;
                }
                Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0;
            }
            Page.Validate();
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingFeedBack", ex.StackTrace, DateTime.Now);

            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Пример #4
0
    protected void btn_Cancel_Click(object sender, EventArgs e)
    {
        try
        {
            RP_trgfeedback_VIEWDETAILS.Visible = false;
            Rp_TRGFEEDABCK_VIEWMAIN.Visible    = true;
            Rm_TRGFEEDABCK_PAGE.SelectedIndex  = 0;

            LoadGrid();
            Rg_TrgFeedback.DataBind();
            Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0;


            //LoadGrid();
            //Rg_TrgFeedback.Visible = true;
            //Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0;
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingFeedBack", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Пример #5
0
    protected void btn_assign_Click(object sender, EventArgs e)
    {
        try
        {
            //assign feedback to trainer of that trg
            if (rcmb_CourseSchedule.SelectedItem.Text == "Trainer")
            {
                SMHR_ASSIGNFEEDBACK_EMPLOYEE _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE = new SMHR_ASSIGNFEEDBACK_EMPLOYEE();


                _obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION         = operation.MODE1;
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_ORG_ID   = Convert.ToInt32(Session["ORG_ID"]);
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_NAME     = BLL.ReplaceQuote(Convert.ToString(rtxt_AssessmentName.Text));
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_BU_ID    = Convert.ToInt32(rcmb_CC.SelectedItem.Value);
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_TR_ID    = Convert.ToInt32(rcmb_CourseName.SelectedItem.Value);
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_CATEGORY = Convert.ToString(rcmb_CourseSchedule.SelectedItem.Text);

                DataTable dt5 = BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE);

                SMHR_TRAINER _obj_Smhr_Trner = new SMHR_TRAINER();
                _obj_Smhr_Trner.Mode = 5;
                _obj_Smhr_Trner.TRAINERDETAILS_TR_ID = Convert.ToInt32(rcmb_CourseName.SelectedItem.Value);
                DataTable dt1 = BLL.get_TRAINer(_obj_Smhr_Trner);


                _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.Mode = 2;
                _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGNFEED_FEEBAK_ID = Convert.ToInt32(dt5.Rows[0]["FEEDBACK_ID"]);
                //if trg is external then inplace of trainer we are passing hr employeeid
                if (dt1.Rows.Count != 0)
                {
                    _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = Convert.ToInt32(dt1.Rows[0]["TRAINERDETAILS_EMPLOYEEID"]);
                }
                else
                {//IF TRAINER EXTERNAL WE HAVE TO GIVE HR ID
                    _obj_Smhr_TrgRqst           = new SMHR_TRAININGREQUEST();
                    _obj_Smhr_TrgRqst.Mode      = 21;
                    _obj_Smhr_TrgRqst.TR_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
                    DataTable DT45 = BLL.get_TrgRqst(_obj_Smhr_TrgRqst);
                    if (DT45.Rows.Count != 0)
                    {
                        _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = 0;
                    }

                    else
                    {
                        _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = 0;
                    }
                }

                DataTable dt2 = BLL.get__SMHR_ASSIGNFEEDBACK_EMPLOYEE(_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE);
                if (dt2.Rows.Count != 0)
                {
                    BLL.ShowMessage(this, "Tarining Already Assigned To Employee");
                    return;
                }
                else
                {
                    _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE      = new SMHR_ASSIGNFEEDBACK_EMPLOYEE();
                    _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.Mode = 3;
                    _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGNFEED_FEEBAK_ID = Convert.ToInt32(dt5.Rows[0]["FEEDBACK_ID"]);
                    if (dt1.Rows.Count != 0)
                    {
                        _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = Convert.ToInt32(dt1.Rows[0]["TRAINERDETAILS_EMPLOYEEID"]);
                    }

                    else
                    {
                        _obj_Smhr_TrgRqst           = new SMHR_TRAININGREQUEST();
                        _obj_Smhr_TrgRqst.Mode      = 21;
                        _obj_Smhr_TrgRqst.TR_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
                        DataTable DT455 = BLL.get_TrgRqst(_obj_Smhr_TrgRqst);
                        if (DT455.Rows.Count != 0)
                        {
                            _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = 0;
                        }

                        else
                        {
                            _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = 0;
                        }
                    }
                    _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_CREATEDBY   = Convert.ToInt32(Session["USER_ID"]);
                    _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_CREATEDDATE = DateTime.Now;
                    bool status = BLL.set_SMHR_ASSIGNFEEDBACK_EMPLOYEE(_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE);
                    if (status == true)
                    {
                        BLL.ShowMessage(this, "Feedback Assigned Successfully");
                        LoadGrid();
                        Rg_TrgFeedback.DataBind();
                        Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0;
                        return;
                    }
                }
            }
            else if (rcmb_CourseSchedule.SelectedItem.Text == "Trainee")
            {
                SMHR_ASSIGNFEEDBACK_EMPLOYEE _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE = new SMHR_ASSIGNFEEDBACK_EMPLOYEE();

                _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.Mode = 6;
                _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGNFEED_FEEBAK_ID = Convert.ToInt32(lbl_id.Text);

                DataTable dttrnee = BLL.get__SMHR_ASSIGNFEEDBACK_EMPLOYEE(_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE);

                if (dttrnee.Rows.Count != 0)
                {
                    BLL.ShowMessage(this, "Tarining Already Assigned To Trainee");
                    return;
                }
                else
                {
                    SMHR_TRAINEE _obj_Smhr_TrnEE = new SMHR_TRAINEE();
                    _obj_Smhr_TrnEE.Mode           = 5;
                    _obj_Smhr_TrnEE.TRAINEE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
                    _obj_Smhr_TrnEE.TRAINEE_TR_ID  = Convert.ToInt32(rcmb_CourseName.SelectedItem.Value);
                    DataTable dtemp = BLL.get_TRAINEE(_obj_Smhr_TrnEE);
                    //  for (int i = 0; i <= dtemp.Rows.Count ; i++)
                    //  {
                    foreach (DataRow item in dtemp.Rows)
                    {
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION         = operation.MODE1;
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_BU_ID    = Convert.ToInt32(rcmb_CC.SelectedItem.Value);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_TR_ID    = Convert.ToInt32(rcmb_CourseName.SelectedItem.Value);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_CATEGORY = Convert.ToString(rcmb_CourseSchedule.SelectedItem.Text);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_NAME     = BLL.ReplaceQuote(Convert.ToString(rtxt_AssessmentName.Text));
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_ORG_ID   = Convert.ToInt32(Session["ORG_ID"]);
                        DataTable dt5 = BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE);

                        _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE      = new SMHR_ASSIGNFEEDBACK_EMPLOYEE();
                        _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.Mode = 3;

                        _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGNFEED_FEEBAK_ID = Convert.ToInt32(dt5.Rows[0]["FEEDBACK_ID"]);
                        _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID        = Convert.ToInt32(item["TRAINEE_EMPID"]);
                        _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_CREATEDBY     = Convert.ToInt32(Session["USER_ID"]);
                        _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_CREATEDDATE   = DateTime.Now;
                        bool status = BLL.set_SMHR_ASSIGNFEEDBACK_EMPLOYEE(_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE);
                        if (status == true)
                        {
                            //BLL.ShowMessage(this, "Feedback Assigned Successfully");
                            //LoadGrid();
                            //Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0;
                        }
                        //BLL.ShowMessage(this, "Feedback Assigned Successfully");
                        LoadGrid();
                        Rg_TrgFeedback.DataBind();

                        Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingFeedBack", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Пример #6
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            if (radQuestions.CheckedItems.Count == 0)
            {
                BLL.ShowMessage(this, "Please select Questions");
                return;
            }
            if (Convert.ToInt32(radNoOfQuestions.Text) != radQuestions.CheckedItems.Count)
            {
                BLL.ShowMessage(this, "No Of Questions and Selected Questions Not matched");
                return;
            }
            SMHR_TRAINING_ONLINEASSESSMENT oSMHR_TRAINING_ONLINEASSESSMENT = new SMHR_TRAINING_ONLINEASSESSMENT();
            oSMHR_TRAINING_ONLINEASSESSMENT.TRAINING_ASSESSMENT_COURSECATEGORY_ID = Convert.ToInt32(rcmb_CC.SelectedValue);
            oSMHR_TRAINING_ONLINEASSESSMENT.TRAINING_ASSESSMENT_COURSE_ID         = Convert.ToInt32(rcmb_CourseName.SelectedValue);
            oSMHR_TRAINING_ONLINEASSESSMENT.TRAINING_ASSESSMENT_COURSESCHEDULE_ID = Convert.ToInt32(rcmb_CourseSchedule.SelectedValue);
            oSMHR_TRAINING_ONLINEASSESSMENT.TRAINING_ASSESSMENT_NAME          = rtxt_AssessmentName.Text;
            oSMHR_TRAINING_ONLINEASSESSMENT.TRAINING_ASSESSMENT_DESC          = rtxt_FeedbackDescription.Text;
            oSMHR_TRAINING_ONLINEASSESSMENT.TRAINING_ASSESSMENT_CHAPTER_ID    = Convert.ToInt32(radChapters.SelectedValue);
            oSMHR_TRAINING_ONLINEASSESSMENT.TRAINING_ASSESSMENT_NOOFQUESTIONS = Convert.ToInt32(radNoOfQuestions.Text);
            oSMHR_TRAINING_ONLINEASSESSMENT.TRAINING_ASSESSMENT_MINMARKS      = Convert.ToInt32(radMarks.Text);
            oSMHR_TRAINING_ONLINEASSESSMENT.TRAINING_ASSESSMENT_TIME          = Convert.ToInt32(radAssessmentTime.Text);
            oSMHR_TRAINING_ONLINEASSESSMENT.TRAINING_ASSESSMENT_STARTDATE     = (DateTime)radStartdate.SelectedDate;
            oSMHR_TRAINING_ONLINEASSESSMENT.TRAINING_ASSESSMENT_STARTTIME     = (DateTime)radStartTime.SelectedDate;
            oSMHR_TRAINING_ONLINEASSESSMENT.TRAINING_ASSESSMENT_ENDDATE       = (DateTime)radEndDate.SelectedDate;
            oSMHR_TRAINING_ONLINEASSESSMENT.TRAINING_ASSESSMENT_ENDTIME       = (DateTime)radEndTime.SelectedDate;
            oSMHR_TRAINING_ONLINEASSESSMENT.TRAINING_ASSESSMENT_QUESTIONS     = GetSelectedQuestions();

            oSMHR_TRAINING_ONLINEASSESSMENT.CREATEDBY       = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
            oSMHR_TRAINING_ONLINEASSESSMENT.CREATEDDATE     = DateTime.Now;
            oSMHR_TRAINING_ONLINEASSESSMENT.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            oSMHR_TRAINING_ONLINEASSESSMENT.LASTMDFBY       = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
            oSMHR_TRAINING_ONLINEASSESSMENT.LASTMDFDATE     = DateTime.Now;
            switch (((Button)sender).ID.ToUpper())
            {
            case "BTN_UPDATE":
                oSMHR_TRAINING_ONLINEASSESSMENT.OPERATION = operation.Update;
                oSMHR_TRAINING_ONLINEASSESSMENT.TRAINING_ASSESSMENT_ID = Convert.ToInt32(lbl_id.Text);
                if (BLL.set_OnlineAssessment(oSMHR_TRAINING_ONLINEASSESSMENT))
                {
                    BLL.ShowMessage(this, "Information Updated Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Saved");
                }
                break;

            case "BTN_SAVE":
                oSMHR_TRAINING_ONLINEASSESSMENT.OPERATION = operation.Check;
                if (Convert.ToString(BLL.get_OnlineAssessment(oSMHR_TRAINING_ONLINEASSESSMENT).Rows[0]["Count"]) != "0")
                {
                    BLL.ShowMessage(this, "Assessment Name with this Name Already Exists");
                    return;
                }
                oSMHR_TRAINING_ONLINEASSESSMENT.OPERATION = operation.Insert;
                if (BLL.set_OnlineAssessment(oSMHR_TRAINING_ONLINEASSESSMENT))
                {
                    BLL.ShowMessage(this, "Information Saved Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Saved");
                }
                break;

            default:
                break;
            }
            Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0;
            LoadGrid();
            Rg_TrgFeedback.DataBind();
            Rg_TrgFeedback.Visible          = true;
            Rp_TRGFEEDABCK_VIEWMAIN.Visible = true;
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingFeedBack", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Пример #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                Session.Remove("WRITEFACILITY");

                SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

                _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
                _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
                _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("Assign Feedback");//ASSIGN FEEDBACK");
                DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
                if (dtformdtls.Rows.Count != 0)
                {
                    if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                    {
                        Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                    }
                }
                else
                {
                    smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                    _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                    SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                    Response.Redirect("~/frm_UnAuthorized.aspx", false);
                }
                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    Rg_TrgFeedback.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                    btn_Save.Visible   = false;
                    btn_Update.Visible = false;
                }
                else if (Convert.ToInt32(Session["WRITEFACILITY"]) == 3)
                {
                    smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                    _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                    SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                    Response.Redirect("~/frm_UnAuthorized.aspx", false);
                }
                LoadGrid();
                Rg_TrgFeedback.DataBind();
                Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0;
                Page.Validate();
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingFeedBack", ex.StackTrace, DateTime.Now);

            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Пример #8
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            if (rlb_Quetions.Items.Count != 0)
            {
                SMHR_TRAININGFEEDBACK _obj_SMHR_TRAININGFEEDBACK_RESPONSE = new SMHR_TRAININGFEEDBACK();
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION         = operation.MODE6;
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_TR_ID    = Convert.ToInt32(rcmb_TRName.SelectedValue);
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_CATEGORY = Convert.ToString(rcmb_Type.SelectedValue);
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_BU_ID    = Convert.ToInt32(rcmb_BU.SelectedValue);
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_ORG_ID   = Convert.ToInt32(Session["ORG_ID"]);
                DataTable dt93 = BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE);


                if (dt93.Rows.Count != 0)
                {
                    BLL.ShowMessage(this, "Already Feedback Assigned For Training");
                    RP_trgfeedback_VIEWDETAILS.Visible = false;
                    Rp_TRGFEEDABCK_VIEWMAIN.Visible    = true;
                    Rm_TRGFEEDABCK_PAGE.SelectedIndex  = 0;

                    LoadGrid();
                    Rg_TrgFeedback.DataBind();
                    Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0;
                }
                else
                {
                    bool res2 = false;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_TR_ID       = Convert.ToInt32(rcmb_TRName.SelectedValue);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_CATEGORY    = Convert.ToString(rcmb_Type.SelectedValue);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_BU_ID       = Convert.ToInt32(rcmb_BU.SelectedValue);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_NAME        = BLL.ReplaceQuote(Convert.ToString(rtxt_FeedbackName.Text));
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_DESCRIPTION = BLL.ReplaceQuote(Convert.ToString(rtxt_FeedbackDescription.Text));
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_STATUS      = 0;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_ORG_ID      = Convert.ToInt32(Session["ORG_ID"]);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE.CREATEDBY            = Convert.ToInt32(Session["USER_ID"]);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE.CREATEDDATE          = DateTime.Now;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_BACKDATE    = Convert.ToInt32(rnt_bakdateddate.Value);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION            = operation.Insert;
                    res2 = BLL.set_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE);
                    Label lblApp = new Label();

                    for (int index = 0; index < RG_FeedBack.Items.Count; index++)
                    {
                        lblApp = RG_FeedBack.Items[index].FindControl("lblAppID") as Label;
                        SMHR_TRGFEEDBACKQUESDTLS _obj_Smhr_TRGFEEDBACKQUESDTLS = new SMHR_TRGFEEDBACKQUESDTLS();
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION         = operation.MODE1;
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_NAME     = BLL.ReplaceQuote(Convert.ToString(rtxt_FeedbackName.Text));
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_ORG_ID   = Convert.ToInt32(Session["ORG_ID"]);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_TR_ID    = Convert.ToInt32(rcmb_TRName.SelectedValue);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_CATEGORY = Convert.ToString(rcmb_Type.SelectedValue);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_BU_ID    = Convert.ToInt32(rcmb_BU.SelectedValue);
                        DataTable dt5 = BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE);



                        _obj_Smhr_TRGFEEDBACKQUESDTLS.TRFDBDTL_FDBID = Convert.ToInt32(dt5.Rows[0]["FEEDBACK_ID"]);



                        _obj_Smhr_TRGFEEDBACKQUESDTLS.TRFDBDTL_QUESTIONSID = Convert.ToInt32(lblApp.Text);
                        _obj_Smhr_TRGFEEDBACKQUESDTLS.Mode = 3;
                        _obj_Smhr_TRGFEEDBACKQUESDTLS.TRFDBDTL_CREATEDBY   = Convert.ToInt32(Session["USER_ID"]);
                        _obj_Smhr_TRGFEEDBACKQUESDTLS.TRFDBDTL_CREATEDDATE = DateTime.Now;
                        bool status = BLL.set_TRGFEEDBAKQUESTDTLS(_obj_Smhr_TRGFEEDBACKQUESDTLS);
                        Session["TR_ID"]    = Convert.ToInt32(rcmb_TRName.SelectedValue);
                        Session["CATEGORY"] = Convert.ToString(rcmb_Type.SelectedValue);
                        Session["BU_ID"]    = Convert.ToInt32(rcmb_BU.SelectedValue);
                        int a = Convert.ToInt32(Session["TR_ID"]);

                        //if (Convert.ToString(BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE).Rows[0]["Count"]) != "0")
                        ////{
                        ////    BLL.ShowMessage(this, "Trainig FeedBack Already Saved Successfully");
                        ////    return;
                        ////}
                        ////else
                        ////{
                        //    //_obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION = operation.Insert;
                        //    //res2 = BLL.set_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE);
                        ////}
                    }
                    if (res2 == true)
                    {
                        BLL.ShowMessage(this, "Training FeedBack Saved Successfully");
                        rlb_Quetions.Enabled = false;
                        btn_Preview.Visible  = true;
                        //btn_Finalize.Visible = true;
                        btn_Save.Visible                   = false;
                        rcmb_Type.Enabled                  = false;
                        rcmb_BU.Enabled                    = false;
                        rcmb_TRName.Enabled                = false;
                        rtxt_FeedbackDescription.Text      = string.Empty;
                        rtxt_FeedbackName.Enabled          = false;
                        RP_trgfeedback_VIEWDETAILS.Visible = false;
                        Rp_TRGFEEDABCK_VIEWMAIN.Visible    = true;
                        Rm_TRGFEEDABCK_PAGE.SelectedIndex  = 0;

                        LoadGrid();
                        Rg_TrgFeedback.DataBind();
                        Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0;



                        //assign feedback to trainer of that trg
                        if (rcmb_Type.SelectedItem.Text == "Trainer")
                        {
                            SMHR_ASSIGNFEEDBACK_EMPLOYEE _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE = new SMHR_ASSIGNFEEDBACK_EMPLOYEE();


                            _obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION         = operation.MODE1;
                            _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_ORG_ID   = Convert.ToInt32(Session["ORG_ID"]);
                            _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_NAME     = BLL.ReplaceQuote(Convert.ToString(rtxt_FeedbackName.Text));
                            _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_BU_ID    = Convert.ToInt32(rcmb_BU.SelectedItem.Value);
                            _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_TR_ID    = Convert.ToInt32(rcmb_TRName.SelectedItem.Value);
                            _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_CATEGORY = Convert.ToString(rcmb_Type.SelectedItem.Text);

                            DataTable dt5 = BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE);



                            SMHR_TRAINER _obj_Smhr_Trner = new SMHR_TRAINER();
                            _obj_Smhr_Trner.Mode = 5;
                            _obj_Smhr_Trner.TRAINERDETAILS_TR_ID = Convert.ToInt32(rcmb_TRName.SelectedItem.Value);
                            DataTable dt1 = BLL.get_TRAINer(_obj_Smhr_Trner);


                            _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.Mode = 2;
                            _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGNFEED_FEEBAK_ID = Convert.ToInt32(dt5.Rows[0]["FEEDBACK_ID"]);
                            //if trg is external then inplace of trainer we are passing hr employeeid
                            if (dt1.Rows.Count != 0)
                            {
                                _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = Convert.ToInt32(dt1.Rows[0]["TRAINERDETAILS_EMPLOYEEID"]);
                            }
                            else
                            {//IF TRAINER EXTERNAL WE HAVE TO GIVE HR ID
                                _obj_Smhr_TrgRqst           = new SMHR_TRAININGREQUEST();
                                _obj_Smhr_TrgRqst.Mode      = 21;
                                _obj_Smhr_TrgRqst.TR_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
                                DataTable DT45 = BLL.get_TrgRqst(_obj_Smhr_TrgRqst);
                                if (DT45.Rows.Count != 0)
                                {
                                    _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = 0;
                                }

                                else
                                {
                                    _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = 0;
                                }
                            }

                            DataTable dt2 = BLL.get__SMHR_ASSIGNFEEDBACK_EMPLOYEE(_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE);
                            if (dt2.Rows.Count != 0)
                            {
                                BLL.ShowMessage(this, "Tarining Already Assigned To Employee");
                                return;
                            }
                            else
                            {
                                _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE      = new SMHR_ASSIGNFEEDBACK_EMPLOYEE();
                                _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.Mode = 3;
                                _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGNFEED_FEEBAK_ID = Convert.ToInt32(dt5.Rows[0]["FEEDBACK_ID"]);
                                if (dt1.Rows.Count != 0)
                                {
                                    _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = Convert.ToInt32(dt1.Rows[0]["TRAINERDETAILS_EMPLOYEEID"]);
                                }

                                else
                                {
                                    _obj_Smhr_TrgRqst           = new SMHR_TRAININGREQUEST();
                                    _obj_Smhr_TrgRqst.Mode      = 21;
                                    _obj_Smhr_TrgRqst.TR_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
                                    DataTable DT455 = BLL.get_TrgRqst(_obj_Smhr_TrgRqst);
                                    if (DT455.Rows.Count != 0)
                                    {
                                        _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = 0;
                                    }

                                    else
                                    {
                                        _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID = 0;
                                    }
                                }
                                _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_CREATEDBY   = Convert.ToInt32(Session["USER_ID"]);
                                _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_CREATEDDATE = DateTime.Now;
                                bool status = BLL.set_SMHR_ASSIGNFEEDBACK_EMPLOYEE(_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE);
                                if (status == true)
                                {
                                    BLL.ShowMessage(this, "Feedback Assigned Successfully");

                                    RP_trgfeedback_VIEWDETAILS.Visible = false;
                                    Rp_TRGFEEDABCK_VIEWMAIN.Visible    = true;
                                    Rm_TRGFEEDABCK_PAGE.SelectedIndex  = 0;

                                    LoadGrid();
                                    Rg_TrgFeedback.DataBind();
                                    Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0;
                                }
                            }
                        }
                        else if (rcmb_Type.SelectedItem.Text == "Trainee")
                        {
                            _obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION         = operation.MODE1;
                            _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_ORG_ID   = Convert.ToInt32(Session["ORG_ID"]);
                            _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_NAME     = BLL.ReplaceQuote(Convert.ToString(rtxt_FeedbackName.Text));
                            _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_BU_ID    = Convert.ToInt32(rcmb_BU.SelectedItem.Value);
                            _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_TR_ID    = Convert.ToInt32(rcmb_TRName.SelectedItem.Value);
                            _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_CATEGORY = Convert.ToString(rcmb_Type.SelectedItem.Text);

                            DataTable dt55 = BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE);

                            SMHR_ASSIGNFEEDBACK_EMPLOYEE _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE = new SMHR_ASSIGNFEEDBACK_EMPLOYEE();

                            _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.Mode = 6;
                            //_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGNFEED_FEEBAK_ID = Convert.ToInt32(lbl_id.Text);
                            _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGNFEED_FEEBAK_ID = Convert.ToInt32(dt55.Rows[0]["FEEDBACK_ID"]);

                            DataTable dttrnee = BLL.get__SMHR_ASSIGNFEEDBACK_EMPLOYEE(_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE);

                            if (dttrnee.Rows.Count != 0)
                            {
                                BLL.ShowMessage(this, "Training Already Assigned To Trainee");
                            }
                            else
                            {
                                SMHR_TRAINEE _obj_Smhr_TrnEE = new SMHR_TRAINEE();
                                _obj_Smhr_TrnEE.Mode           = 5;
                                _obj_Smhr_TrnEE.TRAINEE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
                                _obj_Smhr_TrnEE.TRAINEE_TR_ID  = Convert.ToInt32(rcmb_TRName.SelectedItem.Value);
                                DataTable dtemp = BLL.get_TRAINEE(_obj_Smhr_TrnEE);
                                //  for (int i = 0; i <= dtemp.Rows.Count ; i++)
                                //  {
                                foreach (DataRow item in dtemp.Rows)
                                {
                                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE.OPERATION         = operation.MODE1;
                                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_BU_ID    = Convert.ToInt32(rcmb_BU.SelectedItem.Value);
                                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_TR_ID    = Convert.ToInt32(rcmb_TRName.SelectedItem.Value);
                                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_CATEGORY = Convert.ToString(rcmb_Type.SelectedItem.Text);
                                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_NAME     = BLL.ReplaceQuote(Convert.ToString(rtxt_FeedbackName.Text));
                                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE.FEEDBACK_ORG_ID   = Convert.ToInt32(Session["ORG_ID"]);
                                    DataTable dt5 = BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE);

                                    _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE      = new SMHR_ASSIGNFEEDBACK_EMPLOYEE();
                                    _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.Mode = 3;

                                    _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGNFEED_FEEBAK_ID = Convert.ToInt32(dt5.Rows[0]["FEEDBACK_ID"]);
                                    _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_EMP_ID        = Convert.ToInt32(item["TRAINEE_EMPID"]);
                                    _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_CREATEDBY     = Convert.ToInt32(Session["USER_ID"]);
                                    _obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE.ASSIGN_CREATEDDATE   = DateTime.Now;
                                    bool status = BLL.set_SMHR_ASSIGNFEEDBACK_EMPLOYEE(_obj_SMHR_ASSIGNFEEDBACK_EMPLOYEE);
                                    if (status == true)
                                    {
                                        //LoadGrid();
                                        //Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0;
                                    }
                                    //BLL.ShowMessage(this, "Feedback Assigned Successfully");
                                    BLL.ShowMessage(this, "Feedback Assigned Successfully");
                                    RP_trgfeedback_VIEWDETAILS.Visible = false;
                                    Rp_TRGFEEDABCK_VIEWMAIN.Visible    = true;
                                    Rm_TRGFEEDABCK_PAGE.SelectedIndex  = 0;

                                    LoadGrid();
                                    Rg_TrgFeedback.DataBind();
                                    Rm_TRGFEEDABCK_PAGE.SelectedIndex = 0;
                                }
                            }
                        }

                        return;
                    }
                    else
                    {
                        BLL.ShowMessage(this, "Please Check Feedback Question");
                        return;
                    }
                }
            }


            else
            {
                BLL.ShowMessage(this, "Please Check Feedback Question");
                return;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingFeedBack", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }