Example #1
0
        public void GetPicture(StudentPictureType type)
        {
            Response <WebImage> response =
                _mediator.Request(new GetPicture {
                Type = type, UserId = _currentUser.User.Id
            });

            response.Data.Write();
        }
Example #2
0
        public ActionResult UploadPicture(HttpPostedFileBase file, StudentPictureType type)
        {
            try
            {
                _mediator.Notify(new SavePicture(file, type));

                return(RedirectToAction(type.ToString()).WithSuccess("Your Picture has been saved."));
            }
            catch (Exception)
            {
                return(RedirectToAction(type.ToString()).WithError("There was a problem uploading your file. Your picture has not been saved."));
            }
        }
Example #3
0
 public SavePicture(HttpPostedFileBase file, StudentPictureType type)
 {
     File = file;
     Type = type;
 }