예제 #1
0
 public static ReplyPhotoManager GetInstance(ApplicationDbContext context)
 {
     if (manager == null)
     {
         manager = new ReplyPhotoManager(context);
     }
     return(manager);
 }
예제 #2
0
        // needs rework

        /*public ReplyPhoto SavePhotos(HttpPostedFileBase replyPhotoFile, HttpServerUtilityBase server)
         * {
         *  ReplyPhoto replyPhoto = new ReplyPhoto();
         *
         *  if (replyPhotoFile != null)
         *  {
         *      var replyPhotoName = Path.GetFileName(replyPhotoFile.FileName);
         *      // those will be deleted and set the path of the img instead
         *      replyPhoto.CommentPhotoName = commentPhotoName;
         *      replyPhoto.CommentPhotoExtension = Path.GetExtension(commentPhotoName);
         *
         *
         *      var path = Path.Combine(server.MapPath("~/Content/Assets/Images/CommentPhotos/"), replyPhoto.Date.Ticks + replyPhoto.CommentPhotoName);
         *      replyPhotoFile.SaveAs(path);
         *  }
         *  return commentPhoto;
         * }
         *
         * public void DeletePhotos(ReplyPhoto replyPhoto, HttpServerUtilityBase server)
         * {
         *  string savedPhotoName = server.MapPath("~/Content/Assets/Images/CommentPhotos/" + commentPhoto.Date.Ticks + commentPhoto.CommentPhotoName);
         *  if (File.Exists(savedPhotoName))
         *  {
         *      File.Delete(savedPhotoName);
         *  }
         * }*/

        public void Dispose()
        {
            manager = null;
        }