public ActionResult FilesUploadAjax(string guidlist, string deleteid) { FileManagerProvider manager = new FileManagerProvider(); string username = GetCurrentUserName(); if (!string.IsNullOrEmpty(guidlist)) { using (CuteWebUI.MvcUploader uploader = new CuteWebUI.MvcUploader(System.Web.HttpContext.Current)) { foreach (string strguid in guidlist.Split('/')) { CuteWebUI.MvcUploadFile file = uploader.GetUploadedFile(new Guid(strguid)); if (file == null) { continue; } //savefile here manager.MoveFile(username, file.GetTempFilePath(), file.FileName, null); } } } if (!string.IsNullOrEmpty(deleteid)) { FileItem file = manager.GetFileByID(username, deleteid); if (file != null) { file.Delete(); } } FileItem[] files = manager.GetFiles(username); Array.Reverse(files); FileManagerJsonItem[] items = new FileManagerJsonItem[files.Length]; string baseurl = Response.ApplyAppPathModifier("~/FileManagerDownload.ashx?user="******"&file="); for (int i = 0; i < files.Length; i++) { FileItem file = files[i]; FileManagerJsonItem item = new FileManagerJsonItem(); item.FileID = file.FileID; item.FileName = file.FileName; item.Description = file.Description; item.UploadTime = file.UploadTime.ToString("yyyy-MM-dd HH:mm:ss"); item.FileSize = file.FileSize; item.FileUrl = baseurl + file.FileID; items[i] = item; } JsonResult json = new JsonResult(); json.Data = items; return(json); }
private static void ListaImagenProperty_Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e) { var obj = (AutenticacionView)sender; if (e.NewValue != null && ((List <byte[]>)(e.NewValue)).Count > 0) { var fileManagerProvider = new FileManagerProvider(); var lista_bitmaps = new List <ImageSource>(); foreach (var item in (List <byte[]>)(e.NewValue)) { lista_bitmaps.Add(fileManagerProvider.byteToImageSource(item)); } obj.animacionHuella.Load(lista_bitmaps); obj.animacionHuella.FrozeenImage(); } }
private void limpiarCampos() { ID = null; Activo = true; Descripcion = null; Nombre = null; Filename = null; if (string.IsNullOrWhiteSpace(_usuario.Almacen_Grupo)) { SelectedAlmacen_Grupo = Almacen_Grupos.FirstOrDefault(w => w.ID_ALMACEN_GRUPO == ""); } else { SelectedAlmacen_Grupo = Almacen_Grupos.FirstOrDefault(); } SelectedProducto_Categoria = Producto_Categorias.FirstOrDefault(w => w.ID_CATEGORIA == -1); SelectedProducto_Presentacion = Producto_Presentaciones.FirstOrDefault(w => w.ID_PRESENTACION == -1);; SelectedProducto_SubcategoriaValue = -1; SelectedProducto_Unidad_Medida = Producto_Unidades_Medida.FirstOrDefault(w => w.ID_UNIDAD_MEDIDA == -1); SelectedAlmacen_Tipo_Cat = null; IsSubcategoriaVisible = false; ImagenData = new FileManagerProvider().fileToByteArray("pack://application:,,,/GESAL;component/Resources/Images/nophoto.png"); }