public void clearControls() { try{ rtxt_Feedbackresponse.Text = ""; 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"); } }
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"); } }