public void CreatePostAsync(Contenido cont, HttpPostedFileBase uploadFile) { if (uploadFile == null || (uploadFile != null && uploadFile.ContentLength > 0)) { if (uploadFile != null && uploadFile.ContentLength > 0) { MyStorageService _myStorageService = new MyStorageService(); _myStorageService.Upload("contenido" + (int)Session["idMov"], uploadFile); cont.Ubicacion = "http://repoindignado.blob.core.windows.net/contenido" + (int)Session["idMov"] + "/" + uploadFile.FileName; } AsyncManager.OutstandingOperations.Increment(); cont.EspecificacionUsuarioId = (int)Session["idUsr"]; var front = new FrontOffice.FrontOfficeServiceClient(); front.CompartirContenidoCompleted += (s, e) => { AsyncManager.Parameters["exito"] = !e.Cancelled; AsyncManager.OutstandingOperations.Decrement(); }; front.CompartirContenidoAsync(cont); } else { AsyncManager.Parameters["exito"] = false; } }
public ActionResult DeleteImg(string id) { MyStorageService storage = new MyStorageService(); storage.DeleteBlob("imagenes" + (int)Session["idMovEdit"], id); return(RedirectToAction("index")); }
public ActionResult DeletePostCompleted(int item) { MyStorageService storage = new MyStorageService(); storage.DeleteContainer("imagenes" + item); storage.DeleteContainer("contenido" + item); return(RedirectToAction("Index")); }
public ActionResult _upfilePost(Movimiento item, HttpPostedFileBase fileBase) { if (fileBase.ContentLength > 0) { MyStorageService storage = new MyStorageService(); storage.Upload("imagenes" + (int)Session["idMovEdit"], fileBase); } return(RedirectToAction("Edit", new { id = (int)Session["idMovEdit"] })); }
public ActionResult EditGetCompleted(Movimiento item) { if (item.Id != null) { Session["idMovEdit"] = item.Id; MyStorageService storage = new MyStorageService(); List <CloudBlob> blobs; storage.ListBlobs("imagenes" + item.Id.ToString(), out blobs); ViewBag.Blobs = blobs; } return(View(item)); }