public ActionResult Upload(PhotoUpload photo, AppDevBusiness appbusiness, string studentnumber) { if (photo.FileUpload != null && photo.FileUpload.ContentLength > 0) { appbusiness.UploadPhoto("images", photo.FileUpload, studentnumber); } return(RedirectToAction("Index")); }
public ActionResult Delete(string id, AppDevBusiness appdevbusiness) { if (ModelState.IsValid) { appdevbusiness.DeletePhoto("images", id); } return(RedirectToAction("Index")); }
public async System.Threading.Tasks.Task <ActionResult> Details(string containername, string id) { CloudBlobContainer container = GetBlobContainer("images"); CloudBlockBlob blockblob = container.GetBlockBlobReference(id); ViewModelBlobs vm = new ViewModelBlobs(); AppDevBusiness appbusiness = new AppDevBusiness(); vm.Name = blockblob.Name; vm.details = blockblob.Uri.ToString(); Uri a = blockblob.Uri; vm.details = await appbusiness.detailsPic(a); return(View(vm)); }
public async Task <ActionResult> DeleteAsync(string id, AppDevBusiness appDevBusiness, string uriLink) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Student student = await DocumentDBRepository <Student> .GetItemAsync(id); string link = "https://appdevproject3.blob.core.windows.net/images" + id; if (link == uriLink) { appDevBusiness.DeletePhoto("images", id); } if (student == null) { return(HttpNotFound()); } return(View(student)); }
// GET: Blob public ActionResult Index(AppDevBusiness business) { return(View(business.GetPhotos("images"))); }
// GET: Blobs // GET: Blob public async System.Threading.Tasks.Task <ActionResult> Index(AppDevBusiness business) { return(View(await business.GetPhotos("images"))); }
public async Task <ActionResult> CreateAsync([Bind(Include = "Id,Name,Surname,Email,TelephoneNumber,CellphoneNumber,isActive,StudentNumber")] VM vm, AppDevBusiness appbusiness, PhotoUpload photo, HttpPostedFileBase file) { if (ModelState.IsValid) { Student s = new Student(); s.Name = vm.Name; s.Surname = vm.Surname; s.TelephoneNumber = vm.TelephoneNumber; s.isActive = vm.isActive; s.Id = vm.Id; s.Email = vm.Email; s.CellphoneNumber = vm.CellphoneNumber; photo.StudentNumber = vm.StudentNumber; String studentnumber = vm.Id; await DocumentDBRepository <Student> .CreateItemAsync(s); if (photo.FileUpload != null && photo.FileUpload.ContentLength > 0) { appbusiness.UploadPhoto("images", photo.FileUpload, studentnumber); } } return(RedirectToAction("Index")); }