Exemple #1
0
        public ActionResult Create(Post data, HttpPostedFileBase Image)
        {
            List <string> UploadImagePaths = new List <string>();

            UploadImagePaths = ImageUploader.UploadSingleImage(ImageUploader.OriginalProfileImagePath, Image, 1);

            data.ImagePath = UploadImagePaths[0];

            if (data.ImagePath == "1" || data.ImagePath == "2" || data.ImagePath == "3")
            {
                data.ImagePath = ImageUploader.DefaultProfileImagePath;
                data.ImagePath = ImageUploader.DefaultXSmallProfileImagePath;
                data.ImagePath = ImageUploader.DefaultCruptedProfileImagePath;
            }
            else
            {
                data.ImagePath = UploadImagePaths[1];
                data.ImagePath = UploadImagePaths[2];
            }
            _postRepo.Add(data);
            return(Redirect("/Admin/Post/List"));
        }
 public ActionResult Create(Post data)
 {
     _postRepo.Add(data);
     return(Redirect("/Admin/Post/List"));
 }