protected void DisplayAssessmentsForMember() { AssessmentList alist = new AssessmentList(); List<Assessment> obj = alist.GetAssessmentsForMember(mInfo.ID, CurrentUserID); lvMemberAssessments.DataSource = obj; lvMemberAssessments.DataBind(); }
protected void SearchAssessments() { List<Assessment> lst = new List<Assessment>(); AssessmentList obj = new AssessmentList(); lst = obj.GetAssessments(txtAssessmentName.Text, ddlAssessGroup.SelectedIndex == 0 ? "" : ddlAssessGroup.SelectedValue, txtEffectiveFrom.Text, txtEffectiveTo.Text, 'A', mCurrentUserID); lvAssessments.DataSource = lst; lvAssessments.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["ID"] != null) { AssessmentId = Convert.ToInt32(Request.QueryString["ID"]); } if (!IsPostBack) { //List<QuestionGroup> lst = new List<QuestionGroup>(); //QuestionGroupList obj = new QuestionGroupList(); //lst = obj.GetQuestionGroups("", 'A'); //ddlAssessGroup.DataSource = lst; //ddlAssessGroup.DataTextField = "Name"; //ddlAssessGroup.DataValueField = "ID"; //ddlAssessGroup.DataBind(); //ddlAssessGroup.Items.Insert(0, new ListItem("-- Select One --", "")); if (AssessmentId > 0) { //Populate the data for the QuestionId AssessmentList obj1 = new AssessmentList(); Assessment aObj = obj1.GetAssessmentsById(CurrentUserId, AssessmentId); if (obj1 != null) { PopulateData(aObj); } } GetAssessmentGroups(); } }
protected void UpdateQuestions(List<Question> lst) { //code to save in database //create the display order depending on the no of questions already added for this Assessment. //if not start from 1 //int QCount = 1; //if (lvSelectedQ.Items.Count > 0) //{ // QCount = lvSelectedQ.Items.Count + 1; //} string QuestionIds = ""; string DisplayOrder = ""; for (int i = 0; i < lst.Count; i++) { if (QuestionIds == "") { QuestionIds = lst[i].ID.ToString(); DisplayOrder = lst[i].DisplayOrder.ToString(); } else { QuestionIds += "," + lst[i].ID.ToString(); DisplayOrder += "," + lst[i].DisplayOrder.ToString(); } } AssessmentList assList = new AssessmentList(); List<Question> qLst = assList.SaveQuestions(objAssessment.ID, Convert.ToInt32(lst[0].QGroupId_Ref), QuestionIds, DisplayOrder, 1); //------------------------------------ if (qLst.Count > 0) { DisplayData(qLst); Session["SelectedList"] = qLst; } else { DisplayData(null); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["objAssessment"] != null) { objAssessment = (Assessment)Session["objAssessment"]; lblName.Text = objAssessment.Name; lblGroupName.Text = objAssessment.AssessmentGroupName; lblEffectiveFrom.Text = objAssessment.EffectiveFrom.ToString("MM/dd/yyyy"); lblEffectiveTo.Text = objAssessment.EffectiveTo.ToString("MM/dd/yyyy"); } if (!IsPostBack) { //populate QuestionGroups PopulateGroups(); AssessmentList lstObj = new AssessmentList(); lstQuestions = lstObj.GetAssessmentQuestions(objAssessment.ID, 1); if (lstQuestions.Count > 0) { DisplayData(lstQuestions); Session["SelectedList"] = lstQuestions; lnkPreview.Visible = true; } else { lnkPreview.Visible = false; Session["SelectedList"] = null; } } }
protected void lvSelectedQ_OnItemCommand(object sender, ListViewCommandEventArgs e) { if (String.Equals(e.CommandName, "Remove")) { AssessmentList obj = new AssessmentList(); ListViewDataItem dataItem = (ListViewDataItem)e.Item; string Qid = lvSelectedQ.DataKeys[dataItem.DisplayIndex]["ID"].ToString(); string QGid = lvSelectedQ.DataKeys[dataItem.DisplayIndex]["QGroupId_Ref"].ToString(); lstSelectedQuestions = obj.DeleteQuestions(objAssessment.ID, Convert.ToInt32(QGid), Convert.ToInt32(Qid), 1); //Bind returned data DisplayData(lstSelectedQuestions); } }