Ejemplo n.º 1
0
        public bool SubmitWork(SubmissionDetail subDetail, MemoryStream file, bool isUploaded)
        {
            try
            {
                if (!isUploaded)
                {
                    _SubDao.Insert(subDetail);
                }

                if (isUploaded)
                {
                    _FileDao.Delete(subDetail.UserNo, subDetail.AssignmentNo);
                }

                var userSecurity = new SecurityService(subDetail.UserNo.ToString(), subDetail.AssignmentNo.ToString());
                var byteFile     = _commonService.StreamToByte(file);
                var encryptFile  = userSecurity.EncryptFile(byteFile);
                var fileNo       = _FileDao.Insert(encryptFile);

                subDetail.FileNo = fileNo;

                _SubDao.Update(subDetail);
            }
            catch (Exception e)
            {
                throw e;
            }
            return(true);
        }
Ejemplo n.º 2
0
        public bool UpdateScore(List <AssignmentScore> scoreList)
        {
            foreach (var score in scoreList)
            {
                _ScoreDao.Delete(score);
                _ScoreDao.Insert(score);
            }

            return(true);
        }
Ejemplo n.º 3
0
        public void InsertTest()
        {
            var userProfileDao = new GenericDao <UserProfile>();

            Assert.IsTrue(userProfileDao.Insert(_userProfile));
        }