Пример #1
0
    public static void GetFCAll(Model_FC parameters)
    {
        IList <Model_FC> ret = UsersController.GetFCeAll(parameters);


        AppTools.SendResponse(HttpContext.Current.Response, ret.ObjectToJSON());
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string s = SectionTitle.Text.Trim();
        // string c = txtCode.Text.Trim();
        //string i = txtintro.Text.Trim();
        bool st = bool.Parse(status.SelectedValue);
        //int pr = int.Parse(txtpri.Text);
        Model_FC sub = new Model_FC
        {
            //SCID = secID,
            Title  = s,
            Status = st,
        };


        Button btn = (Button)sender;

        if (!string.IsNullOrEmpty(Request.QueryString["fc"]))
        {
            byte bytID = byte.Parse(Request.QueryString["fc"]);
            sub.FCID = bytID;
            if (UsersController.EditFC(sub))
            {
                Response.Redirect("UsersContent");
            }
        }
        else
        {
            if (UsersController.AddFc(sub) > 0)
            {
                Response.Redirect(Request.Url.ToString());
            }
        }
    }
Пример #3
0
 public static int AddFc(Model_FC q)
 {
     return(q.AddFC(q));
 }
Пример #4
0
 public static bool EditFC(Model_FC q)
 {
     return(q.UpdateFC(q));
 }
Пример #5
0
 public static List <Model_FC> GetFCeAll(Model_FC ae)
 {
     return(ae.GetFCAll());
 }
Пример #6
0
    ///FC
    ///

    public static Model_FC GetFCID(byte bytId)
    {
        Model_FC q = new Model_FC();

        return(q.GetFCByID(bytId));
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["fc"]))
            {
                add_section.Visible = true;
                byte     id  = byte.Parse(Request.QueryString["fc"]);
                Model_FC sec = UsersController.GetFCID(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 Functional Competencies";
            }

            if (!string.IsNullOrEmpty(Request.QueryString["cjf"]))
            {
                sub_pan.Visible = true;
                int       subid = int.Parse(Request.QueryString["cjf"]);
                Model_CJF sub   = UsersController.GetCJF(subid);
                //dropSection.SelectedValue = sub.SCID.ToString();
                txtSubTitle.Text    = sub.Title;
                radioSubStatus.Text = sub.Status.ToString();


                headsection_pan1.InnerHtml = "Edit Job Level";
            }
        }


        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");


                li_tab1.Attributes.Remove("class");
                li_tab2.Attributes.Add("class", "active");



                tab_content1.Visible = false;
                tab_content2.Visible = true;



                break;
            }
        }
        else
        {
            tab_content1.Visible = true;
            tab_content2.Visible = false;


            tab1.Attributes.Add("aria-expanded", "true");
            tab2.Attributes.Add("aria-expanded", "false");


            li_tab1.Attributes.Add("class", "active");
            li_tab2.Attributes.Remove("class");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        this.Page.Title = "KeenProfile Your Profile";
        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);
            //}

            Model_Users u = this.UserActive;
            if (u != null)

            {
                //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 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(o => o.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();


                Maintitle.Text = "Your Profile";



                //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);
                txtEmail.Text = u.Email;
            }
        }
    }
    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);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            //dropRole.DataSource = UsersController.GetUserRole();
            //dropRole.DataTextField = "Title";
            //dropRole.DataValueField = "UsersRoleId";
            //dropRole.DataBind();

            //ListItem lis = new ListItem("All", "0");
            //dropRole.Items.Insert(0, lis);

            if (!string.IsNullOrEmpty(Request.QueryString["s"]))
            {
                int         USerID = int.Parse(Request.QueryString["s"]);
                Model_Users u      = new Model_Users();
                u = u.getUserbyID(USerID);

                //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 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)
                {
                    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=\"checkbox\" 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();


                //Maintitle.Text = "Your Profile";



                //Binding profile (initial data)

                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);
                txtEmail.Text = u.Email;
            }
        }
    }