Exemplo n.º 1
0
 public JsonResult Delete(Game_UserInfo _t)
 {
     if (WMFactory.GLGameUserInfo.Delete(s => s.Id == _t.Id ))
         return Json(ResultMsg.Success("删除成功!"));
     else
         return Json(ResultMsg.Failure("删除失败,请您重试!"));
 }
Exemplo n.º 2
0
 public JsonResult Post(Game_UserInfo _t)
 {
     if (WMFactory.GLGameUserInfo.Insert(_t))
         return Json(ResultMsg.Success("新增成功!"));
     else
         return Json(ResultMsg.Failure("新增失败,请您重试!"));
 }
Exemplo n.º 3
0
 public JsonResult Put(Game_UserInfo _t)
 {
     IGLGameUserInfoService service = WMFactory.GLGameUserInfo;
     Game_UserInfo entity = service.GetById(_t.Id.ToString());
     entity = AutoMapper<Game_UserInfo, Game_UserInfo>.Convert(_t, entity);
     if (service.Update(entity))
         return Json(ResultMsg.Success("更新成功!"));
     else
         return Json(ResultMsg.Failure("更新失败,请您重试!"));
 }
        public JsonResult Submit(Game_UserInfo gu, string sid)
        {
            gu.CreateUser = "******";
            gu.Group = 11;

            IEnumerable<Game_UserInfo> gt = WMFactory.GameUserInfo.FindByConditions(null, f => f.Oid == gu.Oid && f.Group == 11);

            if (gt.Count() > 0)
            {
                return Json(ResultMsg.Failure("你已经参与过了!"));
            }
            else
            {
                if (WMFactory.GameUserInfo.Insert(gu))
                    return Json(ResultMsg.Success("信息提交成功。"));
                else
                    return Json(ResultMsg.Failure("信息提交失败,请重试!"));
            }
        }
Exemplo n.º 5
0
        public JsonResult Submit(Game_UserInfo gu)
        {
            string guidoid = "oloPUjkzSLyHPqAM5kW6DRzZzc74";
            gu.Oid = guidoid;
            gu.CreateUser = "******";
            gu.Group = 1;

            IEnumerable<Game_UserInfo> gr = WMFactory.GameUserInfo.FindByConditions(null, f => f.Oid == guidoid && f.Group == 1 && f.Tel == gu.Tel);
            if (gr.Count() > 0)
            {
                return Json(ResultMsg.Failure("亲,你的手机已经登记过了,请勿重复登记!谢谢!"));
            }
            else
            {
                if (WMFactory.GameUserInfo.Insert(gu))
                    return Json(ResultMsg.Success("信息提交成功。"));
                else
                    return Json(ResultMsg.Failure("信息提交失败,请重试!"));
            }
        }
        public JsonResult Submit(Game_UserInfo gu)
        {
            gu.CreateUser = "******";
            gu.Group = 5;

            if (WMFactory.GameUserInfo.Insert(gu))
                return Json(ResultMsg.Success("信息提交成功。"));
            else
                return Json(ResultMsg.Failure("信息提交失败,请重试!"));
        }
Exemplo n.º 7
0
        public JsonResult Submit(Game_UserInfo gu)
        {
            gu.CreateUser = "******";
            gu.Group = 9;

            IEnumerable<Game_UserInfo> gt = WMFactory.GameUserInfo.FindByConditions(null, f => f.Oid == gu.Oid && f.Group == 9);

            if (gt.Count() > 0)
            {
                Game_UserInfo gt2 = gt.First();
                gt2.Oid = gu.Oid;
                gt2.Address = gu.Address;
                gt2.Name = gu.Name;
                gt2.Tel = gu.Tel;
                gt2.ModifyUser = "******";
                if (WMFactory.GameUserInfo.Update(gt2))
                    return Json(ResultMsg.Success("信息提交成功。"));
                else
                    return Json(ResultMsg.Failure("信息提交失败,请重试!"));
            }
            else
            {
                if (WMFactory.GameUserInfo.Insert(gu))
                    return Json(ResultMsg.Success("信息提交成功。"));
                else
                    return Json(ResultMsg.Failure("信息提交失败,请重试!"));
            }
        }
Exemplo n.º 8
0
        public JsonResult Submit(Game_UserInfo gu)
        {
            if (WMFactory.GameUserInfo.GetCount(f => f.Group == 10 && f.Oid == gu.Oid) > 0)
            {
                return Json(ResultMsg.Success("信息已提交。"));
            }

            gu.CreateUser = "******";
            gu.Group = 10;

            IEnumerable<Game_Record> gr = WMFactory.GameRecord.FindByConditions(null, f => f.Group == 10 && f.Oid == gu.Oid);
            gr.First().isAward = 1;
            gr.First().ModifyUser = "******";
            Game_Award ga = WMFactory.GameAward.GetById(gr.First().AwardId.ToString());
            if (ga.PNum > 0)
            {
                ga.PNum = ga.PNum - 1;
            }
            else
            {
                return Json(ResultMsg.Failure("later"));
            }


            if (WMFactory.GameUserInfo.Insert(gu) && WMFactory.GameRecord.Update(gr.First()) && WMFactory.GameAward.Update(ga))
            {
                return Json(ResultMsg.Success("信息提交成功。"));
            }
            else
                return Json(ResultMsg.Failure("信息提交失败,请重试!"));
        }