Example #1
0
 private void btAgregar_Click(object sender, EventArgs e)
 {
     if (this.consulta == "Marca")
     {
         FrmEdMarca frm = new FrmEdMarca();
         frm.con  = con;
         frm.Modo = "C";
         frm.ShowDialog();
     }
     else if (this.consulta == "Empleado")
     {
         FrmEdEmpleado frm = new FrmEdEmpleado();
         frm.con  = con;
         frm.Modo = "C";
         frm.ShowDialog();
     }
     else if (this.consulta == "Departamento")
     {
         FrmEdDepartamento frm = new FrmEdDepartamento();
         frm.con  = con;
         frm.Modo = "C";
         frm.ShowDialog();
     }
     else if (this.consulta == "Articulo")
     {
         FrmEdArticulo frm = new FrmEdArticulo();
         frm.con  = con;
         frm.Modo = "C";
         frm.ShowDialog();
     }
     else if (this.consulta == "UndMedida")
     {
         frmEdMedida frm = new frmEdMedida();
         frm.con  = con;
         frm.Modo = "C";
         frm.ShowDialog();
     }
     else if (this.consulta == "Orden")
     {
         FrmEdOrden frm = new FrmEdOrden();
         frm.con  = con;
         frm.Modo = "C";
         frm.ShowDialog();
     }
     else if (this.consulta == "Proveedor")
     {
         FrmEdProveedor frm = new FrmEdProveedor();
         frm.con  = con;
         frm.Modo = "C";
         frm.ShowDialog();
     }
     else if (this.consulta == "Solicitud")
     {
         frmEdSolicitud frm = new frmEdSolicitud();
         frm.con  = con;
         frm.Modo = "C";
         frm.ShowDialog();
     }
 }
Example #2
0
        private void dgvResultado_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (this.consulta == "Marca")
            {
                DataGridViewRow row = this.dgvResultado.SelectedRows[0];
                FrmEdMarca      frm = new FrmEdMarca();

                int idMarca = (int)row.Cells[0].Value;
                frm.IdMarca = idMarca;

                frm.Descripcion = row.Cells[1].Value.ToString();

                string estadoS = Convert.ToString(frm.Estado);
                estadoS = row.Cells[2].Value.ToString();

                frm.Modo = "E";
                frm.con  = con;
                frm.ShowDialog();
            }
            else if (this.consulta == "Departamento")
            {
                DataGridViewRow   row = this.dgvResultado.SelectedRows[0];
                FrmEdDepartamento frm = new FrmEdDepartamento();

                int idDepartamento = (int)row.Cells[0].Value;
                frm.IdDepartamento = idDepartamento;

                frm.Descripcion = row.Cells[1].Value.ToString();

                string estadoS = Convert.ToString(frm.Estado);
                estadoS = row.Cells[2].Value.ToString();

                frm.Modo = "E";
                frm.con  = con;
                frm.ShowDialog();
            }
            else if (this.consulta == "UndMedida")
            {
                DataGridViewRow row = this.dgvResultado.SelectedRows[0];
                frmEdMedida     frm = new frmEdMedida();


                int idUndMedida = (int)row.Cells[0].Value;
                frm.IdUndMedida = idUndMedida;

                frm.Descripcion = row.Cells[1].Value.ToString();

                string estadoS = Convert.ToString(frm.Estado);
                estadoS = row.Cells[2].Value.ToString();

                frm.Modo = "E";
                frm.con  = con;
                frm.ShowDialog();
            }
            else if (this.consulta == "Empleado")
            {
                DataGridViewRow row = this.dgvResultado.SelectedRows[0];
                FrmEdEmpleado   frm = new FrmEdEmpleado();

                int idEmpleado = (int)row.Cells[0].Value;
                frm.IdEmpleado = idEmpleado;

                frm.Cedula = row.Cells[1].Value.ToString();

                frm.Nombre = row.Cells[2].Value.ToString();

                int    Departamento  = frm.Departamento;
                string DepartamentoS = string.Empty + Departamento;
                DepartamentoS = row.Cells[3].Value.ToString();

                string estadoS = Convert.ToString(frm.Estado);
                estadoS = row.Cells[4].Value.ToString();

                frm.Modo = "E";
                frm.con  = con;
                frm.ShowDialog();
            }
            else if (this.consulta == "Articulo")
            {
                DataGridViewRow row = this.dgvResultado.SelectedRows[0];
                FrmEdArticulo   frm = new FrmEdArticulo();

                int idArticulo = (int)row.Cells[0].Value;
                frm.IdArticulo = idArticulo;

                frm.Descripcion = row.Cells[1].Value.ToString();

                int    Marca  = frm.Marca;
                string MarcaS = string.Empty + Marca;
                MarcaS = row.Cells[2].Value.ToString();

                int    Medida  = frm.Medida;
                string MedidaS = string.Empty + Medida;
                MedidaS = row.Cells[3].Value.ToString();

                int    Existencia  = frm.Existencia;
                string ExistenciaS = string.Empty + Existencia;
                ExistenciaS = row.Cells[4].Value.ToString();

                decimal Costo  = frm.Costo;
                string  CostoS = string.Empty + Costo;
                CostoS = row.Cells[5].Value.ToString();


                string estadoS = Convert.ToString(frm.Estado);
                estadoS = row.Cells[6].Value.ToString();

                frm.Modo = "E";
                frm.con  = con;
                frm.ShowDialog();
            }
            else if (this.consulta == "Orden")
            {
                DataGridViewRow row = this.dgvResultado.SelectedRows[0];
                FrmEdOrden      frm = new FrmEdOrden();

                int idOrden = (int)row.Cells[0].Value;
                frm.IdOrden = idOrden;

                int    Solicitud  = frm.Solicitud;
                string SolicitudS = string.Empty + Solicitud;
                SolicitudS = row.Cells[1].Value.ToString();

                string Fecha  = frm.Fecha;
                string FechaS = Convert.ToString(Fecha);
                FechaS = row.Cells[2].Value.ToString();

                string estadoS = Convert.ToString(frm.Estado);
                estadoS = row.Cells[3].Value.ToString();

                int    Articulo  = frm.Articulo;
                string ArticuloS = string.Empty + Articulo;
                ArticuloS = row.Cells[4].Value.ToString();

                int    Cantidad  = frm.Cantidad;
                string CantidadS = string.Empty + Cantidad;
                CantidadS = row.Cells[5].Value.ToString();

                int    Medida  = frm.Medida;
                string MedidaS = string.Empty + Medida;
                MedidaS = row.Cells[6].Value.ToString();


                int    Marca  = frm.Marca;
                string MarcaS = string.Empty + Marca;
                MarcaS = row.Cells[7].Value.ToString();

                decimal Costo  = frm.Costo;
                string  CostoS = string.Empty + Costo;
                CostoS = row.Cells[8].Value.ToString();

                frm.Modo = "E";
                frm.con  = con;
                frm.ShowDialog();
            }
            else if (this.consulta == "Proveedor")
            {
                DataGridViewRow row = this.dgvResultado.SelectedRows[0];
                FrmEdProveedor  frm = new FrmEdProveedor();

                int idProveedor = (int)row.Cells[0].Value;
                frm.IdProveedor = idProveedor;

                int    Tipo  = frm.TipoIdentificacion;
                string TipoS = string.Empty + Tipo;
                TipoS = row.Cells[1].Value.ToString();

                frm.Identificacion = row.Cells[2].Value.ToString();

                frm.Nombre = row.Cells[3].Value.ToString();

                string estadoS = Convert.ToString(frm.Estado);
                estadoS = row.Cells[4].Value.ToString();

                frm.Modo = "E";
                frm.con  = con;
                frm.ShowDialog();
            }
            else if (this.consulta == "Solicitud")
            {
                DataGridViewRow row = this.dgvResultado.SelectedRows[0];
                frmEdSolicitud  frm = new frmEdSolicitud();

                int idSolicitud = (int)row.Cells[0].Value;
                frm.IdSolicitud = idSolicitud;

                int    Empleado  = frm.Empleado;
                string EmpleadoS = string.Empty + Empleado;
                EmpleadoS = row.Cells[1].Value.ToString();

                String Fecha  = frm.Fecha;
                string FechaS = Convert.ToString(Fecha);
                FechaS = row.Cells[2].Value.ToString();


                int    Articulo  = frm.Articulo;
                string ArticuloS = string.Empty + Articulo;
                ArticuloS = row.Cells[3].Value.ToString();

                int    Cantidad  = frm.Cantidad;
                string CantidadS = string.Empty + Cantidad;
                CantidadS = row.Cells[4].Value.ToString();

                int    Medida  = frm.Medida;
                string MedidaS = string.Empty + Medida;
                MedidaS = row.Cells[5].Value.ToString();

                string estadoS = Convert.ToString(frm.Estado);
                estadoS = row.Cells[6].Value.ToString();

                frm.Modo = "E";
                frm.con  = con;
                frm.ShowDialog();
            }
        }