Beispiel #1
0
        public int AgregarAsignacion(CEAsignaciones asignacion)
        {
            Config.openConnection(connection);
            SqlCommand command = new SqlCommand("INV.ASIGNACIONES", connection);

            command.CommandType = CommandType.StoredProcedure;

            command.Parameters.AddWithValue("@OPERACION", "IA");
            command.Parameters.AddWithValue("@ASI_FECHA", asignacion.fecha);
            command.Parameters.AddWithValue("@EMP_CEDULA", asignacion.documento);
            command.Parameters.AddWithValue("@EMP_NOMBRES", asignacion.nombreCompleto);
            command.Parameters.AddWithValue("@ASI_TECLADO", asignacion.asiTeclado ? "S" : "N");
            command.Parameters.AddWithValue("@ASI_MOUSE", asignacion.asiMouse ? "S" : "N");
            command.Parameters.AddWithValue("@ASI_PUESTO", asignacion.asiPuesto ? "S" : "N");
            command.Parameters.AddWithValue("@ASI_BASE", asignacion.asiBase ? "S" : "N");
            command.Parameters.AddWithValue("@ASI_MALETIN", asignacion.asiMaletin ? "S" : "N");
            command.Parameters.AddWithValue("@ASI_MORRAL", asignacion.asiMorral ? "S" : "N");
            command.Parameters.AddWithValue("@ASI_CORREO", asignacion.asiCorreo ? "S" : "N");
            command.Parameters.AddWithValue("@ASI_ANULADO", asignacion.anulado ? "S" : "N");
            command.Parameters.AddWithValue("@ASI_OBSERVACION", asignacion.observacion);

            int Resultado = command.ExecuteNonQuery();

            Config.closeConnection(connection);
            return(Resultado);
        }
        public Agregar(CEAsignaciones asignacion)
        {
            InitializeComponent();

            this.asignacion = asignacion;
            asignaciones    = new CNAsignaciones();
        }
Beispiel #3
0
        public CEAsignaciones CargarEmpleadoDevolver(string Documento)
        {
            Config.openConnection(connection);
            CEAsignaciones empleadoDevolver = new CEAsignaciones();
            SqlCommand     command          = new SqlCommand("INV.DEVOLUCIONES", connection);

            command.CommandType = CommandType.StoredProcedure;

            command.Parameters.AddWithValue("@OPERACION", "CED");
            command.Parameters.AddWithValue("@EMP_CEDULA", Documento);

            SqlDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                empleadoDevolver = new CEAsignaciones
                {
                    asiTeclado = Convert.ToBoolean(reader.GetString(0)),
                    asiMouse   = Convert.ToBoolean(reader.GetString(1)),
                    asiPuesto  = Convert.ToBoolean(reader.GetString(2)),
                    asiBase    = Convert.ToBoolean(reader.GetString(3)),
                    asiMaletin = Convert.ToBoolean(reader.GetString(4)),
                    asiMorral  = Convert.ToBoolean(reader.GetString(5)),
                    asiCorreo  = Convert.ToBoolean(reader.GetString(6))
                };
            }
            reader.Close();
            Config.closeConnection(connection);
            return(empleadoDevolver);
        }
Beispiel #4
0
        public int AgregarDocumentoPrestamo(CEAsignaciones asignacion)
        {
            Config.openConnection(connection);
            SqlCommand command = new SqlCommand("INV.PRESTAMOS", connection);

            command.CommandType = CommandType.StoredProcedure;

            command.Parameters.AddWithValue("@OPERACION", "ADP");
            command.Parameters.AddWithValue("PRES_ID", asignacion.id);
            command.Parameters.AddWithValue("ARCHIVO", asignacion.archivo);

            int Resultado = command.ExecuteNonQuery();

            Config.closeConnection(connection);
            return(Resultado);
        }
Beispiel #5
0
        public int AgregarPrestamoDetalle(CEAsignaciones asignacion)
        {
            Config.openConnection(connection);
            SqlCommand command = new SqlCommand("INV.PRESTAMOS", connection);

            command.CommandType = CommandType.StoredProcedure;

            command.Parameters.AddWithValue("@OPERACION", "IPD");
            command.Parameters.AddWithValue("PRESDE_ID", asignacion.id);
            command.Parameters.AddWithValue("EQ_CODIGO", asignacion.equipoCodigo);
            command.Parameters.AddWithValue("EQ_DESCRIPCION", asignacion.equipoDescripcion);
            command.Parameters.AddWithValue("EQ_MODELO", asignacion.modelo.id);
            command.Parameters.AddWithValue("EQ_OBSERVACION", asignacion.observacion);
            command.Parameters.AddWithValue("EMP_CEDULA", asignacion.documento);
            int Resultado = command.ExecuteNonQuery();

            Config.closeConnection(connection);
            return(Resultado);
        }
