Example #1
0
        //获取分数纪录信息
        public ActionResult GetScoreInfo()
        {
            var state = Convert.ToInt16(Request["State"]);
            var temp  = WXXScoreInfoService.LoadEntities(x => x.State == state && x.GiveScoreUserID == LoginUser.ID).DefaultIfEmpty().ToList();

            if (temp != null && temp[0] != null)
            {
                List <WXXSCOREINFO> sinfo = new List <WXXSCOREINFO>();
                foreach (var a in temp)
                {
                    WXXSCOREINFO wxxinfo = new WXXSCOREINFO();
                    wxxinfo.ID                   = a.ID;
                    wxxinfo.Score                = a.Score;
                    wxxinfo.State                = a.State;
                    wxxinfo.GiveScoreUserID      = a.GiveScoreUserID;
                    wxxinfo.GiveScoreUserName    = a.UserInfo1.PerSonName;
                    wxxinfo.BeiGiveScoreUserID   = a.BeiGiveScoreUserID;
                    wxxinfo.BeiGiveScoreUserName = a.UserInfo.PerSonName;
                    wxxinfo.AddTime              = a.AddTime;
                    wxxinfo.ChangeStateTime      = a.ChangeStateTime;
                    sinfo.Add(wxxinfo);
                }
                return(Json(new { ret = "ok", rows = sinfo }, JsonRequestBehavior.AllowGet));
            }
            return(Json(new { ret = "no", msg = "数据库中无数据!" }, JsonRequestBehavior.AllowGet));
        }
Example #2
0
        //作废删除某条评分数据
        public ActionResult DelScoreInfo()
        {
            long id   = Convert.ToInt64(Request["id"]);
            var  temp = WXXScoreInfoService.LoadEntities(x => x.ID == id).FirstOrDefault();

            if (temp != null)
            {
                if (WXXScoreInfoService.DeleteEntity(temp))
                {
                    return(Json(new { ret = "ok", msg = "删除成功" }, JsonRequestBehavior.AllowGet));
                }
                return(Json(new { ret = "no", msg = "删除失败" }, JsonRequestBehavior.AllowGet));
            }
            return(Json(new { ret = "no", msg = "数据库中无此数据" }, JsonRequestBehavior.AllowGet));
        }
Example #3
0
        //添加评分记录
        public ActionResult AddScoreInfo()
        {
            WXXScoreInfo wxxsi = new WXXScoreInfo();

            wxxsi.GiveScoreUserID    = LoginUser.ID;
            wxxsi.BeiGiveScoreUserID = Convert.ToInt32(Request["uid"]);
            wxxsi.Score   = Convert.ToSingle(Request["Score"]);
            wxxsi.State   = Convert.ToBoolean(Request["BeSure"]) == true ? (short)1 : (short)0;
            wxxsi.AddTime = DateTime.Now;
            if (wxxsi.State == 1)
            {
                wxxsi.ChangeStateTime = DateTime.Now;
            }
            WXXScoreInfoService.AddEntity(wxxsi);
            return(Json(new { ret = "ok", msg = "评分成功" }, JsonRequestBehavior.AllowGet));
        }
Example #4
0
        //确认当前评分
        public ActionResult ConfirmThisScore()
        {
            long id   = Convert.ToInt64(Request["id"]);
            var  temp = WXXScoreInfoService.LoadEntities(x => x.ID == id).FirstOrDefault();

            if (temp != null)
            {
                temp.State           = 1;
                temp.ChangeStateTime = DateTime.Now;
                if (WXXScoreInfoService.EditEntity(temp))
                {
                    return(Json(new { ret = "ok", msg = "确认成功" }, JsonRequestBehavior.AllowGet));
                }
                return(Json(new { ret = "no", msg = "确认失败" }, JsonRequestBehavior.AllowGet));
            }
            return(Json(new { ret = "no", msg = "数据库中无此数据" }, JsonRequestBehavior.AllowGet));
        }