Exemplo n.º 1
0
        public ActionResult UploadResult(int AssignmentId)
        {
            Metrics.Program.Main();

            List <UploadResultModel> UploadResult = new List <UploadResultModel>();

            UploadResult.Add(new UploadResultModel
            {
                RWSMS      = DataLibrary.Models.UploadResultModel.RWSMS,
                SDPMS      = DataLibrary.Models.UploadResultModel.SDPMS,
                OOPMG      = DataLibrary.Models.UploadResultModel.OOPMG,
                TUG        = DataLibrary.Models.UploadResultModel.TUG,
                TG         = DataLibrary.Models.UploadResultModel.TG,
                finalScore = DataLibrary.Models.UploadResultModel.finalScore
            });

            int TotAsNum = 1;
            var UserId   = User.Identity.GetUserId();
            var res      = DBBridge.CheckAttendanceNum(UserId, AssignmentId);

            if (res.Count >= 1)
            {
                TotAsNum = res.Count + 1;
            }
            var Score = DataLibrary.Models.UploadResultModel.finalScore;

            DBBridge.CreateResult(UserId, AssignmentId, Score, TotAsNum);

            return(View(UploadResult));
        }