コード例 #1
0
    public void LoadGrid()
    {
        try
        {
            if (Convert.ToString(Session["LOGIN_TYPE"]) == "ADMIN-DEPT")
            {
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE1           = new SMHR_TRAININGFEEDBACK_RESPONSE();
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.OPERATION = operation.Select;
                DataTable dt = BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE1);
                Rg_Feedbackrespns.DataSource = dt;
                lbl_Status.Visible           = true;
                rcmb_Status.Visible          = true;
                lbl_StatusColumn.Visible     = true;
            }
            else
            {
                //_obj_SMHR_TRAININGFEEDBACK_RESPONSE = new SMHR_TRAININGFEEDBACK_RESPONSE();

                _obj_SMHR_TRAININGFEEDBACK_RESPONSE1                     = new SMHR_TRAININGFEEDBACK_RESPONSE();
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.OPERATION           = operation.Start;
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_USER_ID = Convert.ToInt32(Session["USER_ID"]);
                DataTable dt = BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE1);
                Rg_Feedbackrespns.DataSource = dt;
                //lbl_Status.Visible = false;
                //rcmb_Status.Visible = false;
                //lbl_StatusColumn.Visible = false;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingResponse", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
コード例 #2
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        bool status = false;

        try
        {
            for (int i = 0; i <= ReptFeedBack_Admin.Items.Count - 1; i++)
            {
                RadioButtonList rdb = ReptFeedBack_Admin.Items[i].FindControl("rdbTest") as RadioButtonList;
                if (rdb.SelectedIndex == -1)
                {
                    BLL.ShowMessage(this, "Please Select the Feedback for all Questions.");
                    return;
                }
            }
            for (int i = 0; i <= ReptFeedBack_Course.Items.Count - 1; i++)
            {
                RadioButtonList rdb = ReptFeedBack_Course.Items[i].FindControl("rdbTest") as RadioButtonList;
                if (rdb.SelectedIndex == -1)
                {
                    BLL.ShowMessage(this, "Please Select the Feedback for all Questions.");
                    return;
                }
            }
            for (int i = 0; i <= ReptFeedBack_Couseller.Items.Count - 1; i++)
            {
                RadioButtonList rdb = ReptFeedBack_Couseller.Items[i].FindControl("rdbTest") as RadioButtonList;
                if (rdb.SelectedIndex == -1)
                {
                    BLL.ShowMessage(this, "Please Select the Feedback for all Questions.");
                    return;
                }
            }
            for (int j = 0; j <= ReptFeedBack_AllTrainer.Items.Count - 1; j++)
            {
                Repeater repttrainer = ReptFeedBack_AllTrainer.Items[j].FindControl("ReptFeedBack_Trainer") as Repeater;
                for (int i = 0; i <= repttrainer.Items.Count - 1; i++)
                {
                    RadioButtonList rdb = repttrainer.Items[i].FindControl("rdbTest") as RadioButtonList;
                    if (rdb.SelectedIndex == -1)
                    {
                        BLL.ShowMessage(this, "Please Select the Feedback for all Questions.");
                        return;
                    }
                }
            }
            Label lblID = new Label();
            if (_lbl_id.Text == string.Empty)
            {
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE1 = new SMHR_TRAININGFEEDBACK_RESPONSE();
                DataTable DT1 = new DataTable();
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.OPERATION           = operation.Check;
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_TR_ID   = Convert.ToInt32(rcmb_ScheduleName.SelectedValue);
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_USER_ID = Convert.ToInt32(Session["USER_ID"]);
                if (BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE1).Rows.Count != 0)
                {
                    BLL.ShowMessage(this, "Already FeedBack is given for this Traininig.");
                    return;
                }


                int       FeedBackNo;
                DataTable DT = new DataTable();
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.OPERATION = operation.Empty;
                DT = (BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE1));
                if ((DT.Rows[0]["FEEDBACK_NO"] == null) || (Convert.ToString(DT.Rows[0]["FEEDBACK_NO"]) == ""))
                {
                    FeedBackNo = 1;
                }
                else
                {
                    FeedBackNo = Convert.ToInt32(DT.Rows[0]["FEEDBACK_NO"]);
                }

                _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.OPERATION = operation.Insert;
                for (int i = 0; i <= ReptFeedBack_Admin.Items.Count - 1; i++)
                {
                    RadioButtonList rdb           = ReptFeedBack_Admin.Items[i].FindControl("rdbTest") as RadioButtonList;
                    Label           lblFeedQuesID = ReptFeedBack_Admin.Items[i].FindControl("lblFeedQuesID") as Label;

                    lblID = ReptFeedBack_Admin.Items[i].FindControl("lblFeedQuesID") as Label;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_USER_ID           = Convert.ToInt32(Session["USER_ID"]);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_FEEDBACKQUESTS_ID = Convert.ToInt32(lblFeedQuesID.Text);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_RESPONSE          = rdb.SelectedValue;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_COMMENTS          = BLL.ReplaceQuote(Convert.ToString(rtxt_Feedbackresponse.Text));
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_STATUS            = Convert.ToString(rcmb_Status.SelectedValue);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_TR_ID             = Convert.ToInt32(rcmb_ScheduleName.SelectedValue);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_DATE        = DateTime.Now;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEBBACKRES_FEEDBACK_NO = Convert.ToInt32(FeedBackNo);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.CREATEDBY   = Convert.ToInt32(Session["USER_ID"]);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.CREATEDDATE = DateTime.Now;
                    if (BLL.set_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE1))
                    {
                        status = true;
                    }
                    else
                    {
                        status = false;
                    }
                }
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.OPERATION = operation.Insert;
                for (int i = 0; i <= ReptFeedBack_Course.Items.Count - 1; i++)
                {
                    RadioButtonList rdb           = ReptFeedBack_Course.Items[i].FindControl("rdbTest") as RadioButtonList;
                    Label           lblFeedQuesID = ReptFeedBack_Course.Items[i].FindControl("lblFeedQuesID") as Label;

                    lblID = ReptFeedBack_Course.Items[i].FindControl("lblFeedQuesID") as Label;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_USER_ID           = Convert.ToInt32(Session["USER_ID"]);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_FEEDBACKQUESTS_ID = Convert.ToInt32(lblFeedQuesID.Text);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_RESPONSE          = rdb.SelectedValue;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_COMMENTS          = BLL.ReplaceQuote(Convert.ToString(rtxt_Feedbackresponse.Text));
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_STATUS            = Convert.ToString(rcmb_Status.SelectedValue);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_TR_ID             = Convert.ToInt32(rcmb_ScheduleName.SelectedValue);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_DATE        = DateTime.Now;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEBBACKRES_FEEDBACK_NO = Convert.ToInt32(FeedBackNo);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.CREATEDBY   = Convert.ToInt32(Session["USER_ID"]);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.CREATEDDATE = DateTime.Now;
                    if (BLL.set_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE1))
                    {
                        status = true;
                    }
                    else
                    {
                        status = false;
                    }
                }
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.OPERATION = operation.Insert;
                for (int i = 0; i <= ReptFeedBack_Couseller.Items.Count - 1; i++)
                {
                    RadioButtonList rdb           = ReptFeedBack_Couseller.Items[i].FindControl("rdbTest") as RadioButtonList;
                    Label           lblFeedQuesID = ReptFeedBack_Couseller.Items[i].FindControl("lblFeedQuesID") as Label;

                    lblID = ReptFeedBack_Couseller.Items[i].FindControl("lblFeedQuesID") as Label;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_USER_ID           = Convert.ToInt32(Session["USER_ID"]);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_FEEDBACKQUESTS_ID = Convert.ToInt32(lblFeedQuesID.Text);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_RESPONSE          = rdb.SelectedValue;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_COMMENTS          = BLL.ReplaceQuote(Convert.ToString(rtxt_Feedbackresponse.Text));
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_STATUS            = Convert.ToString(rcmb_Status.SelectedValue);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_TR_ID             = Convert.ToInt32(rcmb_ScheduleName.SelectedValue);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_DATE        = DateTime.Now;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEBBACKRES_FEEDBACK_NO = Convert.ToInt32(FeedBackNo);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.CREATEDBY   = Convert.ToInt32(Session["USER_ID"]);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.CREATEDDATE = DateTime.Now;
                    if (BLL.set_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE1))
                    {
                        status = true;
                    }
                    else
                    {
                        status = false;
                    }
                }

                for (int j = 0; j <= ReptFeedBack_AllTrainer.Items.Count - 1; j++)
                {
                    Repeater repttrainer      = ReptFeedBack_AllTrainer.Items[j].FindControl("ReptFeedBack_Trainer") as Repeater;
                    Label    lblFeedTrainerID = ReptFeedBack_AllTrainer.Items[j].FindControl("lbl_TrainerID") as Label;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.OPERATION = operation.Insert;
                    for (int i = 0; i <= repttrainer.Items.Count - 1; i++)
                    {
                        RadioButtonList rdb           = repttrainer.Items[i].FindControl("rdbTest") as RadioButtonList;
                        Label           lblFeedQuesID = repttrainer.Items[i].FindControl("lblFeedQuesID") as Label;

                        lblID = repttrainer.Items[i].FindControl("lblFeedQuesID") as Label;
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_USER_ID           = Convert.ToInt32(Session["USER_ID"]);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_FEEDBACKQUESTS_ID = Convert.ToInt32(lblFeedQuesID.Text);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_RESPONSE          = rdb.SelectedValue;
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_COMMENTS          = BLL.ReplaceQuote(Convert.ToString(rtxt_Feedbackresponse.Text));
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_STATUS            = Convert.ToString(rcmb_Status.SelectedValue);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_TR_ID             = Convert.ToInt32(rcmb_ScheduleName.SelectedValue);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_TRAINER_ID        = Convert.ToInt32(lblFeedTrainerID.Text);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_DATE        = DateTime.Now;
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEBBACKRES_FEEDBACK_NO = Convert.ToInt32(FeedBackNo);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.CREATEDBY   = Convert.ToInt32(Session["USER_ID"]);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.CREATEDDATE = DateTime.Now;
                        if (BLL.set_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE1))
                        {
                            status = true;
                        }
                        else
                        {
                            status = false;
                        }
                    }
                }
            }
            else
            {
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE1           = new SMHR_TRAININGFEEDBACK_RESPONSE();
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.OPERATION = operation.Update;
                _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEBBACKRES_FEEDBACK_NO = Convert.ToInt32(_lbl_id.Text);
                for (int i = 0; i <= ReptFeedBack_Admin.Items.Count - 1; i++)
                {
                    RadioButtonList rdb           = ReptFeedBack_Admin.Items[i].FindControl("rdbTest") as RadioButtonList;
                    Label           lblFeedQuesID = ReptFeedBack_Admin.Items[i].FindControl("lblFeedQuesID") as Label;

                    lblID = ReptFeedBack_Admin.Items[i].FindControl("lblFeedQuesID") as Label;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_USER_ID           = Convert.ToInt32(Session["USER_ID"]);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_FEEDBACKQUESTS_ID = Convert.ToInt32(lblFeedQuesID.Text);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_RESPONSE          = rdb.SelectedValue;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_COMMENTS          = BLL.ReplaceQuote(Convert.ToString(rtxt_Feedbackresponse.Text));
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_STATUS            = Convert.ToString(rcmb_Status.SelectedValue);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_TR_ID             = Convert.ToInt32(rcmb_ScheduleName.SelectedValue);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.LASTMDFBY   = Convert.ToInt32(Session["USER_ID"]);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.LASTMDFDATE = DateTime.Now;
                    if (BLL.set_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE1))
                    {
                        status = true;
                    }
                    else
                    {
                        status = false;
                    }
                }

                for (int i = 0; i <= ReptFeedBack_Course.Items.Count - 1; i++)
                {
                    RadioButtonList rdb           = ReptFeedBack_Course.Items[i].FindControl("rdbTest") as RadioButtonList;
                    Label           lblFeedQuesID = ReptFeedBack_Course.Items[i].FindControl("lblFeedQuesID") as Label;

                    lblID = ReptFeedBack_Course.Items[i].FindControl("lblFeedQuesID") as Label;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_USER_ID           = Convert.ToInt32(Session["USER_ID"]);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_FEEDBACKQUESTS_ID = Convert.ToInt32(lblFeedQuesID.Text);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_RESPONSE          = rdb.SelectedValue;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_COMMENTS          = BLL.ReplaceQuote(Convert.ToString(rtxt_Feedbackresponse.Text));
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_STATUS            = Convert.ToString(rcmb_Status.SelectedValue);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_TR_ID             = Convert.ToInt32(rcmb_ScheduleName.SelectedValue);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.LASTMDFBY   = Convert.ToInt32(Session["USER_ID"]);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.LASTMDFDATE = DateTime.Now;
                    if (BLL.set_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE1))
                    {
                        status = true;
                    }
                    else
                    {
                        status = false;
                    }
                }

                for (int i = 0; i <= ReptFeedBack_Couseller.Items.Count - 1; i++)
                {
                    RadioButtonList rdb           = ReptFeedBack_Couseller.Items[i].FindControl("rdbTest") as RadioButtonList;
                    Label           lblFeedQuesID = ReptFeedBack_Couseller.Items[i].FindControl("lblFeedQuesID") as Label;

                    lblID = ReptFeedBack_Couseller.Items[i].FindControl("lblFeedQuesID") as Label;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_USER_ID           = Convert.ToInt32(Session["USER_ID"]);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_FEEDBACKQUESTS_ID = Convert.ToInt32(lblFeedQuesID.Text);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_RESPONSE          = rdb.SelectedValue;
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_COMMENTS          = BLL.ReplaceQuote(Convert.ToString(rtxt_Feedbackresponse.Text));
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_STATUS            = Convert.ToString(rcmb_Status.SelectedValue);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_TR_ID             = Convert.ToInt32(rcmb_ScheduleName.SelectedValue);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.LASTMDFBY   = Convert.ToInt32(Session["USER_ID"]);
                    _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.LASTMDFDATE = DateTime.Now;
                    if (BLL.set_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE1))
                    {
                        status = true;
                    }
                    else
                    {
                        status = false;
                    }
                }
                for (int j = 0; j <= ReptFeedBack_AllTrainer.Items.Count - 1; j++)
                {
                    Repeater repttrainer      = ReptFeedBack_AllTrainer.Items[j].FindControl("ReptFeedBack_Trainer") as Repeater;
                    Label    lblFeedTrainerID = ReptFeedBack_AllTrainer.Items[j].FindControl("lbl_TrainerID") as Label;
                    for (int i = 0; i <= repttrainer.Items.Count - 1; i++)
                    {
                        RadioButtonList rdb           = repttrainer.Items[i].FindControl("rdbTest") as RadioButtonList;
                        Label           lblFeedQuesID = repttrainer.Items[i].FindControl("lblFeedQuesID") as Label;

                        lblID = repttrainer.Items[i].FindControl("lblFeedQuesID") as Label;
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_USER_ID           = Convert.ToInt32(Session["USER_ID"]);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_FEEDBACKQUESTS_ID = Convert.ToInt32(lblFeedQuesID.Text);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_RESPONSE          = rdb.SelectedValue;
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_COMMENTS          = BLL.ReplaceQuote(Convert.ToString(rtxt_Feedbackresponse.Text));
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_STATUS            = Convert.ToString(rcmb_Status.SelectedValue);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_TRAINER_ID        = Convert.ToInt32(lblFeedTrainerID.Text);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_TR_ID             = Convert.ToInt32(rcmb_ScheduleName.SelectedValue);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.LASTMDFBY   = Convert.ToInt32(Session["USER_ID"]);
                        _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.LASTMDFDATE = DateTime.Now;
                        if (BLL.set_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE1))
                        {
                            status = true;
                        }
                        else
                        {
                            status = false;
                        }
                    }
                }
            }
            if (status)
            {
                BLL.ShowMessage(this, "FeedBack Details have been saved");
            }
            else
            {
                BLL.ShowMessage(this, "FeedBack Details not saved");
            }
            Rm_Feedbackrespns_Page.SelectedIndex = 0;
            LoadGrid();
            Rg_Feedbackrespns.DataBind();
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingResponse", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
コード例 #3
0
    protected void lnk_Edit_Command(object sender, CommandEventArgs e)
    {
        try
        {
            _lbl_id.Text = Convert.ToString(e.CommandArgument);
            loadDropDown();
            _obj_SMHR_TRAININGFEEDBACK_RESPONSE1 = new SMHR_TRAININGFEEDBACK_RESPONSE();

            displayOptions();

            if (Convert.ToString(Session["LOGIN_TYPE"]) == "ADMIN-DEPT")
            {
                btn_Update.Visible = true;
                btn_Cancel.Visible = true;
            }
            else
            {
                btn_Update.Visible = true;
                btn_Cancel.Visible = true;
            }

            DataTable dt = new DataTable();
            _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.OPERATION = operation.Check;
            _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEBBACKRES_FEEDBACK_NO = Convert.ToInt32(_lbl_id.Text);
            _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_TR_ID       = 0;
            _obj_SMHR_TRAININGFEEDBACK_RESPONSE1.FEEDBACKRES_USER_ID     = 0;
            dt = (BLL.get_FeedbackResponse(_obj_SMHR_TRAININGFEEDBACK_RESPONSE1));
            rcmb_ScheduleName.SelectedIndex = rcmb_ScheduleName.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["FEEDBACKRES_TR_ID"]));
            LoadTrainers();
            rcmb_Status.SelectedIndex  = rcmb_Status.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["FEEDBACKRES_STATUS"]));
            rtxt_Feedbackresponse.Text = Convert.ToString((dt.Rows[0]["FEEDBACKRES_COMMENTS"]));
            for (int i = 0; i <= ReptFeedBack_Admin.Items.Count - 1; i++)
            {
                Label           lblQuesID = ReptFeedBack_Admin.Items[i].FindControl("lblFeedQuesID") as Label;
                RadioButtonList rdb       = ReptFeedBack_Admin.Items[i].FindControl("rdbTest") as RadioButtonList;
                string          strExp    = "FEEDBACKRES_FEEDBACKQUESTS_ID = '" + lblQuesID.Text + "'";
                DataRow[]       drRows    = dt.Select(strExp);
                if (drRows.Length > 0)
                {
                    switch (drRows[0]["FEEDBACKRES_RESPONSE"].ToString())
                    {
                    case "1":
                        rdb.Items[0].Selected = true;
                        break;

                    case "2":
                        rdb.Items[1].Selected = true;
                        break;

                    case "3":
                        rdb.Items[2].Selected = true;
                        break;

                    case "4":
                        rdb.Items[3].Selected = true;
                        break;

                    case "5":
                        rdb.Items[4].Selected = true;
                        break;

                    default:
                        break;
                    }
                }
            }

            for (int i = 0; i <= ReptFeedBack_Course.Items.Count - 1; i++)
            {
                Label           lblQuesID = ReptFeedBack_Course.Items[i].FindControl("lblFeedQuesID") as Label;
                RadioButtonList rdb       = ReptFeedBack_Course.Items[i].FindControl("rdbTest") as RadioButtonList;
                string          strExp    = "FEEDBACKRES_FEEDBACKQUESTS_ID = '" + lblQuesID.Text + "'";
                DataRow[]       drRows    = dt.Select(strExp);
                if (drRows.Length > 0)
                {
                    switch (drRows[0]["FEEDBACKRES_RESPONSE"].ToString())
                    {
                    case "1":
                        rdb.Items[0].Selected = true;
                        break;

                    case "2":
                        rdb.Items[1].Selected = true;
                        break;

                    case "3":
                        rdb.Items[2].Selected = true;
                        break;

                    case "4":
                        rdb.Items[3].Selected = true;
                        break;

                    case "5":
                        rdb.Items[4].Selected = true;
                        break;

                    default:
                        break;
                    }
                }
            }

            for (int i = 0; i <= ReptFeedBack_Couseller.Items.Count - 1; i++)
            {
                Label           lblQuesID = ReptFeedBack_Couseller.Items[i].FindControl("lblFeedQuesID") as Label;
                RadioButtonList rdb       = ReptFeedBack_Couseller.Items[i].FindControl("rdbTest") as RadioButtonList;
                string          strExp    = "FEEDBACKRES_FEEDBACKQUESTS_ID = '" + lblQuesID.Text + "'";
                DataRow[]       drRows    = dt.Select(strExp);
                if (drRows.Length > 0)
                {
                    switch (drRows[0]["FEEDBACKRES_RESPONSE"].ToString())
                    {
                    case "1":
                        rdb.Items[0].Selected = true;
                        break;

                    case "2":
                        rdb.Items[1].Selected = true;
                        break;

                    case "3":
                        rdb.Items[2].Selected = true;
                        break;

                    case "4":
                        rdb.Items[3].Selected = true;
                        break;

                    case "5":
                        rdb.Items[4].Selected = true;
                        break;

                    default:
                        break;
                    }
                }
            }

            for (int j = 0; j <= ReptFeedBack_AllTrainer.Items.Count - 1; j++)
            {
                Repeater repttrainer      = ReptFeedBack_AllTrainer.Items[j].FindControl("ReptFeedBack_Trainer") as Repeater;
                Label    lblFeedTrainerID = ReptFeedBack_AllTrainer.Items[j].FindControl("lbl_TrainerID") as Label;

                for (int i = 0; i <= repttrainer.Items.Count - 1; i++)
                {
                    Label           lblQuesID = repttrainer.Items[i].FindControl("lblFeedQuesID") as Label;
                    RadioButtonList rdb       = repttrainer.Items[i].FindControl("rdbTest") as RadioButtonList;
                    string          strExp    = "FEEDBACKRES_FEEDBACKQUESTS_ID = '" + lblQuesID.Text + "' and FEEDBACKRES_TRAINER_ID = '" + lblFeedTrainerID.Text + "'";
                    DataRow[]       drRows    = dt.Select(strExp);
                    if (drRows.Length > 0)
                    {
                        switch (drRows[0]["FEEDBACKRES_RESPONSE"].ToString())
                        {
                        case "1":
                            rdb.Items[0].Selected = true;
                            break;

                        case "2":
                            rdb.Items[1].Selected = true;
                            break;

                        case "3":
                            rdb.Items[2].Selected = true;
                            break;

                        case "4":
                            rdb.Items[3].Selected = true;
                            break;

                        case "5":
                            rdb.Items[4].Selected = true;
                            break;

                        default:
                            break;
                        }
                    }
                }
            }
            //if (Convert.ToString(Session["LOGIN_TYPE"]) == "ADMIN")
            //{
            //    ReptFeedBack_Admin.Visible = false;
            //    ReptFeedBack_Course.Visible = false;
            //    ReptFeedBack_Couseller.Visible = false;
            //    ReptFeedBack_AllTrainer.Visible = false;
            //    lbl_Feedbackresponse.Visible = false;
            //    rtxt_Feedbackresponse.Visible = false;
            //}
            btn_Save.Visible                     = false;
            rcmb_ScheduleName.Enabled            = false;
            Rm_Feedbackrespns_Page.SelectedIndex = 1;
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_TrainingResponse", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }