コード例 #1
0
 partial void DeleteExamTestPicture(ExamTestPicture instance);
コード例 #2
0
 partial void UpdateExamTestPicture(ExamTestPicture instance);
コード例 #3
0
		private void detach_ExamTestPictures(ExamTestPicture entity)
		{
			this.SendPropertyChanging();
			entity.ExamTestQuestion = null;
		}
コード例 #4
0
 partial void InsertExamTestPicture(ExamTestPicture instance);
コード例 #5
0
        private void UploadFiles(IEnumerable<HttpPostedFileBase> fileUpload, ExamTestQuestion question)
        {
            foreach (var file in fileUpload)
            {
                if (file == null) continue;

                var ms = new MemoryStream();
                using (ms)
                {
                    file.InputStream.CopyTo(ms);
                }
                var pictureBuffer = ms.GetBuffer();

                var tPicture = new ExamTestPicture() { Picture = pictureBuffer, ExamTestQuestionID = question.ExamTestQuestionID };
                question.ExamTestPictures.Add(tPicture);
            }
        }