예제 #1
0
        void SaveJCGScore()
        {
            string hscorevalue = string.Empty;
            string vscorevalue = string.Empty;

            if (Request["qid"] != null && Request["qid"] != "")
            {
                JC_ScoreDAL dal = new JC_ScoreDAL();
                if (dal.ExistJCScore(Request["qid"], strOpenID))
                {
                    Response.Write("{\"message\":\"您已经操作过了,请不要重复操作!\"}");
                }
                else
                {
                    JC_Score model = new JC_Score();
                    model.ID     = Guid.NewGuid().ToString("N").ToUpper();
                    model.OpenID = strOpenID;
                    model.QuizId = Request["qid"].ToString();
                    if (Request["hscore"] != null && Request["hscore"] != "")
                    {
                        hscorevalue = Request["hscore"];
                    }
                    else
                    {
                        hscorevalue = "0";
                    }
                    if (Request["vscore"] != null && Request["vscore"] != "")
                    {
                        vscorevalue = Request["vscore"];
                    }
                    else
                    {
                        vscorevalue = "0";
                    }
                    model.GuessScore = hscorevalue + ":" + vscorevalue;
                    model.State      = 0;
                    model.SiteCode   = Session["strSiteCode"].ToString();
                    if (dal.AddJCScore(model))
                    {
                        Response.Write("{\"message\":\"操作成功!\"}");
                    }
                    else
                    {
                        Response.Write("{\"message\":\"操作失败,请核对后再操作!\"}");
                    }
                }
            }
            else
            {
                Response.Write("{\"message\":\"操作失败,请核对后再操作!\"}");
            }
            Response.End();
        }
예제 #2
0
        void SaveJCGScore()
        {
            string hscorevalue = string.Empty;
            string vscorevalue = string.Empty;

            if (strQuizID != null && strQuizID != "")
            {
                JC_ScoreDAL dal = new JC_ScoreDAL();
                if (!string.IsNullOrEmpty(strOpenID))
                {
                    if (dal.ExistJCScore(strQuizID, strOpenID))
                    {
                        Response.Write("{\"message\":\"不能重复提交!\"}");
                    }
                    else
                    {
                        JC_Score model = new JC_Score();
                        model.ID     = Guid.NewGuid().ToString("N").ToUpper();
                        model.OpenID = strOpenID;
                        model.QuizId = strQuizID;
                        string hscore = Common.Common.NoHtml(Request["hscore"]);
                        string vscore = Common.Common.NoHtml(Request["vscore"]);
                        if (hscore != null && hscore != "")
                        {
                            hscorevalue = hscore;
                        }
                        else
                        {
                            hscorevalue = "0";
                        }
                        if (vscore != null && vscore != "")
                        {
                            vscorevalue = vscore;
                        }
                        else
                        {
                            vscorevalue = "0";
                        }
                        model.GuessScore = hscorevalue + ":" + vscorevalue;
                        model.State      = 0;
                        model.SiteCode   = Session["strSiteCode"].ToString();
                        if (dal.AddJCScore(model))
                        {
                            Response.Write("{\"message\":\"操作成功!\"}");
                        }
                        else
                        {
                            Response.Write("{\"message\":\"操作失败!\"}");
                        }
                    }
                }
                else
                {
                    Response.Write("{\"message\":\"不能重复提交!\"}");
                }
            }
            else
            {
                Response.Write("{\"message\":\"操作失败!\"}");
            }
            Response.End();
        }