コード例 #1
0
    public static void GetSectionAll(Model_AsSection parameters)
    {
        IList <Model_AsSection> ret = AssessmentController.GetSectionList();


        AppTools.SendResponse(HttpContext.Current.Response, ret.ObjectToJSON());
    }
コード例 #2
0
    public string GenSectionIntro(Model_AsSection sec)
    {
        StringBuilder ret = new StringBuilder();


        ret.Append("<h1 class=\"step_count\"></h1>");
        ret.Append("<div class=\"step-content\">");
        ret.Append("<div class=\"text-center m-t-md\">");
        //ret.Append("<h2>"+sec.Title+"</h2>");
        ret.Append("<p class=\"intro-detail\">" + convertcontent(sec.Intro) + "</p>");
        ret.Append("</div>");
        ret.Append(" </div>");

        return(ret.ToString());
    }
コード例 #3
0
    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");
        }
    }
コード例 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Page.Title = "KeenProfile Assessment";
        if (!this.Page.IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["success"]))
            {
                main_thanks.Visible = true;
                main_form.Visible   = false;

                Model_AssesIntro intro = new Model_AssesIntro();
                intro            = intro.GetIntro();
                ThanksTitle.Text = intro.ThanksTitle;
                ThanksDes.Text   = convertcontent(intro.ThanksDes);
            }
            else
            {
                Model_Users u = this.UserActive;
                if (u != null)
                {
                    //Get Main Intro
                    Model_AssesIntro intro = new Model_AssesIntro();
                    intro = intro.GetIntro();


                    //Get Job Function
                    Model_CJF        cjf     = new Model_CJF();
                    List <Model_CJF> cjflist = cjf.GetCJFeAll();

                    Model_UserCJF        cjflistUser    = new Model_UserCJF();
                    List <Model_UserCJF> cjfuserChecked = cjflistUser.GetListUsercjf(u.UserID);

                    //Get Functional Competencies
                    Model_FC        fc     = new Model_FC();
                    List <Model_FC> fclist = fc.GetFCAll();

                    Model_UserFC        fcuser        = new Model_UserFC();
                    List <Model_UserFC> fcuserchecked = fcuser.GetListUserFc(u.UserID);

                    //Get Section
                    Model_AsSection        section     = new Model_AsSection();
                    List <Model_AsSection> sectionlist = section.GetListSection(true);

                    //Get Assessment
                    Model_Assessment        ass     = new Model_Assessment();
                    List <Model_Assessment> asslist = ass.GetAssessmentAll();

                    //Get Country
                    Model_Country        c        = new Model_Country();
                    List <Model_Country> ccountry = c.GetAllCountry();


                    dropNation.DataSource     = ccountry;
                    dropNation.DataTextField  = "DropValue";
                    dropNation.DataValueField = "ID";
                    dropNation.DataBind();

                    dropNation.SelectedValue = "211";


                    StringBuilder strcjf = new StringBuilder();
                    StringBuilder strfc  = new StringBuilder();


                    strcjf.Append("<div  class=\"checkitem\">");


                    foreach (Model_CJF i  in cjflist.Where(r => r.Status))
                    {
                        string check = string.Empty;
                        if (cjfuserChecked.Where(r => r.CJFID == i.CJFID).Count() > 0)
                        {
                            check = "Checked=\"Checked\"";
                        }


                        strcjf.Append("<div class=\"item\">");
                        strcjf.Append("<input  type=\"radio\" name=\"chckCJF_form\" " + check + " class=\"role_cjf_valid\" value=\"" + i.CJFID + "\">");
                        strcjf.Append("<label>" + i.Title + "</label>");
                        strcjf.Append("</div>");
                    }


                    strcjf.Append("</div>");



                    strfc.Append("<div class=\"checkitem\">");

                    foreach (Model_FC i in fclist)
                    {
                        string check = string.Empty;
                        if (fcuserchecked.Where(r => r.FCID == i.FCID).Count() > 0)
                        {
                            check = "Checked=\"Checked\"";
                        }

                        strfc.Append("<div class=\"item\">");
                        strfc.Append("<input  type=\"checkbox\" name=\"chckFC_form\" " + check + " class=\"role_fc_valid\" value=\"" + i.FCID + "\">");
                        strfc.Append("<label>" + i.Title + "</label>");
                        strfc.Append("</div>");
                    }

                    strfc.Append("</div>");

                    chckCJF.Text = strcjf.ToString();
                    // checkFC.Text = strfc.ToString();



                    IntroTitle.Text  = intro.Title;
                    IntroDetail.Text = convertcontent(intro.Description);

                    LastTitle.Text = intro.LastTitle;
                    LastDes.Text   = convertcontent(intro.LastDes);

                    Maintitle.Text = intro.MainTitle;


                    profiletitle.Text = intro.ProfileTitle;
                    //fctitle.Text = intro.ProfileFCTitle;
                    cjftitle.Text = intro.ProfileCJFTitle;

                    StringBuilder ret = new StringBuilder();
                    foreach (Model_AsSection sec in sectionlist)
                    {
                        //string sIntro = sec.Title;
                        //string sDetail = convertcontent(sec.Intro);

                        List <Model_Assessment> list = asslist.Where(r => r.SCID == sec.SCID).OrderBy(r => r.Priority).ThenBy(r => r.GroupName).ToList();
                        if (list.Count > 0)
                        {
                            ret.Append(GenSectionIntro(sec));


                            foreach (Model_Assessment asi in list)
                            {
                                string question = asi.Questions;
                                int    rs       = asi.StartRank;
                                int    rd       = asi.EndRank;

                                byte questionType = asi.QTID;



                                // 1   Scale
                                //4   Ranking Scale
                                //5   Left / Right Ranking
                                switch (questionType)
                                {
                                //Scale
                                case 1:
                                    ret.Append(GenQuestionTypeScale(asi));
                                    break;

                                //Ranking Scale
                                case 4:
                                    ret.Append(GenQuestionTypeRankingScalChoice(asi));
                                    break;

                                //Left / Right Ranking
                                case 5:
                                    ret.Append(GenQuestionTypeRankLeftRigth(asi));
                                    break;
                                }
                            }
                        }
                    }

                    Stepcontent.Text = ret.ToString();


                    //Binding profile (initial data)
                    heUserID.Value           = u.UserID.ToString();
                    firstName.Text           = (string.IsNullOrEmpty(u.FirstName) ? "" : u.FirstName);
                    LastName.Text            = (string.IsNullOrEmpty(u.LastName) ? "" : u.LastName);
                    dropGender.SelectedValue = u.Gender.ToString();
                    dropNation.SelectedValue = u.Nationality.ToString();
                    day.Text     = (u.DateofBirth != null? u.DateofBirth.ToString("yyy-MM-dd"): "");
                    txtPhon.Text = (string.IsNullOrEmpty(u.MobileNumber) ? "" : u.MobileNumber);
                }
            }
        }
        else
        {
            //Button btn = (Button)sender;

            //Response.Write(chckCJF.SelectedValue);
        }
    }
コード例 #5
0
    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");
        }
    }