Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OxcoderIBL.SearchChallengeIBL search = new OxcoderBL.SearchChallengeBL();

            if (Request.QueryString["salary"] != null && Request.QueryString["salary"] != "")
                salary = Request.QueryString["salary"].ToString();
            if (Request.QueryString["province"] != null && Request.QueryString["province"] != "")
                location = Request.QueryString["province"].ToString();
            if (Request.QueryString["searchCondition"] != null && Request.QueryString["searchCondition"] != "")
                searchCondition = Request.QueryString["searchCondition"].ToString();
            if (Request.QueryString["flag"] != null && Request.QueryString["flag"] != "")
                flag = Convert.ToInt32(Request.QueryString["flag"].ToString());
            if (Request.QueryString["page"] != null && Request.QueryString["page"] != "")
                page = Convert.ToInt32(Request.QueryString["page"].ToString());
            if (Request.QueryString["retype"] != null && Request.QueryString["retype"] != "")
                retype = Convert.ToInt32(Request.QueryString["retype"].ToString());

            DataSet ds = search.Search(page, 10,salary,location,retype,flag,searchCondition);
            JSONHelper jsonHelp = new JSONHelper();

            jsonHelp.success = true;
            jsonHelp.totlalCount = ds.Tables[0].Rows.Count;
            jsonHelp.has_next = ds.Tables[0].Rows.Count == 9 ;

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                jsonHelp.AddItem("Challenge_ID", dr["Challenge_ID"].ToString());
                jsonHelp.AddItem("Challenge_Name", dr["Challenge_Name"].ToString());
                jsonHelp.AddItem("Enterprice_FullName", dr["Enterprice_FullName"].ToString());
                jsonHelp.AddItem("Enterprice_Logo", dr["Enterprice_Logo"].ToString());
                jsonHelp.AddItem("Challenge_Salary", dr["Challenge_Salary"].ToString());
                jsonHelp.AddItem("Challenge_Position0", dr["Challenge_Position0"].ToString());
                jsonHelp.AddItem("Challenge_Position1", dr["Challenge_Position1"].ToString());
                jsonHelp.AddItem("Challenge_Position2", dr["Challenge_Position2"].ToString());
                jsonHelp.AddItem("Challenge_Quiz0", dr["Challenge_Quiz0"].ToString());
                jsonHelp.AddItem("Challenge_Quiz1", dr["Challenge_Quiz1"].ToString());
                jsonHelp.AddItem("Challenge_Quiz2", dr["Challenge_Quiz2"].ToString());
                jsonHelp.AddItem("Challenge_Level", dr["Challenge_Level"].ToString());
                jsonHelp.AddItem("Enterprice_FullName", dr["Enterprice_FullName"].ToString());
                jsonHelp.AddItem("Challenge_EnTime", dr["Challenge_EnTime"].ToString());
                jsonHelp.AddItem("Challenge_Num", dr["Challenge_Num"].ToString());

                jsonHelp.ItemOk();
            }

            string strResult = jsonHelp.ToString();

            Response.Clear();
            Response.Write(strResult);
            Response.End();
        }
Ejemplo n.º 2
0
        public Model.Quiz searchQuizInfo(string reid, int order)
        {
            OxcoderIBL.SearchChallengeIBL search = new OxcoderBL.SearchChallengeBL();
            OxcoderIBL.QuizInfoIBL        enter  = new OxcoderBL.QuizInfoBL();

            DataSet ds = search.SearchByChallengeID(reid);

            switch (order)
            {
            case 0:
                ds = enter.QuizInfo(ds.Tables[0].Rows[0]["Challenge_Quiz_First"].ToString());
                break;

            case 1:
                ds = enter.QuizInfo(ds.Tables[0].Rows[0]["Challenge_Quiz_Sec"].ToString());
                break;

            case 2:
                ds = enter.QuizInfo(ds.Tables[0].Rows[0]["Challenge_Quiz_Third"].ToString());
                break;

            default:
                ds = enter.QuizInfo(ds.Tables[0].Rows[0]["Challenge_Quiz_First"].ToString());
                break;
            }

            Model.Quiz p1 = new Model.Quiz();
            p1.chineseName      = ds.Tables[0].Rows[0]["Quiz_Name"].ToString();
            p1.pid              = ds.Tables[0].Rows[0]["Quiz_ID"].ToString();
            p1.codepath         = ds.Tables[0].Rows[0]["Quiz_Info"].ToString();
            p1.countDown        = ds.Tables[0].Rows[0]["Quiz_Time"].ToString();
            p1.order            = order;
            p1.pname            = ds.Tables[0].Rows[0]["Quiz_Pname"].ToString();
            p1.previewfileExist = false;
            p1.ptype            = ds.Tables[0].Rows[0]["Quiz_TypeID"].ToString();
            p1.ptypeName        = ds.Tables[0].Rows[0]["Quiz_Type"].ToString();
            p1.target           = ds.Tables[0].Rows[0]["Quiz_Content"].ToString();
            p1.totalTime        = ds.Tables[0].Rows[0]["Quiz_Time"].ToString();
            p1.input            = ds.Tables[0].Rows[0]["Quiz_Input"].ToString();
            p1.output           = ds.Tables[0].Rows[0]["Quiz_Output"].ToString();
            return(p1);
        }
