Exemplo n.º 1
0
        public ActionResult question(string hidmid, string hiduid, FormCollection fc)
        {
            string mid = fc["hidmid"];
            string uid = fc["hiduid"];

            if (string.IsNullOrEmpty(mid) || string.IsNullOrEmpty(uid))
            {
                ViewBag.result = "-1";
            }
            else
            {
                List <tblanswer> lst = new List <tblanswer>();
                for (int i = 1; i <= 8; i++)
                {
                    tblanswer tbl = new tblanswer();
                    tbl.answerid   = Guid.NewGuid().ToString();
                    tbl.matchid    = mid;
                    tbl.questionid = "q" + i.ToString();
                    tbl.result     = fc["q" + i.ToString()];
                    tbl.updtime    = DateTime.Now;
                    tbl.userid     = uid;
                    lst.Add(tbl);
                }

                ApiBll bll = new ApiBll();

                bll.Answer(lst);

                ViewBag.result = "0";
            }

            return(View());
        }
Exemplo n.º 2
0
        /// <summary>
        ///队伍详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>

        /*public JsonResult getteam(string id)
         * {
         *  int intId = 0;
         *
         *  if (!int.TryParse(id, out intId))
         *      return RepReurnError("id传入错误");
         *
         *
         *  ApiBll bll = new ApiBll();
         *  var team = bll.GetTeamById(intId);
         *  if (team == null)
         *      return RepReurnError("查询的队伍信息不存在");
         *
         *  var data = new { id = team.Id, teamname = team.Teamname, userid = team.Userid, company = team.Company, lineid = team.Lineid, createtime = team.Createtime };
         *  return RepReurnOK(data);
         * }*/

        public JsonResult getmatchlist(string dt)
        {
            ApiBll bll   = new ApiBll();
            var    match = bll.GetMatcheByDt(DateTime.Now);

            foreach (var m in match)
            {
                if (m.Status == "0")
                {
                    m.Status = "预报名中";
                }
                else if (m.Status == "1")
                {
                    m.Status = "报名中";
                }
                else if (m.Status == "2")
                {
                    m.Status = "已结束";
                }
            }

            if (match == null)
            {
                return(RepReurnError("没有比赛信息"));
            }

            return(RepReurnOK(match));
        }