예제 #1
0
        private ProfEvent ProfEventMapping(ProfEventView model, HttpPostedFileBase file)
        {
            var profEvent = new ProfEvent();
            profEvent.ImageData = new byte[file.ContentLength];

            TimeSpan time = new TimeSpan(model.Time.Hour, model.Time.Minute, 0);
            var date = new DateTime(model.Date.Year, model.Date.Month, model.Date.Day).Add(time);
            profEvent.Name = model.Name;
            profEvent.Place = model.Place;
            profEvent.Description = model.Description;
            profEvent.StartDateTime = date;
            profEvent.MimeType = file.ContentType;
            file.InputStream.Read(profEvent.ImageData, 0, file.ContentLength);
            return profEvent;
        }
예제 #2
0
 public void CreateProfEvent(ProfEvent profEvent)
 {
     _unitOfWork.Add<ProfEvent>(profEvent);
 }