Beispiel #1
0
        private void cmbNombreLogo_SelectionChangeCommitted(object sender, EventArgs e)
        {
            try
            {
                this._logo = (Modelos.Logo) this.cmbNombreLogo.SelectedItem;

                this.pbSelLogo.Image = Modelos.Utilerias.ByteToImage(_logo.logo);
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message, "Configuración", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Beispiel #2
0
        private void cmbUso_SelectionChangeCommitted(object sender, EventArgs e)
        {
            try
            {
                // validaciones
                if (this.cmbUso.SelectedIndex == -1)
                {
                    throw new Exception("Seleccione un uso");
                }

                int idUso = (int)this.cmbUso.SelectedValue;

                List <Modelos.Logo> logos = this._catalogosNegocio.getLogos(idUso, "A");

                this.pbSelLogo.Image = null;

                // llenar combo de usos
                this.cmbNombreLogo.DisplayMember = "nombre";
                this.cmbNombreLogo.ValueMember   = "idLogo";
                this.cmbNombreLogo.DataSource    = logos;

                int seleccionado = logos.Where(w => string.IsNullOrEmpty(w.clave) == false).Select(s => s.idLogo).FirstOrDefault();

                this.cmbNombreLogo.SelectedValue = seleccionado;

                this._logo = (Modelos.Logo) this.cmbNombreLogo.SelectedItem;

                if (this._logo != null)
                {
                    this.btnSeleccionar.Text = "Cambiar Selección";
                    this.pbSelLogo.Image     = Modelos.Utilerias.ByteToImage(_logo.logo);
                }
                else
                {
                    this.btnSeleccionar.Text = "Seleccionar";
                }
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message, "Configuración", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Beispiel #3
0
        private void btnQuitaLogo_Click(object sender, EventArgs e)
        {
            try
            {
                if (this._logo == null)
                {
                    return;
                }

                this.cmbNombreLogo.SelectedIndex = -1;
                this.pbSelLogo.Image             = null;

                this._logo = null;

                this._quitaLogo = true;

                this.btnSeleccionar.Text = "Guardar Cambio";
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message, "Configuración", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Beispiel #4
0
        private void btnVistaPrevia_Click(object sender, EventArgs e)
        {
            try
            {
                if (this._responsiva == null)
                {
                    throw new Exception("Seleccione una persona");
                }

                Modelos.Responsivas responsiva = new Modelos.Responsivas();

                DateTime thisDay = DateTime.Today;

                responsiva.fechaImpresion = thisDay.ToString("d");

                frmReporteActivosPersona form = new frmReporteActivosPersona();

                List <Modelos.Activos> activos = new List <Modelos.Activos>();

                // cambia activos
                foreach (Modelos.Activos ac in this._activos)
                {
                    string   descripcion = ac.descripcion.Replace("---", ";");
                    string[] array       = descripcion.Split(';');

                    descripcion = (!string.IsNullOrEmpty(array[0]) ? "Marca: " + array[0] + "; " : string.Empty) +
                                  (!string.IsNullOrEmpty(array[1]) ? "Modelo: " + array[1] + ";\n" : string.Empty) +
                                  (!string.IsNullOrEmpty(array[2]) ? "Núm. Serie: " + array[2] + ";\n" : string.Empty) +
                                  (!string.IsNullOrEmpty(array[3]) ? "Color: " + array[3] + "; " : string.Empty) +
                                  (!string.IsNullOrEmpty(array[4]) ? "Costo: " + array[4] + "; " : string.Empty) +
                                  (!string.IsNullOrEmpty(array[5]) ? "Factura: " + array[5] + ";\n" : string.Empty) +
                                  (!string.IsNullOrEmpty(array[6]) ? "Detalles: " + array[6] + ";\n" : string.Empty);

                    activos.Add(new Modelos.Activos
                    {
                        accion            = ac.accion,
                        area              = ac.area,
                        costo             = ac.costo,
                        claveActivo       = ac.claveActivo,
                        descripcion       = descripcion.Trim(),
                        fechaAlta         = ac.fechaAlta,
                        fechaModificacion = ac.fechaModificacion,
                        idActivo          = ac.idActivo,
                        idArea            = ac.idArea,
                        idTipo            = ac.idTipo,
                        idUsuarioAlta     = ac.idUsuarioAlta,
                        idUsuarioModifica = ac.idUsuarioModifica,
                        nombreCorto       = ac.nombreCorto,
                        numEtiqueta       = ac.numEtiqueta,
                        seleccionado      = ac.seleccionado,
                        status            = ac.status,
                        tipo              = ac.tipo
                    });
                }

                responsiva.puesto      = this._responsiva.puesto;
                responsiva.responsable = this._responsiva.nombre;
                responsiva.sucursal    = this._responsiva.sucursal;

                // obtiene logo
                Modelos.Logo logo = this._responsivasNegocio.obtieneLogo("reportes");

                form._logo        = logo;
                form._activos     = activos;
                form._responsivas = responsiva;

                form._empresa = Modelos.Login.empresa;

                // bitacora
                this._catalogosNegocio.generaBitacora(
                    "Genera Reporte 'Activos por Persona' con parametros:" +
                    " sucursal: " + responsiva.sucursal +
                    " responsable: " + responsiva.responsable +
                    (this.cbBajas.Checked ? " BAJAS ": string.Empty) +
                    (this.cbReparacion.Checked ? " REPARACIONES " : string.Empty), "CONSULTAS");

                form.Show();
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message, "Responsivas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
        private void btnImprimir_Click(object sender, EventArgs e)
        {
            try
            {
                if (this._responsiva == null)
                {
                    throw new Exception("Seleccione una responsiva");
                }


                string fecIng = this.dtpFechaImpr.Value.ToString("dd-MM-yyyy");
                this._responsiva.fechaImpresion = fecIng;

                frmResponsivaReporte form = new frmResponsivaReporte();

                List <Modelos.Activos> activos = new List <Modelos.Activos>();

                // cambia activos
                foreach (Modelos.Activos ac in this._activos)
                {
                    string   descripcion = ac.descripcion.Replace("&", ";");
                    string[] array       = descripcion.Split(';');

                    descripcion = (!string.IsNullOrEmpty(array[0]) ? " Marca: " + array[0] + ";" : string.Empty) +
                                  (!string.IsNullOrEmpty(array[1]) ? " Modelo: " + array[1] + ";" : string.Empty) +
                                  (!string.IsNullOrEmpty(array[2]) ? " Núm. Serie: " + array[2] + ";" : string.Empty) +
                                  (!string.IsNullOrEmpty(array[3]) ? " Color: " + array[3] + ";" : string.Empty) +
                                  (!string.IsNullOrEmpty(array[4]) ? " Costo: " + array[4] + ";" : string.Empty) +
                                  (!string.IsNullOrEmpty(array[5]) ? " Factura: " + array[5] + ";" : string.Empty) +
                                  (!string.IsNullOrEmpty(array[6]) ? " \nFecha: " + array[6] + ";" : string.Empty) +
                                  (!string.IsNullOrEmpty(array[6]) ? " \nDetalles: " + array[7] + ";" : string.Empty);

                    activos.Add(new Modelos.Activos
                    {
                        accion            = ac.accion,
                        area              = ac.area,
                        costo             = ac.costo,
                        claveActivo       = ac.claveActivo,
                        descripcion       = descripcion.Trim(),
                        fechaAlta         = ac.fechaAlta,
                        fechaModificacion = ac.fechaModificacion,
                        idActivo          = ac.idActivo,
                        idArea            = ac.idArea,
                        idTipo            = ac.idTipo,
                        idUsuarioAlta     = ac.idUsuarioAlta,
                        idUsuarioModifica = ac.idUsuarioModifica,
                        nombreCorto       = ac.nombreCorto,
                        numEtiqueta       = ac.numEtiqueta,
                        seleccionado      = ac.seleccionado,
                        status            = ac.status,
                        tipo              = ac.tipo
                    });
                }

                // obtiene responsables
                List <Modelos.PersonaResponsivas> responsables = this._responsivasNegocio.obtieneResponsables(this._responsiva.idResponsiva);

                // obtiene logo
                Modelos.Logo logo = this._responsivasNegocio.obtieneLogo("reportes");

                form._logo         = logo;
                form._responsables = responsables;
                form._activos      = activos;
                form._responsivas  = this._responsiva;

                form._empresa = Modelos.Login.empresa;

                form.Show();


                // bitacora
                this._catalogosNegocio.generaBitacora(
                    "Se genero la vista previa de la responsiva " + this._responsiva.idResponsiva, "RESPONSIVAS");
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message, "Responsivas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Beispiel #6
0
        private void btnVistaPrevia_Click(object sender, EventArgs e)
        {
            try
            {
                // validaciones
                if (this._responsiva == null)
                {
                    throw new Exception("Realice una búsqueda");
                }

                frmReporteRespSucXResp form    = new frmReporteRespSucXResp();
                List <Modelos.Activos> activos = new List <Modelos.Activos>();

                // cambia activos
                foreach (Modelos.Activos ac in this._activos)
                {
                    string   descripcion = ac.descripcion.Replace("---", ";");
                    string[] array       = descripcion.Split(';');

                    descripcion = (!string.IsNullOrEmpty(array[0]) ? " Marca: " + array[0] + ";" : string.Empty) +
                                  (!string.IsNullOrEmpty(array[1]) ? " Modelo: " + array[1] + ";" : string.Empty) +
                                  (!string.IsNullOrEmpty(array[2]) ? " Núm. Serie: " + array[2] + ";" : string.Empty) +
                                  (!string.IsNullOrEmpty(array[3]) ? " Color: " + array[3] + ";" : string.Empty) +
                                  (!string.IsNullOrEmpty(array[4]) ? " Costo: " + array[4] + ";" : string.Empty) +
                                  (!string.IsNullOrEmpty(array[5]) ? " Factura: " + array[5] + ";" : string.Empty) +
                                  (!string.IsNullOrEmpty(array[6]) ? " \nDetalles: " + array[6] + ";" : string.Empty);

                    activos.Add(new Modelos.Activos
                    {
                        accion            = ac.accion,
                        area              = ac.area,
                        costo             = ac.costo,
                        claveActivo       = ac.claveActivo,
                        descripcion       = descripcion.Trim(),
                        fechaAlta         = ac.fechaAlta,
                        fechaModificacion = ac.fechaModificacion,
                        idActivo          = ac.idActivo,
                        idArea            = ac.idArea,
                        idTipo            = ac.idTipo,
                        idUsuarioAlta     = ac.idUsuarioAlta,
                        idUsuarioModifica = ac.idUsuarioModifica,
                        nombreCorto       = ac.nombreCorto,
                        numEtiqueta       = ac.numEtiqueta,
                        seleccionado      = ac.seleccionado,
                        status            = ac.status,
                        tipo              = ac.tipo
                    });
                }

                // obtiene responsables
                List <Modelos.PersonaResponsivas> responsables = this._responsivasNegocio.obtieneResponsables(this._responsiva.idResponsiva);

                // obtiene logo
                Modelos.Logo logo = this._responsivasNegocio.obtieneLogo("reportes");

                List <Modelos.PersonaResponsivas> responsable = new List <Modelos.PersonaResponsivas>();
                responsable.Add(new Modelos.PersonaResponsivas
                {
                    sucursal = this._sucursal,
                    nombre   = this._responsiva.responsable
                });

                form._logo         = logo;
                form._responsables = responsable;
                form._activos      = activos;
                form._folio        = this._responsiva.idResponsiva;

                // bitacora
                this._catalogosNegocio.generaBitacora(
                    "Genera Reporte 'Responsivas por sucursal' con parametros:" +
                    " sucursal: " + this._sucursal + ", responsiva folio " + this._responsiva.idResponsiva, "CONSULTAS");

                form.Show();
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message, "Reponsivas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }