public static void GetSectionAll(Model_AsSection parameters) { IList <Model_AsSection> ret = AssessmentController.GetSectionList(); AppTools.SendResponse(HttpContext.Current.Response, ret.ObjectToJSON()); }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { List <Model_AsSection> sec = AssessmentController.GetSectionList(true); dropSection.DataSource = sec; dropSection.DataTextField = "Title"; dropSection.DataValueField = "SCID"; dropSection.DataBind(); dropsecs.DataSource = sec; dropsecs.DataTextField = "Title"; dropsecs.DataValueField = "SCID"; dropsecs.DataBind(); dropQType.DataSource = AssessmentController.GetQTypeAllByStatus(true); dropQType.DataTextField = "Title"; dropQType.DataValueField = "QTID"; dropQType.DataBind(); Model_AsSection secs = AssessmentController.getSectionByID(int.Parse(dropSection.SelectedValue)); //txtCode.Text = secs.Code.ToString(); Model_AsSubSection ss = new Model_AsSubSection { SCID = int.Parse(dropSection.SelectedValue) }; Model_AsSubSection2 ss2 = new Model_AsSubSection2 { SCID = int.Parse(dropSection.SelectedValue) }; List <Model_AsSubSection> sub = AssessmentController.getSubsectionBySecId(ss); dropsub.DataSource = sub; dropsub.DataTextField = "Title"; dropsub.DataValueField = "SUCID"; dropsub.DataBind(); List <Model_AsSubSection2> sub2 = AssessmentController.getSubsectionBySecId2(ss2); dropsub2.DataSource = sub2; dropsub2.DataTextField = "Title"; dropsub2.DataValueField = "SUCID2"; dropsub2.DataBind(); if (!string.IsNullOrEmpty(Request.QueryString["ass"])) { add_section.Visible = true; byte id = byte.Parse(Request.QueryString["ass"]); Model_Assessment ass = AssessmentController.GetAssessmentByID(id); if (ass != null) { if (ass.AssChoice.Count > 0) { dropChoice_ret.DataSource = ass.AssChoice; dropChoice_ret.DataTextField = "CombindValue"; dropChoice_ret.DataValueField = "Priority"; dropChoice_ret.DataBind(); } dropside.SelectedValue = ass.Side.ToString(); QuestionTitle.Text = ass.Questions; txtCode.Text = ass.Code; dropQType.SelectedValue = ass.QTID.ToString(); txtpri.Text = ass.Priority.ToString(); txtStartRank.Text = ass.StartRank.ToString(); txtEndRank.Text = ass.EndRank.ToString(); status.SelectedValue = ass.Status.ToString(); Model_AsSubSection sss = new Model_AsSubSection { SCID = ass.SCID }; List <Model_AsSubSection> sub_edit = AssessmentController.getSubsectionBySecId(sss); dropsub.DataSource = sub_edit; dropsub.DataTextField = "Title"; dropsub.DataValueField = "SUCID"; dropsub.DataBind(); dropSection.SelectedValue = ass.SCID.ToString(); Model_AsSubSection2 sss2 = new Model_AsSubSection2 { SCID = ass.SCID }; List <Model_AsSubSection2> sub_edit2 = AssessmentController.getSubsectionBySecId2(sss2); dropsub2.DataSource = sub_edit2; dropsub2.DataTextField = "Title"; dropsub2.DataValueField = "SUCID2"; dropsub2.DataBind(); dropsecs.SelectedValue = (string.IsNullOrEmpty(this.qSection) ? ass.SCID.ToString() : this.qSection); dropsub.SelectedValue = ass.SUCID.ToString(); dropsub2.SelectedValue = ass.SUCID2.ToString(); leftTitle.Text = ass.LeftScaleTitle; rightTitle.Text = ass.RigthScaleTitle; txtGroup.Text = ass.GroupName; } } } if (!string.IsNullOrEmpty(Request.QueryString["tab"])) { string tab = Request.QueryString["tab"]; switch (tab) { case "2": tab1.Attributes.Add("aria-expanded", "false"); //tab2.Attributes.Add("aria-expanded", "true"); //tab3.Attributes.Add("aria-expanded", "false"); //tab4.Attributes.Add("aria-expanded", "false"); li_tab1.Attributes.Remove("class"); //li_tab2.Attributes.Add("class", "active"); //li_tab3.Attributes.Remove("class"); //li_tab4.Attributes.Remove("class"); tab_content1.Visible = false; //tab_content2.Visible = true; //tab_content3.Visible = false; //tab_content4.Visible = false; //List<Model_AsSection> sec = AssessmentController.GetSectionList(); //dropSection.DataSource = sec; //dropSection.DataTextField = "Title"; //dropSection.DataValueField = "SCID"; //dropSection.DataBind(); //dropsection2.DataSource = sec; //dropsection2.DataTextField = "Title"; //dropsection2.DataValueField = "SCID"; //dropsection2.DataBind(); //ListItem lis = new ListItem("All", "0"); //dropsection2.Items.Insert(0, lis); break; case "3": tab1.Attributes.Add("aria-expanded", "false"); //tab2.Attributes.Add("aria-expanded", "false"); //tab3.Attributes.Add("aria-expanded", "true"); //tab4.Attributes.Add("aria-expanded", "false"); li_tab1.Attributes.Remove("class"); //li_tab2.Attributes.Remove("class"); //li_tab3.Attributes.Add("class", "active"); //li_tab4.Attributes.Remove("class"); tab_content1.Visible = false; //tab_content2.Visible = false; //tab_content3.Visible = true; //tab_content4.Visible = false; break; case "4": tab1.Attributes.Add("aria-expanded", "false"); //tab2.Attributes.Add("aria-expanded", "false"); //tab3.Attributes.Add("aria-expanded", "false"); //tab4.Attributes.Add("aria-expanded", "true"); li_tab1.Attributes.Remove("class"); //li_tab2.Attributes.Remove("class"); //li_tab3.Attributes.Remove("class"); //li_tab4.Attributes.Add("class", "active"); tab_content1.Visible = false; //tab_content2.Visible = false; //tab_content3.Visible = false; //tab_content4.Visible = true; Model_AssesIntro ai = AssessmentController.GetAssIntro(); //txtIntroTitle.Text = ai.Title; //txtIntroContent.Text = ai.Description; break; } } else { tab_content1.Visible = true; //tab_content2.Visible = false; //tab_content3.Visible = false; //tab_content4.Visible = false; tab1.Attributes.Add("aria-expanded", "true"); //tab2.Attributes.Add("aria-expanded", "false"); //tab3.Attributes.Add("aria-expanded", "false"); //tab4.Attributes.Add("aria-expanded", "false"); li_tab1.Attributes.Add("class", "active"); //li_tab2.Attributes.Remove("class"); //li_tab3.Attributes.Remove("class"); //li_tab4.Attributes.Remove("class"); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { Model_AssesIntro ai = AssessmentController.GetAssIntro(); txtIntroTitle.Text = ai.Title; txtIntroContent.Text = ai.Description; LastTitle.Text = ai.LastTitle; LastDes.Text = ai.LastDes; MainTitle.Text = ai.MainTitle; ThanksTitle.Text = ai.ThanksTitle; ThanksDes.Text = ai.ThanksDes; ProfileTitle.Text = ai.ProfileTitle; ProfileCJFTitle.Text = ai.ProfileCJFTitle; ProfileFCTitle.Text = ai.ProfileFCTitle; List <Model_AsSection> seclist = AssessmentController.GetSectionList(true); dropSection.DataSource = seclist; dropSection.DataTextField = "Title"; dropSection.DataValueField = "SCID"; dropSection.DataBind(); dropsection2.DataSource = seclist; dropsection2.DataTextField = "Title"; dropsection2.DataValueField = "SCID"; dropsection2.DataBind(); dropsection_1.DataSource = seclist; dropsection_1.DataTextField = "Title"; dropsection_1.DataValueField = "SCID"; dropsection_1.DataBind(); dropsection2_2.DataSource = seclist; dropsection2_2.DataTextField = "Title"; dropsection2_2.DataValueField = "SCID"; dropsection2_2.DataBind(); ListItem lis = new ListItem("All", "0"); dropsection2.Items.Insert(0, lis); dropsection2_2.Items.Insert(0, lis); if (!string.IsNullOrEmpty(Request.QueryString["section"])) { add_section.Visible = true; int id = int.Parse(Request.QueryString["section"]); Model_AsSection sec = AssessmentController.getSectionByID(id); SectionTitle.Text = sec.Title; txtCode.Text = sec.Code; txtintro.Text = sec.Intro; status.SelectedValue = sec.Status.ToString(); txtpri.Text = sec.Priority.ToString(); headsection_pan.InnerHtml = "Edit Section"; } if (!string.IsNullOrEmpty(Request.QueryString["subsection"])) { sub_pan.Visible = true; int subid = int.Parse(Request.QueryString["subsection"]); Model_AsSubSection sub = AssessmentController.getSubByID(subid); dropSection.SelectedValue = sub.SCID.ToString(); txtSubTitle.Text = sub.Title; string comret = string.Empty; if (!string.IsNullOrEmpty(sub.Combind)) { string[] arrcom = sub.Combind.Split(','); comret = string.Join(",", arrcom.Select(i => "SU" + i).ToArray()); } Combind.Text = comret; radioSubStatus.Text = sub.Status.ToString(); headsection_pan1.InnerHtml = "Edit Sub Section"; } if (!string.IsNullOrEmpty(Request.QueryString["subsection2"])) { sub_pan2.Visible = true; int subid = int.Parse(Request.QueryString["subsection2"]); Model_AsSubSection2 sub = AssessmentController.getSubByID2(subid); dropsection_1.SelectedValue = sub.SCID.ToString(); txtSubTitle2.Text = sub.Title; string comret = string.Empty; if (!string.IsNullOrEmpty(sub.Combind)) { string[] arrcom = sub.Combind.Split(','); comret = string.Join(",", arrcom.Select(i => "SU" + i).ToArray()); } Combind2.Text = comret; radioSubStatus2.Text = sub.Status.ToString(); headsection_pan1.InnerHtml = "Edit Sub Section"; } if (!string.IsNullOrEmpty(Request.QueryString["qt"])) { qType_pan.Visible = true; byte subid = byte.Parse(Request.QueryString["qt"]); Model_QType q = AssessmentController.GetQtypeID(subid); txtQtitle.Text = q.Title; qstatus.SelectedValue = q.Status.ToString(); headsection_pan1.InnerHtml = "Edit Question Type"; } } if (!string.IsNullOrEmpty(Request.QueryString["tab"])) { string tab = Request.QueryString["tab"]; switch (tab) { case "2": tab1.Attributes.Add("aria-expanded", "false"); tab2.Attributes.Add("aria-expanded", "true"); tab3.Attributes.Add("aria-expanded", "false"); tab4.Attributes.Add("aria-expanded", "false"); tab5.Attributes.Add("aria-expanded", "false"); li_tab1.Attributes.Remove("class"); li_tab2.Attributes.Add("class", "active"); li_tab3.Attributes.Remove("class"); li_tab4.Attributes.Remove("class"); li_tab5.Attributes.Remove("class"); tab_content1.Visible = false; tab_content2.Visible = true; tab_content3.Visible = false; tab_content4.Visible = false; tab_content5.Visible = false; if (!string.IsNullOrEmpty(Request.QueryString["section"])) { //dropsection2.SelectedValue = Request.QueryString["section"]; } break; case "3": tab1.Attributes.Add("aria-expanded", "false"); tab2.Attributes.Add("aria-expanded", "false"); tab3.Attributes.Add("aria-expanded", "true"); tab4.Attributes.Add("aria-expanded", "false"); tab5.Attributes.Add("aria-expanded", "false"); li_tab1.Attributes.Remove("class"); li_tab2.Attributes.Remove("class"); li_tab3.Attributes.Add("class", "active"); li_tab4.Attributes.Remove("class"); li_tab5.Attributes.Remove("class"); tab_content1.Visible = false; tab_content2.Visible = false; tab_content3.Visible = true; tab_content4.Visible = false; tab_content5.Visible = false; break; case "4": tab1.Attributes.Add("aria-expanded", "false"); tab2.Attributes.Add("aria-expanded", "false"); tab3.Attributes.Add("aria-expanded", "false"); tab4.Attributes.Add("aria-expanded", "true"); tab4.Attributes.Add("aria-expanded", "false"); li_tab1.Attributes.Remove("class"); li_tab2.Attributes.Remove("class"); li_tab3.Attributes.Remove("class"); li_tab4.Attributes.Add("class", "active"); li_tab5.Attributes.Remove("class"); tab_content1.Visible = false; tab_content2.Visible = false; tab_content3.Visible = false; tab_content4.Visible = true; tab_content5.Visible = false; break; case "5": tab1.Attributes.Add("aria-expanded", "false"); tab2.Attributes.Add("aria-expanded", "false"); tab3.Attributes.Add("aria-expanded", "false"); tab4.Attributes.Add("aria-expanded", "false"); tab5.Attributes.Add("aria-expanded", "true"); li_tab1.Attributes.Remove("class"); li_tab2.Attributes.Remove("class"); li_tab3.Attributes.Remove("class"); li_tab4.Attributes.Remove("class"); li_tab5.Attributes.Add("class", "active"); tab_content1.Visible = false; tab_content2.Visible = false; tab_content3.Visible = false; tab_content4.Visible = false; tab_content5.Visible = true; if (!string.IsNullOrEmpty(Request.QueryString["section"])) { // dropsection2_2.SelectedValue = Request.QueryString["section"]; } break; } } else { tab_content1.Visible = true; tab_content2.Visible = false; tab_content3.Visible = false; tab_content4.Visible = false; tab1.Attributes.Add("aria-expanded", "true"); tab2.Attributes.Add("aria-expanded", "false"); tab3.Attributes.Add("aria-expanded", "false"); tab4.Attributes.Add("aria-expanded", "false"); li_tab1.Attributes.Add("class", "active"); li_tab2.Attributes.Remove("class"); li_tab3.Attributes.Remove("class"); li_tab4.Attributes.Remove("class"); } }