Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        ////////// // LINEAS - SUB FUNCIONES
        private ListViewItem CargaLineas(string LineaId, string NombreLinea)
        {
            string sLlaveImg = LineaId, sRutaImagen;

            sRutaImagen = UtilLocal.RutaImagenesLineas();
            sLlaveImg   = ControlPicture.ImagenEnLista(this.ImagenesLineas, sLlaveImg, "(" + sLlaveImg + ").jpg", sRutaImagen);

            ListViewItem oElemento = new ListViewItem(new string[] { NombreLinea, LineaId }, sLlaveImg);

            return(oElemento);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        public DetalleLinea(int Id)
        {
            InitializeComponent();
            Objeto.CargaLogo(Id.ToString(), picLogo, UtilLocal.RutaImagenesLineas());
            this.IdPAraObjeto = Id;

            //AbrirGuardarImg
            try
            {
                //Linea = General.GetEntityById<Linea>("Linea", "LineaID", Id);
                Linea = Datos.GetEntity <Linea>(c => c.LineaID == Id && c.Estatus);
                if (Linea == null)
                {
                    throw new EntityNotFoundException(Id.ToString(), "Linea");
                }
                EsNuevo = false;
            }
            catch (Exception ex)
            {
                Util.MensajeError(ex.Message, GlobalClass.NombreApp);
            }
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
 private void button1_Click(object sender, EventArgs e)
 {
     Objeto.AbrirGuardarImg(this.IdPAraObjeto.ToString(), picLogo, UtilLocal.RutaImagenesLineas());
     Objeto.CargaLogo(this.IdPAraObjeto.ToString(), picLogo, UtilLocal.RutaImagenesLineas());
 }