Beispiel #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);
        }
Beispiel #2
0
        public void UpdateTest()
        {
            var userProfileDao = new GenericDao <UserProfile>();

            _userProfile.UserName = "******";
            Assert.IsTrue(userProfileDao.Update(_userProfile));
        }