Beispiel #6
0
        public int AgregarDevolucionDetalle(CEAsignaciones asignacion)
        {
            Config.openConnection(connection);
            SqlCommand command = new SqlCommand("INV.DEVOLUCIONES", connection);

            command.CommandType = CommandType.StoredProcedure;

            command.Parameters.AddWithValue("@OPERACION", "IDD");
            command.Parameters.AddWithValue("@ID", asignacion.id);
            command.Parameters.AddWithValue("@EQ_CODIGO", asignacion.equipoCodigo);
            command.Parameters.AddWithValue("@EQ_DESCRIPCION", asignacion.equipoDescripcion);
            command.Parameters.AddWithValue("@EQ_MODELO", asignacion.modelo.id);
            command.Parameters.AddWithValue("@EQ_OBSERVACION", asignacion.observacion);

            int Resultado = command.ExecuteNonQuery();

            Config.closeConnection(connection);
            return(Resultado);
        }
Beispiel #7
0
        private void tblDevolucionesFilter_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex >= 0)
                {
                    CEAsignaciones asignacion = new CEAsignaciones
                    {
                        id             = Convert.ToInt32(tblDevolucionesFilter.Rows[e.RowIndex].Cells["NUMERO"].Value),
                        documento      = tblDevolucionesFilter.Rows[e.RowIndex].Cells["DOCUMENTO"].Value.ToString(),
                        nombreCompleto = tblDevolucionesFilter.Rows[e.RowIndex].Cells["NOMBRES"].Value.ToString(),
                        fecha          = tblDevolucionesFilter.Rows[e.RowIndex].Cells["FECHA"].Value.ToString(),
                        asiTeclado     = Convert.ToBoolean(tblDevolucionesFilter.Rows[e.RowIndex].Cells["TECLADO"].Value),
                        asiMouse       = Convert.ToBoolean(tblDevolucionesFilter.Rows[e.RowIndex].Cells["MOUSE"].Value),
                        asiPuesto      = Convert.ToBoolean(tblDevolucionesFilter.Rows[e.RowIndex].Cells["PUESTO"].Value),
                        asiBase        = Convert.ToBoolean(tblDevolucionesFilter.Rows[e.RowIndex].Cells["BASE"].Value),
                        asiMaletin     = Convert.ToBoolean(tblDevolucionesFilter.Rows[e.RowIndex].Cells["MALETIN"].Value),
                        asiMorral      = Convert.ToBoolean(tblDevolucionesFilter.Rows[e.RowIndex].Cells["MORRAL"].Value),
                        asiCorreo      = Convert.ToBoolean(tblDevolucionesFilter.Rows[e.RowIndex].Cells["CORREO"].Value),
                        anulado        = Convert.ToBoolean(tblDevolucionesFilter.Rows[e.RowIndex].Cells["ANULADO"].Value),
                        observacion    = tblDevolucionesFilter.Rows[e.RowIndex].Cells["OBSERVACIONES"].Value.ToString(),
                        fechaModifi    = tblDevolucionesFilter.Rows[e.RowIndex].Cells["FECHAMODIFI"].Value.ToString(),
                        usuarioModifi  = tblDevolucionesFilter.Rows[e.RowIndex].Cells["USUMODIFI"].Value.ToString()
                    };

                    Agregar A = new Agregar(asignacion);
                    A.TopLevel = false;
                    A.Dock     = DockStyle.None;
                    Controls.Add(A);
                    Tag        = "C"; // ESTABLECE EL TAG EN MODO CONSULTA PARA NO VOLVER A CARGAR LA DATA A LA TABLA.
                    A.Location = new Point(50, 50);
                    A.BringToFront();
                    A.FormClosed += new FormClosedEventHandler(A_FormClosed);
                    A.Show();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #8
0
        private void btnActa_Click(object sender, EventArgs e)
        {
            try
            {
                int            rowIndex   = tblDevolucionesFilter.SelectedRows[0].Index;
                CEAsignaciones asignacion = new CEAsignaciones
                {
                    id               = Convert.ToInt32(tblDevolucionesFilter.Rows[rowIndex].Cells["NUMERO"].Value),
                    codigo           = Convert.ToInt32(tblDevolucionesFilter.Rows[rowIndex].Cells["CODIGO"].Value),
                    documento        = tblDevolucionesFilter.Rows[rowIndex].Cells["DOCUMENTO"].Value.ToString(),
                    nombreCompleto   = tblDevolucionesFilter.Rows[rowIndex].Cells["NOMBRES"].Value.ToString(),
                    fecha            = tblDevolucionesFilter.Rows[rowIndex].Cells["FECHA"].Value.ToString(),
                    asiTeclado       = Convert.ToBoolean(tblDevolucionesFilter.Rows[rowIndex].Cells["TECLADO"].Value),
                    asiMouse         = Convert.ToBoolean(tblDevolucionesFilter.Rows[rowIndex].Cells["MOUSE"].Value),
                    asiPuesto        = Convert.ToBoolean(tblDevolucionesFilter.Rows[rowIndex].Cells["PUESTO"].Value),
                    asiBase          = Convert.ToBoolean(tblDevolucionesFilter.Rows[rowIndex].Cells["BASE"].Value),
                    asiMaletin       = Convert.ToBoolean(tblDevolucionesFilter.Rows[rowIndex].Cells["MALETIN"].Value),
                    asiMorral        = Convert.ToBoolean(tblDevolucionesFilter.Rows[rowIndex].Cells["MORRAL"].Value),
                    asiCorreo        = Convert.ToBoolean(tblDevolucionesFilter.Rows[rowIndex].Cells["CORREO"].Value),
                    anulado          = Convert.ToBoolean(tblDevolucionesFilter.Rows[rowIndex].Cells["ANULADO"].Value),
                    observacion      = tblDevolucionesFilter.Rows[rowIndex].Cells["OBSERVACIONES"].Value.ToString(),
                    fechaModifi      = tblDevolucionesFilter.Rows[rowIndex].Cells["FECHAMODIFI"].Value.ToString(),
                    usuarioModifi    = tblDevolucionesFilter.Rows[rowIndex].Cells["USUMODIFI"].Value.ToString(),
                    usuarioDocumento = tblDevolucionesFilter.Rows[rowIndex].Cells["USUDOCUMENTO"].Value.ToString(),
                    usuarioNombres   = tblDevolucionesFilter.Rows[rowIndex].Cells["USUNOMBRES"].Value.ToString(),
                };

                Acta actaDevolucion = new Acta(asignacion);
                actaDevolucion.WindowState = FormWindowState.Maximized;
                actaDevolucion.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Se presento el siguiente error: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #9
0
        public Acta(CEAsignaciones asignacion)
        {
            InitializeComponent();

            this.asignacion = asignacion;
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                bool detalle = true;

                if (tblPrestar.Rows.Count < 2)
                {
                    DialogResult resultado = MessageBox.Show("¿Esta seguro que no se devuelve ningun equipo?", "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                    if (resultado == DialogResult.OK)
                    {
                        detalle = false;
                    }
                    else
                    {
                        return;
                    }
                }
                CEAsignaciones prestar = new CEAsignaciones
                {
                    documento      = txtDocumento.Text,
                    nombreCompleto = txtNombres.Text,
                    fecha          = DateSelect.Text.ToString(),
                    asiTeclado     = chkTeclado.Checked,
                    asiMouse       = chkMouse.Checked,
                    asiBase        = chkBase.Checked,
                    asiMaletin     = chkMaletin.Checked,
                    asiMorral      = chkMorral.Checked,
                    asiPuesto      = chkPuesto.Checked,
                    asiCorreo      = chkCorreo.Checked,
                    anulado        = false,
                    observacion    = txtObservaciones.Text.ToString()
                };

                if (asignaciones.AgregarPrestamo(prestar) > 0)
                {
                    if (detalle)
                    {
                        int id = asignaciones.MaximoIdPrestamo();
                        foreach (CEEquipo equipo in equipos)
                        {
                            prestar.id                = id;
                            prestar.equipoCodigo      = equipo.equipoCodigo;
                            prestar.equipoDescripcion = equipo.equipoDescripcion;
                            prestar.observacion       = equipo.observacion;
                            prestar.modelo            = new CEModelo {
                                id = equipo.modelo.id
                            };

                            asignaciones.AgregarPrestamoDetalle(prestar);
                        }
                        Close();
                    }
                }
                else
                {
                    Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Se presento el siguiente error: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #11
0
 public int AgregarDocumentoDevolucion(CEAsignaciones asignacion)
 {
     return(asignaciones.AgregarDocumentoDevolucion(asignacion));
 }
Beispiel #12
0
 public int AgregarDevolucionDetalle(CEAsignaciones asignacion)
 {
     return(asignaciones.AgregarDevolucionDetalle(asignacion));
 }
Beispiel #13
0
 public int AgregarAsignacion(CEAsignaciones asignacion)
 {
     return(asignaciones.AgregarAsignacion(asignacion));
 }
Beispiel #14
0
 public int AgregarDocumentoPrestamo(CEAsignaciones asignacion)
 {
     return(asignaciones.AgregarDocumentoPrestamo(asignacion));
 }
Beispiel #15
0
 public int AgregarPrestamoDetalle(CEAsignaciones asignacion)
 {
     return(asignaciones.AgregarPrestamoDetalle(asignacion));
 }