private void btnBuscar_Click(object sender, EventArgs e) { FaltanDatos.SetError(btnImportar, string.Empty); txtRuta.Text = ""; txtRuta.Enabled = false; string carpeta = (this.EsMarca) ? UtilLocal.RutaImagenesMarcas() : UtilLocal.RutaImagenesLineas(); lblArchivo.Text = BuscarGuardarArchivo(carpeta + SubCarpeta); }
////////// // MARCAS - SUB FUNCIONES private ListViewItem CargaMarcas(string MarcaId, string NombreMarca) { string sLlaveImg = MarcaId, sRutaImagen; sRutaImagen = UtilLocal.RutaImagenesMarcas(); sLlaveImg = ControlPicture.ImagenEnLista(this.ImagenesMarca, sLlaveImg, "(" + sLlaveImg + ").jpg", sRutaImagen); ListViewItem oElemento = new ListViewItem(new string[] { NombreMarca, MarcaId }, sLlaveImg); return(oElemento); }
public DetalleMarcaParte(int Id) { InitializeComponent(); Objeto.CargaLogo(Id.ToString(), picLogo, UtilLocal.RutaImagenesMarcas()); this.IdPAraObjeto = Id; try { //MarcaParte = General.GetEntityById<MarcaParte>("MarcaParte", "MarcaParteID", Id); MarcaParte = Datos.GetEntity <MarcaParte>(c => c.MarcaParteID == Id && c.Estatus); if (MarcaParte == null) { throw new EntityNotFoundException(Id.ToString(), "MarcaParte"); } EsNuevo = false; } catch (Exception ex) { Util.MensajeError(ex.Message, GlobalClass.NombreApp); } }
private void btnAddLogo_Click(object sender, EventArgs e) { Objeto.AbrirGuardarImg(this.IdPAraObjeto.ToString(), picLogo, UtilLocal.RutaImagenesMarcas()); Objeto.CargaLogo(this.IdPAraObjeto.ToString(), picLogo, UtilLocal.RutaImagenesMarcas()); }
private void listArchivos_DoubleClick(object sender, EventArgs e) { if (this.listArchivos.SelectedItems[0].ImageKey == "nulo") { return; } string ruta = (cliente == eModo.Lineas) ? UtilLocal.RutaImagenesLineas() : UtilLocal.RutaImagenesMarcas(); ruta += SubCarpeta; string target = ruta + this.listArchivos.SelectedItems[0].SubItems[3].Text; if (target.IndexOf("www.") > -1) { target = this.listArchivos.SelectedItems[0].SubItems[3].Text; } System.Diagnostics.Process.Start(target); }
private string tipoArchivo(string NombreArchivo) { string ruta = (cliente == eModo.Lineas) ? UtilLocal.RutaImagenesLineas() : UtilLocal.RutaImagenesMarcas(); ruta += SubCarpeta; string MiTipo = "nulo"; if (NombreArchivo.IndexOf("www.") > -1) { MiTipo = "htm"; } else if (System.IO.File.Exists(ruta + NombreArchivo)) { MiTipo = NombreArchivo.Substring(NombreArchivo.LastIndexOf('.') + 1).ToLower(); if (MiTipo.IndexOf("xls") > -1) { MiTipo = "xls"; } else if (MiTipo.IndexOf("doc") > -1) { MiTipo = "doc"; } else if (MiTipo.IndexOf("ppt") > -1) { MiTipo = "ppt"; } else if (MiTipo.IndexOf("pps") > -1) { MiTipo = "ppt"; } else if (MiTipo.IndexOf("jpg") > -1) { MiTipo = "jpg"; } else if (MiTipo.IndexOf("jpeg") > -1) { MiTipo = "jpg"; } else if (MiTipo.IndexOf("png") > -1) { MiTipo = "jpg"; } else if (MiTipo.IndexOf("gif") > -1) { MiTipo = "jpg"; } else if (MiTipo.IndexOf("bmp") > -1) { MiTipo = "jpg"; } else if (MiTipo.IndexOf("pdf") > -1) { MiTipo = "pdf"; } else if (MiTipo.IndexOf("txt") > -1) { MiTipo = "txt"; } } return(MiTipo); }