Ejemplo n.º 3
0
        public Model.Quiz searchQuizInfo(string reid, int order)
        {
            OxcoderIBL.SearchChallengeIBL search = new OxcoderBL.SearchChallengeBL();
            OxcoderIBL.QuizInfoIBL enter = new OxcoderBL.QuizInfoBL();

            DataSet ds = search.SearchByChallengeID(reid);
            switch (order)
            {
                case 0:
                    ds = enter.QuizInfo(ds.Tables[0].Rows[0]["Challenge_Quiz_First"].ToString());
                    break;
                case 1:
                    ds = enter.QuizInfo(ds.Tables[0].Rows[0]["Challenge_Quiz_Sec"].ToString());
                    break;
                case 2:
                    ds = enter.QuizInfo(ds.Tables[0].Rows[0]["Challenge_Quiz_Third"].ToString());
                    break;
                default:
                    ds = enter.QuizInfo(ds.Tables[0].Rows[0]["Challenge_Quiz_First"].ToString());
                    break;
            }

            Model.Quiz p1 = new Model.Quiz();
            p1.chineseName = ds.Tables[0].Rows[0]["Quiz_Name"].ToString();
            p1.pid = ds.Tables[0].Rows[0]["Quiz_ID"].ToString();
            p1.codepath = ds.Tables[0].Rows[0]["Quiz_Info"].ToString();
            p1.countDown = ds.Tables[0].Rows[0]["Quiz_Time"].ToString();
            p1.order = order;
            p1.pname = ds.Tables[0].Rows[0]["Quiz_Pname"].ToString();
            p1.previewfileExist = false;
            p1.ptype = ds.Tables[0].Rows[0]["Quiz_TypeID"].ToString();
            p1.ptypeName = ds.Tables[0].Rows[0]["Quiz_Type"].ToString();
            p1.target = ds.Tables[0].Rows[0]["Quiz_Content"].ToString();
            p1.totalTime = ds.Tables[0].Rows[0]["Quiz_Time"].ToString();
            p1.input = ds.Tables[0].Rows[0]["Quiz_Input"].ToString();
            p1.output = ds.Tables[0].Rows[0]["Quiz_Output"].ToString();
            return p1;
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OxcoderIBL.SearchChallengeIBL search = new OxcoderBL.SearchChallengeBL();

            if (Request.QueryString["salary"] != null && Request.QueryString["salary"] != "")
            {
                salary = Request.QueryString["salary"].ToString();
            }
            if (Request.QueryString["province"] != null && Request.QueryString["province"] != "")
            {
                location = Request.QueryString["province"].ToString();
            }
            if (Request.QueryString["searchCondition"] != null && Request.QueryString["searchCondition"] != "")
            {
                searchCondition = Request.QueryString["searchCondition"].ToString();
            }
            if (Request.QueryString["flag"] != null && Request.QueryString["flag"] != "")
            {
                flag = Convert.ToInt32(Request.QueryString["flag"].ToString());
            }
            if (Request.QueryString["page"] != null && Request.QueryString["page"] != "")
            {
                page = Convert.ToInt32(Request.QueryString["page"].ToString());
            }
            if (Request.QueryString["retype"] != null && Request.QueryString["retype"] != "")
            {
                retype = Convert.ToInt32(Request.QueryString["retype"].ToString());
            }

            DataSet    ds       = search.Search(page, 10, salary, location, retype, flag, searchCondition);
            JSONHelper jsonHelp = new JSONHelper();

            jsonHelp.success     = true;
            jsonHelp.totlalCount = ds.Tables[0].Rows.Count;
            jsonHelp.has_next    = ds.Tables[0].Rows.Count == 9;

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                jsonHelp.AddItem("Challenge_ID", dr["Challenge_ID"].ToString());
                jsonHelp.AddItem("Challenge_Name", dr["Challenge_Name"].ToString());
                jsonHelp.AddItem("Enterprice_FullName", dr["Enterprice_FullName"].ToString());
                jsonHelp.AddItem("Enterprice_Logo", dr["Enterprice_Logo"].ToString());
                jsonHelp.AddItem("Challenge_Salary", dr["Challenge_Salary"].ToString());
                jsonHelp.AddItem("Challenge_Position0", dr["Challenge_Position0"].ToString());
                jsonHelp.AddItem("Challenge_Position1", dr["Challenge_Position1"].ToString());
                jsonHelp.AddItem("Challenge_Position2", dr["Challenge_Position2"].ToString());
                jsonHelp.AddItem("Challenge_Quiz0", dr["Challenge_Quiz0"].ToString());
                jsonHelp.AddItem("Challenge_Quiz1", dr["Challenge_Quiz1"].ToString());
                jsonHelp.AddItem("Challenge_Quiz2", dr["Challenge_Quiz2"].ToString());
                jsonHelp.AddItem("Challenge_Level", dr["Challenge_Level"].ToString());
                jsonHelp.AddItem("Enterprice_FullName", dr["Enterprice_FullName"].ToString());
                jsonHelp.AddItem("Challenge_EnTime", dr["Challenge_EnTime"].ToString());
                jsonHelp.AddItem("Challenge_Num", dr["Challenge_Num"].ToString());

                jsonHelp.ItemOk();
            }

            string strResult = jsonHelp.ToString();

            Response.Clear();
            Response.Write(strResult);
            Response.End();
        }