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 _indexPost(HttpPostedFileBase fileBase) { if (fileBase.ContentLength > 0) { _myStorageService.Upload("imagenes" + (int)Session["idMov"], fileBase); } 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"] })); }