Example #1
0
        private void cmdGuardar_Click(object sender, EventArgs e)
        {
            if (IsValidEmail(this.txtID.Text) == true)
            {
                try
                {
                    objDatos.Conectar();
                    string sql = "exec inserta_actualiza_notificacion_correos " + this.textBox2.Text + ",'" + this.txtID.Text + "'";
                    if (objDatos.Insertar(sql))
                    {
                        objDatos.Desconectar();
                        MessageBox.Show("Registro Insertado");
                    }
                    else
                    {
                        MessageBox.Show("Registro no pudo ser insertado");
                    }
                }
                catch (System.Data.SqlClient.SqlException ex)
                {
                    MessageBox.Show(ex.Message.ToString());
                }
            }

            else
            {
                MessageBox.Show("Correo invalido");
            }
        }
Example #2
0
        public void cargarMarcas()
        {
            this.txtID.Text          = "Nuevo";
            this.txtMarca.Text       = "";
            this.txtUsuario.Text     = "";
            this.txtContrasena1.Text = "";
            this.txtContrasena2.Text = "";
            txtFecha.Text            = DateTime.Now.Date.Date.ToString("yyyy-MM-dd");
            this.txtHora.Text        = DateTime.Now.ToString("h:mm:ss tt");
            this.txtMarca.Focus();
            this.txtID.Enabled = false;
            objDatos.Conectar();

            string sring = ("exec obtenerUsuarios");

            objDatos.Consulta_llenar_datos(sring);

            this.miFiltro = (objDatos.ds.Tables[0].DefaultView);
            this.dataGridView1.DataSource = miFiltro;

            this.dataGridView1.Columns[0].Width      = 30;
            this.dataGridView1.Columns[0].HeaderText = "ID";
            this.dataGridView1.Columns[1].Width      = 100;
            this.dataGridView1.Columns[1].HeaderText = "Nombre Usuario";
            this.dataGridView1.Columns[2].Width      = 80;
            this.dataGridView1.Columns[2].HeaderText = "Usuario";
            this.dataGridView1.Columns[3].Width      = 100;
            this.dataGridView1.Columns[3].HeaderText = "Contraseña";
            this.dataGridView1.Columns[4].Width      = 60;
            this.dataGridView1.Columns[4].HeaderText = "Fecha Creacion";
            this.dataGridView1.Columns[5].Width      = 60;
            this.dataGridView1.Columns[5].HeaderText = "Hora Creacion";
            this.dataGridView1.Columns[6].Width      = 60;
            this.dataGridView1.Columns[6].HeaderText = "Codigo Perfil";
            this.dataGridView1.Columns[7].Width      = 83;
            this.dataGridView1.Columns[7].HeaderText = "Perfil Asignado";

            this.dataGridView1.RowHeadersVisible          = false;
            this.dataGridView1.DefaultCellStyle.ForeColor = Color.Black;

            this.dataGridView1.RowsDefaultCellStyle.BackColor            = Color.AliceBlue;
            this.dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.White;
            this.dataGridView1.AllowUserToAddRows      = false;
            this.dataGridView1.AllowUserToDeleteRows   = false;
            this.dataGridView1.AllowUserToOrderColumns = false;
            this.dataGridView1.AllowUserToResizeRows   = false;
            this.dataGridView1.ReadOnly                = true;
            this.dataGridView1.SelectionMode           = DataGridViewSelectionMode.FullRowSelect;
            this.dataGridView1.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
            this.dataGridView1.MultiSelect             = false;
            this.dataGridView1.EditMode                = DataGridViewEditMode.EditProgrammatically;
            this.cmdEliminar.Enabled = false;
            this.dataGridView1.ClearSelection();

            this.cmbPerfiles.DataSource    = objDatos.ConsultaTabla("perfiles_usuarios", " descripcion");
            this.cmbPerfiles.DisplayMember = "descripcion";
            this.cmbPerfiles.ValueMember   = "nivel";

            objDatos.Desconectar();
        }
Example #3
0
 private void actualizarDatosFactura()
 {
     objDatos.Conectar();
     objDatos.Consulta_llenar_datos("select cpp.numfac_fac as 'No. Fac.',cpp.codigo_cpp as 'CxP',cpp.fecha as 'Fecha Factura',cpp.monto as 'Monto',u.nombre_usuario as 'Usuario',cpp.ncf_ncf as 'NCF',tf.descri_fac as 'Tipo Factura',cpp.saldo_final as 'Balance',cpp.codigo_suplidor as 'Codigo Suplidor', cpp.Saldar as 'Saldar' from tipo_factura tf,usuarios u,cuentas_por_pagar cpp where cpp.codtip_fac = tf.codtip_fac and cpp.codigo_usuario = u.codigo_usuario and cpp.saldo_final > 0 and cpp.codigo_suplidor = " + CodigoCliente.ToString() + "");
     if (objDatos.ds.Tables[0].Rows.Count > 0)
     {
         int nSaldar = ((int)objDatos.ds.Tables[0].Rows.Count) - 1;
         this.miFiltro = (objDatos.ds.Tables[0].DefaultView);
         this.dataGridView1.DataSource       = miFiltro;
         this.dataGridView1.Columns[0].Width = 60;
         this.dataGridView1.Columns[1].Width = 60;
         this.dataGridView1.Columns[2].Width = 80;
         this.dataGridView1.Columns[3].Width = 70;
         this.dataGridView1.Columns[4].Width = 95;
         this.dataGridView1.Columns[5].Width = 139;
         this.dataGridView1.Columns[6].Width = 99;
         this.dataGridView1.Columns[7].Width = 65;
         this.dataGridView1.Columns[8].Width = 88;
         this.dataGridView1.Columns[9].Width = 50;
     }
     else
     {
         MessageBox.Show("El suplidor " + this.txtNombreCliente.Text.TrimEnd() + ", no tiene cuentas por pagar pendientes");
     }
 }
Example #4
0
 private void txtCamion_TextChanged(object sender, EventArgs e)
 {
     if (this.txtCamion.Text != "Nuevo")
     {
         objDatos.Conectar();
         objDatos.Consulta_llenar_datos("select m.descripcion + ' '  + mv.descripcion + ' año ' + convert(varchar(4),v.anoveh_veh) + ', Placa ' + convert(varchar(12),v.numpla_veh) + ' Chasis ' +  convert(varchar(17),v.numcha_veh) as vehiculo,mav.aceite,mav.seguro,mav.correa_tiempo,mav.frenos,mav.codigo_mantenimiento_vehiculos from vehiculo v, marca_articulos m, tipo_vehiculos tv, modelos_vehiculos mv, colores c, mantenimiento_vehiculos mav where v.codigo_marca = m.codigo_marca and v.codigo_tipo_vehiculo = tv.codigo_tipo_vehiculo and v.codigo_modelos =mv.codigo_modelos and c.codigo_color = v.codigo_color and mav.codveh_veh = v.codveh_veh and v.codveh_veh = " + txtCamion.Text);
         if (objDatos.ds.Tables[0].Rows.Count > 0)
         {
             this.lblDatosCamion.Text  = objDatos.ds.Tables[0].Rows[0][0].ToString();
             this.txtAceite.Text       = objDatos.ds.Tables[0].Rows[0][1].ToString();
             dateTimePicker1.Text      = objDatos.ds.Tables[0].Rows[0][2].ToString();
             this.txtCorreaTiempo.Text = objDatos.ds.Tables[0].Rows[0][3].ToString();
             this.txtFrenos.Text       = objDatos.ds.Tables[0].Rows[0][4].ToString();
             this.txtID.Text           = objDatos.ds.Tables[0].Rows[0][5].ToString();
         }
         else
         {
             if (txtCamion.Text == "0")
             {
             }
             else
             {
                 MessageBox.Show("Todavia No se ha guardado ninguna configuracion para este camion", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             }
         }
     }
 }
Example #5
0
 private void mantNCF_Load(object sender, EventArgs e)
 {
     obDatos.Conectar();
     this.cmbTCF.DataSource    = obDatos.ConsultaTabla("tipo_NCF", " descri_tncf");
     this.cmbTCF.DisplayMember = "descri_tncf";
     this.cmbTCF.ValueMember   = "codigo_tncf";
     obDatos.Desconectar();
 }
Example #6
0
        private void GenerarCxP_Load(object sender, EventArgs e)
        {
            proximoCodigoCxP();
            txtFecha.Text = DateTime.Now.Date.Date.ToString("MM-dd-yyyy");
            objDatos.Conectar();
            this.cmbTipoPago.DataSource    = objDatos.ConsultaTabla("tipo_pagos", " descri_tpa");
            this.cmbTipoPago.DisplayMember = "descri_tpa";
            this.cmbTipoPago.ValueMember   = "codigo_tpa";
            txtFecha.Text = DateTime.Now.Date.Date.ToString("MM-dd-yyyy");
            objDatos.Desconectar();

            this.txtUsuario.Text = codigoEmpleado.ToString();
        }
Example #7
0
 private void proCuadreCaja_Load(object sender, EventArgs e)
 {
     try
     {
         datos  objDatos = new datos();
         string fecha    = DateTime.Now.Date.Date.ToString("yyyy-MM-dd");
         objDatos.Conectar();
         objDatos.Consulta_llenar_datos("select SUM(f.monfac_fac)as 'monto' from facturas f where f.fecfac_fac = " + "'" + fecha.ToString() + "' and f.codtip_fac = 1");
         if (Convert.ToString(objDatos.ds.Tables[0].Rows[0][0].ToString()) == "")
         {
             this.txtTotalEfectivoSistema.Text = "$0.00";
         }
         else
         {
             vendidoEfectivo = Convert.ToDouble(objDatos.ds.Tables[0].Rows[0][0].ToString());
             this.txtTotalEfectivoSistema.Text = vendidoEfectivo.ToString("C");
         }
         objDatos.Desconectar();
         objDatos.Conectar();
         objDatos.Consulta_llenar_datos("select SUM(f.monfac_fac)as 'monto' from facturas f where f.codtip_fac = 2 and f.fecfac_fac = " + "'" + fecha.ToString() + "'");
         if (Convert.ToString(objDatos.ds.Tables[0].Rows[0][0].ToString()) == "")
         {
             this.txtVentasEfectivo.Text = "$0.00";
         }
         else
         {
             {
                 vendidoCredito = Convert.ToDouble(objDatos.ds.Tables[0].Rows[0][0].ToString());
                 this.txtVentasEfectivo.Text = vendidoCredito.ToString("C");
             }
         }
         //-------------------VENTAS EN TARJETA DE CREDITO---------------------
         //    objDatos.Consulta_llenar_datos("select SUM(f.monfac_fac)as 'monto' from facturas f where f.codtip_fac = 3 and f.fecfac_fac = " + "'" + fecha.ToString() + "'");
         //    if (objDatos.ds.Tables[0].Rows.Count < 1)
         //    {
         //        this.txtTotalVentasTarjeta.Text = "$0.00";
         //    }
         //    else
         //    {
         //        vendidotarjeta = Convert.ToDouble(objDatos.ds.Tables[0].Rows[0][0].ToString());
         //        this.txtTotalVentasTarjeta.Text = vendidotarjeta.ToString("C");
         //    }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show("No se encontraron facturas el dia de hoy");
     }
     this.lblSistema.Text  = (vendidoCredito + vendidoEfectivo).ToString("C");
     this.lblSistema2.Text = (vendidoEfectivo).ToString("C");
 }
Example #8
0
        private void limpiarDatos()
        {
            txtFecha.Text = DateTime.Now.Date.Date.ToString("MM-dd-yyyy");
            txtHora.Text  = DateTime.Now.ToShortTimeString().ToString();

            obDatos.Conectar();
            obDatos.consultar("SELECT COUNT(numfac_fac) from ", "facturas");
            numeroFactura = Convert.ToInt32(obDatos.ds.Tables["facturas"].Rows[0][0].ToString()) + 1;
            this.txtNumeroFactura.Text = (Convert.ToString(numeroFactura));
            actualizarDatosFactura();

            this.cmbTipoPago.DataSource    = obDatos.ConsultaTabla("tipo_factura", " descri_fac");
            this.cmbTipoPago.DisplayMember = "descri_fac";
            this.cmbTipoPago.ValueMember   = "codtip_fac";

            this.cmbTipoNCF.DataSource    = obDatos.ConsultaTabla("tipo_NCF", " descri_tncf");
            this.cmbTipoNCF.DisplayMember = "descri_tncf";
            this.cmbTipoNCF.ValueMember   = "codigo_tncf";
            this.cmbTipoNCF.SelectedIndex = 6;

            string truncarTablaTemporal = ("truncate table facturatemporal");

            obDatos.Consulta_llenar_datos(truncarTablaTemporal);
            actualizarDatosFactura();
            this.txtCodigoArticulo.Focus();
            this.txtCodigoCliente.Text = "";
            this.lblNombreCliente.Text = "";
            this.lblRepresentante.Text = "";
            this.txtConcepto.Text      = "";
            this.txtNCF.Text           = "";
        }
Example #9
0
        private void cmdNuevo_Click(object sender, EventArgs e)
        {
            if (txtCamion.Text != "")
            {
                datos objDatos = new datos();
                objDatos.Conectar();
                objDatos.Consulta_llenar_datos("consultar_salida_camion " + this.txtCamion.Text + "");

                Reportes.Salida.rptSalidaCamiones rp = new Reportes.Salida.rptSalidaCamiones();
                rp.SetDataSource(objDatos.ds.Tables[0]);
                crystalReportViewer1.ReportSource = rp;

                crystalReportViewer1.ShowCloseButton          = false;
                crystalReportViewer1.ShowCopyButton           = false;
                crystalReportViewer1.ShowGotoPageButton       = false;
                crystalReportViewer1.ShowLogo                 = false;
                crystalReportViewer1.ShowParameterPanelButton = false;
                crystalReportViewer1.ToolPanelView            = CrystalDecisions.Windows.Forms.ToolPanelViewType.None;
                crystalReportViewer1.ShowParameterPanelButton = false;
                crystalReportViewer1.DisplayStatusBar         = false;

                crystalReportViewer1.RefreshReport();

                objDatos.Desconectar();
            }
            else
            {
                MessageBox.Show("Debe seleccionar un camion");
            }
        }
Example #10
0
 private void txtCamion_TextChanged(object sender, EventArgs e)
 {
     if (this.txtCamion.Text != "Nuevo")
     {
         objDatos.Conectar();
         objDatos.Consulta_llenar_datos("select m.descripcion + ' '  + mv.descripcion + ' año ' + convert(varchar(4),v.anoveh_veh) + ', Placa ' + convert(varchar(12),v.numpla_veh) + ' Chasis ' +  convert(varchar(17),v.numcha_veh) as vehiculo from vehiculo v, marca_articulos m, tipo_vehiculos tv, modelos_vehiculos mv, colores c where v.codigo_marca = m.codigo_marca and v.codigo_tipo_vehiculo = tv.codigo_tipo_vehiculo and v.codigo_modelos =mv.codigo_modelos and c.codigo_color = v.codigo_color and v.codveh_veh = " + txtCamion.Text);
         if (objDatos.ds.Tables[0].Rows.Count > 0)
         {
             this.lblDatosCamion.Text = objDatos.ds.Tables[0].Rows[0][0].ToString();
         }
         else
         {
             MessageBox.Show("Cliente no encontrado", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
     }
 }
Example #11
0
        private void busquedaServicios_Load(object sender, EventArgs e)
        {
            objDatos.Conectar();
            objDatos.Consulta_llenar_datos("select * from servicios");
            this.miFiltro = (objDatos.ds.Tables[0].DefaultView);
            this.dataGridView1.DataSource = miFiltro;

            this.dataGridView1.Columns[0].Width                          = 80;
            this.dataGridView1.Columns[0].HeaderText                     = "ID";
            this.dataGridView1.Columns[1].Width                          = 418;
            this.dataGridView1.Columns[1].HeaderText                     = "Nombre del servicio";
            this.dataGridView1.Columns[2].Width                          = 150;
            this.dataGridView1.Columns[2].HeaderText                     = "Precio";
            this.dataGridView1.Columns[3].Width                          = 100;
            this.dataGridView1.Columns[3].HeaderText                     = "Estado";
            this.dataGridView1.RowHeadersVisible                         = false;
            this.dataGridView1.DefaultCellStyle.ForeColor                = Color.Black;
            this.dataGridView1.RowsDefaultCellStyle.BackColor            = Color.AliceBlue;
            this.dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.White;
            this.dataGridView1.AllowUserToAddRows                        = false;
            this.dataGridView1.AllowUserToDeleteRows                     = false;
            this.dataGridView1.AllowUserToOrderColumns                   = false;
            this.dataGridView1.AllowUserToResizeRows                     = false;
            this.dataGridView1.ReadOnly                = true;
            this.dataGridView1.SelectionMode           = DataGridViewSelectionMode.FullRowSelect;
            this.dataGridView1.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
            this.dataGridView1.MultiSelect             = false;
            this.dataGridView1.EditMode                = DataGridViewEditMode.EditProgrammatically;
            this.dataGridView1.ClearSelection();
            objDatos.Desconectar();
            textBox1.Focus();
        }
Example #12
0
        private void cmdNuevo_Click(object sender, EventArgs e)
        {
            if (this.txtID.Text == "")
            {
                MessageBox.Show("Debe de especificar el numero de salida", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            else
            {
                datos objDatos = new datos();
                objDatos.Conectar();
                objDatos.Consulta_llenar_datos("consultar_ultima_salida_camion " + this.txtID.Text);

                Reportes.ReporteSalida.rptUltimaSalida rp = new Reportes.ReporteSalida.rptUltimaSalida();
                rp.SetDataSource(objDatos.ds.Tables[0]);
                crystalReportViewer1.ReportSource = rp;

                crystalReportViewer1.ShowCloseButton          = false;
                crystalReportViewer1.ShowCopyButton           = false;
                crystalReportViewer1.ShowGotoPageButton       = false;
                crystalReportViewer1.ShowLogo                 = false;
                crystalReportViewer1.ShowParameterPanelButton = false;
                crystalReportViewer1.ToolPanelView            = CrystalDecisions.Windows.Forms.ToolPanelViewType.None;
                crystalReportViewer1.ShowParameterPanelButton = false;
                crystalReportViewer1.DisplayStatusBar         = false;


                crystalReportViewer1.RefreshReport();
                objDatos.Desconectar();
            }
        }
Example #13
0
 private void busquedaSuplidores_Load(object sender, EventArgs e)
 {
     objDatos.Conectar();
     objDatos.Consulta_llenar_datos("select c.codigo_suplidor, c.nombre, c.direccion,c.telefono1, c.telefono2 from suplidores c");
     this.miFiltro = (objDatos.ds.Tables[0].DefaultView);
     this.dataGridView1.DataSource                                = miFiltro;
     this.dataGridView1.Columns[0].Width                          = 48;
     this.dataGridView1.Columns[0].HeaderText                     = "ID";
     this.dataGridView1.Columns[1].Width                          = 200;
     this.dataGridView1.Columns[1].HeaderText                     = "Nombre del suplidor";
     this.dataGridView1.Columns[2].Width                          = 300;
     this.dataGridView1.Columns[2].HeaderText                     = "Direccion del suplidor";
     this.dataGridView1.Columns[3].Width                          = 100;
     this.dataGridView1.Columns[3].HeaderText                     = "Telefono 1";
     this.dataGridView1.Columns[4].Width                          = 100;
     this.dataGridView1.Columns[4].HeaderText                     = "Telefono 2";
     this.dataGridView1.RowHeadersVisible                         = false;
     this.dataGridView1.DefaultCellStyle.ForeColor                = Color.Black;
     this.dataGridView1.RowsDefaultCellStyle.BackColor            = Color.AliceBlue;
     this.dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.White;
     this.dataGridView1.AllowUserToAddRows                        = false;
     this.dataGridView1.AllowUserToDeleteRows                     = false;
     this.dataGridView1.AllowUserToOrderColumns                   = false;
     this.dataGridView1.AllowUserToResizeRows                     = false;
     this.dataGridView1.ReadOnly                = true;
     this.dataGridView1.SelectionMode           = DataGridViewSelectionMode.FullRowSelect;
     this.dataGridView1.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
     this.dataGridView1.MultiSelect             = false;
     this.dataGridView1.EditMode                = DataGridViewEditMode.EditProgrammatically;
     this.dataGridView1.ClearSelection();
     objDatos.Desconectar();
     textBox1.Focus();;
 }
Example #14
0
        private void conFacturas_Load(object sender, EventArgs e)
        {
            objDatos.Conectar();
            objDatos.Consulta_llenar_datos("select f.numfac_fac, c.nombre, f.fecfac_fac, f.monfac_fac from facturas f, detalle_facturas dt, clientes c where dt.numfac_fac = f.numfac_fac and c.codigo_cliente = f.codcli_cli order by f.numfac_fac desc");
            this.miFiltro = (objDatos.ds.Tables[0].DefaultView);
            this.dataGridView1.DataSource = miFiltro;

            this.dataGridView1.Columns[0].Width                          = 65;
            this.dataGridView1.Columns[0].HeaderText                     = "Factura";
            this.dataGridView1.Columns[1].Width                          = 295;
            this.dataGridView1.Columns[1].HeaderText                     = "Cliente";
            this.dataGridView1.Columns[2].Width                          = 150;
            this.dataGridView1.Columns[2].HeaderText                     = "Fecha Factura";
            this.dataGridView1.Columns[3].Width                          = 150;
            this.dataGridView1.Columns[3].HeaderText                     = "Monto Factura";
            this.dataGridView1.RowHeadersVisible                         = false;
            this.dataGridView1.DefaultCellStyle.ForeColor                = Color.Black;
            this.dataGridView1.RowsDefaultCellStyle.BackColor            = Color.AliceBlue;
            this.dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.White;
            this.dataGridView1.AllowUserToAddRows                        = false;
            this.dataGridView1.AllowUserToDeleteRows                     = false;
            this.dataGridView1.AllowUserToOrderColumns                   = false;
            this.dataGridView1.AllowUserToResizeRows                     = false;
            this.dataGridView1.ReadOnly                = true;
            this.dataGridView1.SelectionMode           = DataGridViewSelectionMode.FullRowSelect;
            this.dataGridView1.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
            this.dataGridView1.MultiSelect             = false;
            this.dataGridView1.EditMode                = DataGridViewEditMode.EditProgrammatically;
            this.dataGridView1.ClearSelection();
            objDatos.Desconectar();
            textBox1.Focus();
        }
Example #15
0
        private void Form1_Load(object sender, EventArgs e)
        {
            objDatos.Conectar();
            objDatos.Consulta_llenar_datos("select max(codigo_salida_camiones) as 'ultimo' from salida_camiones");
            if (objDatos.ds.Tables[0].Rows.Count > 0)
            {
                ultimaSalida = Convert.ToInt32(objDatos.ds.Tables[0].Rows[0][0].ToString());
            }

            objDatos.Consulta_llenar_datos("consultar_ultima_salida_camion " + ultimaSalida);


            Reportes.ReporteSalida.rptUltimaSalida rp = new Reportes.ReporteSalida.rptUltimaSalida();
            rp.SetDataSource(objDatos.ds.Tables[0]);
            crystalReportViewer1.ReportSource = rp;

            crystalReportViewer1.ShowCloseButton          = false;
            crystalReportViewer1.ShowCopyButton           = false;
            crystalReportViewer1.ShowGotoPageButton       = false;
            crystalReportViewer1.ShowLogo                 = false;
            crystalReportViewer1.ShowParameterPanelButton = false;
            crystalReportViewer1.ToolPanelView            = CrystalDecisions.Windows.Forms.ToolPanelViewType.None;
            crystalReportViewer1.ShowParameterPanelButton = false;
            crystalReportViewer1.DisplayStatusBar         = false;


            crystalReportViewer1.RefreshReport();
            objDatos.Desconectar();
        }
Example #16
0
        private void guardarDetalleFactura()
        {
            datos objDatos = new datos();

            objDatos.Conectar();
            string sql = "select precio,cantidad,codigo_art,descuento,cantidad*precio as 'importe' from facturatemporal";

            objDatos.Consulta_llenar_datos(sql);

            //Buscar cantidad de articulos
            obDatos.consultar("select count(distinct codigo_art) from ", "facturatemporal");
            int cantArticulos = Convert.ToInt32(obDatos.ds.Tables["facturatemporal"].Rows[0][0].ToString());

            for (int n = 0; n < cantArticulos; n++)
            {
                double precio      = Convert.ToDouble(objDatos.ds.Tables[0].Rows[n][0].ToString());
                int    cantidad    = Convert.ToInt32(objDatos.ds.Tables[0].Rows[n][1].ToString());
                int    codArticulo = Convert.ToInt32(objDatos.ds.Tables[0].Rows[n][2].ToString());
                int    descuento   = Convert.ToInt32(objDatos.ds.Tables[0].Rows[n][3].ToString());
                double importe     = Convert.ToDouble(objDatos.ds.Tables[0].Rows[n][4].ToString());
                obDatos.consultar("SELECT COUNT(id_detall) from ", "detalle_facturas");
                int idDetall = Convert.ToInt32(obDatos.ds.Tables["detalle_facturas"].Rows[0][0].ToString()) + 1;

                obDatos.Consulta_llenar_datos("exec inserta_detalles_facturas " + idDetall + "," + this.txtNumeroFactura.Text + "," + precio + "," + cantidad + "," + codArticulo + "," + descuento + "," + importe + "");
                objDatos.Desconectar();
            }
        }
Example #17
0
        private void cargarContactos()
        {
            objDatos.Conectar();
            objDatos.Consulta_llenar_datos("select a.nombre, a.telefono1, a.telefono2, b.tipo_contacto from agenda a, tipo_contacto b where b.codigo_tipo_contacto = a.codigo_tipo_contacto order by nombre asc");
            this.miFiltro = (objDatos.ds.Tables[0].DefaultView);
            this.dataGridView1.DataSource = miFiltro;

            this.dataGridView1.Columns[0].Width      = 350;
            this.dataGridView1.Columns[0].HeaderText = "Contacto";
            this.dataGridView1.Columns[1].Width      = 100;
            this.dataGridView1.Columns[1].HeaderText = "Telefono 1";
            this.dataGridView1.Columns[2].Width      = 100;
            this.dataGridView1.Columns[2].HeaderText = "Telefono 2";
            this.dataGridView1.Columns[3].Width      = 197;
            this.dataGridView1.Columns[3].HeaderText = "Servicio";

            this.dataGridView1.RowHeadersVisible                         = false;
            this.dataGridView1.DefaultCellStyle.ForeColor                = Color.Black;
            this.dataGridView1.RowsDefaultCellStyle.BackColor            = Color.AliceBlue;
            this.dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.White;
            this.dataGridView1.AllowUserToAddRows                        = false;
            this.dataGridView1.AllowUserToDeleteRows                     = false;
            this.dataGridView1.AllowUserToOrderColumns                   = false;
            this.dataGridView1.AllowUserToResizeRows                     = false;
            this.dataGridView1.ReadOnly                = true;
            this.dataGridView1.SelectionMode           = DataGridViewSelectionMode.FullRowSelect;
            this.dataGridView1.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
            this.dataGridView1.MultiSelect             = false;
            this.dataGridView1.EditMode                = DataGridViewEditMode.EditProgrammatically;
            this.dataGridView1.ClearSelection();
            objDatos.Desconectar();
            this.ActiveControl = textBox1;
        }
Example #18
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (this.txtAPagar.Text != "")
            {
                int rows = dataGridView1.RowCount;
                for (int i = 0; i < rows; i++)
                {
                    objDatos.Conectar();
                    objDatos3.Conectar();
                    string sql        = "select cpp.codigo_cpp from cuentas_por_pagar cpp where cpp.numfac_fac = '" + dataGridView1.Rows[i].Cells[0].Value + "'";
                    string referecnia = "select referecnia from cuentas_por_pagar cpp where cpp.numfac_fac = '" + dataGridView1.Rows[i].Cells[0].Value + "'";

                    objDatos.Consulta_llenar_datos(sql);
                    objDatos3.Consulta_llenar_datos(referecnia);
                    codigoCpC = Convert.ToInt32(objDatos.ds.Tables[0].Rows[0][0].ToString());

                    objDatos.Consulta_llenar_datos("insert into cuenta_por_pagar_temporal values ('" + dataGridView1.Rows[i].Cells[0].Value + "','" + dataGridView1.Rows[i].Cells[2].Value + "'," + dataGridView1.Rows[i].Cells[3].Value + ",'" + dataGridView1.Rows[i].Cells[4].Value + "','" + dataGridView1.Rows[i].Cells[5].Value + "','" + dataGridView1.Rows[i].Cells[6].Value + "'," + dataGridView1.Rows[i].Cells[7].Value + "," + dataGridView1.Rows[i].Cells[8].Value + ",'" + dataGridView1.Rows[i].Cells[9].Value + "'," + codigoCpC.ToString() + ",'" + objDatos3.ds.Tables[0].Rows[0][0].ToString() + "')");
                    objDatos.Desconectar();
                    objDatos3.Desconectar();
                }

                //Buscar cantidad de facturas marcadas
                objDatos.Consulta_llenar_datos("select count(codigo_cpp) from cuenta_por_pagar_temporal where saldar = 1");
                int cantFacturas = 0;
                cantFacturas = Convert.ToInt32(objDatos.ds.Tables[0].Rows[0][0].ToString());

                for (int n = 0; n < cantFacturas; n++)
                {
                    objDatos2.Conectar();
                    objDatos2.Consulta_llenar_datos("select * from cuenta_por_pagar_temporal where saldar = 1");
                    Int32    codigoCXP     = Convert.ToInt32(objDatos2.ds.Tables[0].Rows[n][9].ToString());
                    DateTime fecha         = Convert.ToDateTime(objDatos2.ds.Tables[0].Rows[n][1].ToString());
                    string   numfac_fac    = objDatos2.ds.Tables[0].Rows[n][0].ToString();
                    double   credito       = Convert.ToDouble(objDatos2.ds.Tables[0].Rows[n][2].ToString());
                    double   monto         = Convert.ToDouble(objDatos2.ds.Tables[0].Rows[n][2].ToString());
                    double   debito        = Convert.ToDouble(objDatos2.ds.Tables[0].Rows[n][2].ToString());
                    double   saldo_final   = 0.0;
                    int      codigocliente = Convert.ToInt16(objDatos2.ds.Tables[0].Rows[n][7].ToString());
                    string   ncf           = objDatos2.ds.Tables[0].Rows[n][4].ToString();
                    string   referencia    = objDatos2.ds.Tables[0].Rows[n][10].ToString();

                    string sql = "actualiza_cuentas_por_pagar " + codigoCXP.ToString() + ",'" + fecha.ToShortDateString() + "','" + numfac_fac.ToString() + "'," + credito.ToString() + "," + monto.ToString() + "," + debito.ToString() + "," + saldo_final.ToString() + "," + this.cmbTipoPago.SelectedValue.ToString() + "," + codigoEmpleado + "," + codigocliente.ToString() + ",'" + ncf.ToString() + "','" + referencia.ToString() + "'";
                    objDatos2.Consulta_llenar_datos(sql);

                    string sql2 = "insert into registro_detalles_abonos_cpp values (" + codigoCXP + ",'" + numfac_fac.ToString() + "'," + monto.ToString() + ")";
                    objDatos2.Consulta_llenar_datos(sql2);
                    objDatos2.Desconectar();
                    objDatos.Consulta_llenar_datos("insert into registro_abonos_cpp values (" + codigoCXP + "," + this.txtCodigoCliente.Text + ",'" + this.txtFecha.Text.ToString() + "')");
                }

                MessageBox.Show("Proceso concluido");
                objDatos.Consulta_llenar_datos("truncate table cuenta_por_pagar_temporal");
                limpiarPantall();
            }
            else
            {
                MessageBox.Show("Expecifique el monto que desea abonar a la CxP");
            }
        }
Example #19
0
        private void proCuentasxCobrar_Load(object sender, EventArgs e)
        {
            txtFecha.Text = DateTime.Now.Date.Date.ToString("MM-dd-yyyy");
            objDatos.Conectar();
            objDatos.consultar("SELECT codigo_cpc from ", "numero_cpc");
            if (objDatos.ds.Tables[0].Rows.Count > 0)
            {
                CodigoCxC = Convert.ToInt32(objDatos.ds.Tables["numero_cpc"].Rows[0][0].ToString()) + 1;
                this.txtCodigoCxC.Text = CodigoCxC.ToString();
            }
            else
            {
                CodigoCxC = 1; this.txtCodigoCxC.Text = CodigoCxC.ToString();
            }

            this.cmbTipoPago.DataSource    = objDatos.ConsultaTabla("tipo_pagos", " descri_tpa");
            this.cmbTipoPago.DisplayMember = "descri_tpa";
            this.cmbTipoPago.ValueMember   = "codigo_tpa";
            objDatos.Desconectar();
        }
Example #20
0
        void cargarMarcas()
        {
            this.txtID.Text     = "Nuevo";
            this.txtMarca.Text  = "";
            this.txtPrecio.Text = "";
            this.txtMarca.Focus();
            this.txtID.Enabled = false;
            objDatos.Conectar();

            string sring = ("exec obtenerServicios");

            objDatos.Consulta_llenar_datos(sring);

            this.miFiltro = (objDatos.ds.Tables[0].DefaultView);
            this.dataGridView1.DataSource = miFiltro;

            this.dataGridView1.Columns[0].Width                          = 60;
            this.dataGridView1.Columns[0].HeaderText                     = "ID";
            this.dataGridView1.Columns[1].Width                          = 270;
            this.dataGridView1.Columns[1].HeaderText                     = "Descripcion";
            this.dataGridView1.Columns[2].Width                          = 120;
            this.dataGridView1.Columns[2].HeaderText                     = "Precio Unitario";
            this.dataGridView1.Columns[3].Width                          = 91;
            this.dataGridView1.Columns[3].HeaderText                     = "Estado";
            this.dataGridView1.RowHeadersVisible                         = false;
            this.dataGridView1.DefaultCellStyle.ForeColor                = Color.Black;
            this.dataGridView1.RowsDefaultCellStyle.BackColor            = Color.AliceBlue;
            this.dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.White;
            this.dataGridView1.AllowUserToAddRows                        = false;
            this.dataGridView1.AllowUserToDeleteRows                     = false;
            this.dataGridView1.AllowUserToOrderColumns                   = false;
            this.dataGridView1.AllowUserToResizeRows                     = false;
            this.dataGridView1.ReadOnly                = true;
            this.dataGridView1.SelectionMode           = DataGridViewSelectionMode.FullRowSelect;
            this.dataGridView1.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
            this.dataGridView1.MultiSelect             = false;
            this.dataGridView1.EditMode                = DataGridViewEditMode.EditProgrammatically;
            this.cmdEliminar.Enabled = false;
            this.dataGridView1.ClearSelection();
            objDatos.Desconectar();
        }
Example #21
0
        private void cmdNuevo_Click(object sender, EventArgs e)
        {
            objDatos.Conectar();
            objDatos.Consulta_llenar_datos("consultar_entrada_camion " + this.txtCamion.Text + "");

            Reportes.Entradas.rptEntrada rp = new Reportes.Entradas.rptEntrada();
            rp.SetDataSource(objDatos.ds.Tables[0]);
            crystalReportViewer1.ReportSource = rp;

            crystalReportViewer1.ShowCloseButton          = false;
            crystalReportViewer1.ShowCopyButton           = false;
            crystalReportViewer1.ShowGotoPageButton       = false;
            crystalReportViewer1.ShowLogo                 = false;
            crystalReportViewer1.ShowParameterPanelButton = false;
            crystalReportViewer1.ToolPanelView            = CrystalDecisions.Windows.Forms.ToolPanelViewType.None;
            crystalReportViewer1.ShowParameterPanelButton = false;
            crystalReportViewer1.DisplayStatusBar         = false;

            crystalReportViewer1.RefreshReport();

            objDatos.Desconectar();
        }
Example #22
0
        private void imprimirFacturas_Load(object sender, EventArgs e)
        {
            datos objDatos = new datos();

            objDatos.Conectar();
            objDatos.Consulta_llenar_datos("consultar_factura_por_codigo " + codFactura + "");

            Reportes.Facturas rp = new Reportes.Facturas();
            rp.SetDataSource(objDatos.ds.Tables[0]);
            crystalReportViewer1.ReportSource = rp;
            crystalReportViewer1.RefreshReport();
            objDatos.Desconectar();
            this.crystalReportViewer1.RefreshReport();
        }
Example #23
0
        public virtual void cargarMarcas()
        {
            estado.Checked              = true;
            this.txtID.Text             = "Nuevo";
            this.txtDireccion.Text      = "";
            this.txtnombre.Text         = "";
            this.txtTelefono1.Text      = "";
            this.txtTelefono2.Text      = "";
            this.txtIDentificacion.Text = "";
            this.txtnombre.Focus();
            this.txtID.Enabled     = false;
            this.pictureBox1.Image = RentATruck.Properties.Resources.user;
            objDatos.Conectar();

            this.cmdEliminar.Enabled = false;
        }
Example #24
0
        private void BusquedaCamiones_Load(object sender, EventArgs e)
        {
            objDatos.Conectar();
            objDatos.Consulta_llenar_datos("select v.codveh_veh, m.descripcion, mv.descripcion, v.anoveh_veh, c.descripcion, v.descri_veh, v.numpla_veh, v.numcha_veh,v.kilome_veh from vehiculo v, marca_articulos m, tipo_vehiculos tv, modelos_vehiculos mv, colores c where v.codigo_marca = m.codigo_marca and v.codigo_tipo_vehiculo = tv.codigo_tipo_vehiculo and v.codigo_modelos =mv.codigo_modelos and c.codigo_color = v.codigo_color and v.alquilado = 0");
            this.miFiltro = (objDatos.ds.Tables[0].DefaultView);
            this.dataGridView1.DataSource = miFiltro;

            this.dataGridView1.Columns[0].Width                          = 30;
            this.dataGridView1.Columns[0].HeaderText                     = "ID";
            this.dataGridView1.Columns[1].Width                          = 90;
            this.dataGridView1.Columns[1].HeaderText                     = "Marca";
            this.dataGridView1.Columns[2].Width                          = 80;
            this.dataGridView1.Columns[2].HeaderText                     = "Modelo";
            this.dataGridView1.Columns[3].Width                          = 70;
            this.dataGridView1.Columns[3].HeaderText                     = "Año";
            this.dataGridView1.Columns[4].Width                          = 70;
            this.dataGridView1.Columns[4].HeaderText                     = "Color";
            this.dataGridView1.Columns[5].Width                          = 120;
            this.dataGridView1.Columns[5].HeaderText                     = "Descripcion";
            this.dataGridView1.Columns[6].Width                          = 100;
            this.dataGridView1.Columns[6].HeaderText                     = "Placa";
            this.dataGridView1.Columns[7].Width                          = 120;
            this.dataGridView1.Columns[7].HeaderText                     = "Chasis";
            this.dataGridView1.Columns[8].Width                          = 68;
            this.dataGridView1.Columns[8].HeaderText                     = "Kilometraje";
            this.dataGridView1.RowHeadersVisible                         = false;
            this.dataGridView1.DefaultCellStyle.ForeColor                = Color.Black;
            this.dataGridView1.RowsDefaultCellStyle.BackColor            = Color.AliceBlue;
            this.dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.White;
            this.dataGridView1.AllowUserToAddRows                        = false;
            this.dataGridView1.AllowUserToDeleteRows                     = false;
            this.dataGridView1.AllowUserToOrderColumns                   = false;
            this.dataGridView1.AllowUserToResizeRows                     = false;
            this.dataGridView1.ReadOnly                = true;
            this.dataGridView1.SelectionMode           = DataGridViewSelectionMode.FullRowSelect;
            this.dataGridView1.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
            this.dataGridView1.MultiSelect             = false;
            this.dataGridView1.EditMode                = DataGridViewEditMode.EditProgrammatically;
            this.dataGridView1.ClearSelection();
            objDatos.Desconectar();
            textBox1.Focus();
        }
Example #25
0
        private void Form1_Load(object sender, EventArgs e)
        {
            datos objDatos = new datos();

            objDatos.Conectar();
            objDatos.Consulta_llenar_datos("select * from reporteCxP");

            Reportes.CxP.CrystalReport1 rp = new Reportes.CxP.CrystalReport1();
            rp.SetDataSource(objDatos.ds.Tables[0]);
            crystalReportViewer1.ReportSource = rp;
            objDatos.Desconectar();
            this.crystalReportViewer1.RefreshReport();

            crystalReportViewer1.ShowCloseButton          = false;
            crystalReportViewer1.ShowCopyButton           = false;
            crystalReportViewer1.ShowGotoPageButton       = false;
            crystalReportViewer1.ShowLogo                 = false;
            crystalReportViewer1.ShowParameterPanelButton = false;
            crystalReportViewer1.ToolPanelView            = CrystalDecisions.Windows.Forms.ToolPanelViewType.None;
            crystalReportViewer1.ShowParameterPanelButton = false;
            crystalReportViewer1.DisplayStatusBar         = false;
        }
Example #26
0
        private void enviarCorreoCambioAceite()
        {
            try
            {
                datos  objDatos = new datos();
                string correo   = "";
                objDatos.Conectar();
                objDatos.Consulta_llenar_datos("select descripcion from notificacion_correos");

                if (objDatos.ds.Tables[0].Rows.Count > 0)
                {
                    correo = objDatos.ds.Tables[0].Rows[0][0].ToString();
                }

                EnviarCorreo mandaCorreoAceite = new EnviarCorreo();
                mandaCorreoAceite.enviarCorreoAceite(correo);
            }
            catch (System.Data.SqlClient.SqlException ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Example #27
0
        public virtual void cargarMarcas()
        {
            estado.Checked              = true;
            this.txtID.Text             = "Nuevo";
            this.txtDireccion.Text      = "";
            this.txtnombre.Text         = "";
            this.txtTelefono1.Text      = "";
            this.txtTelefono2.Text      = "";
            this.txtIDentificacion.Text = "";
            this.txtnombre.Focus();
            this.txtID.Enabled         = false;
            this.txtRepresentante.Text = "";
            this.telRepresentante.Text = "";
            this.txtRNC.Text           = "";
            this.pictureBox1.Image     = RentATruck.Properties.Resources.user;
            objDatos.Conectar();

            this.cmdEliminar.Enabled = false;

            this.cbmTipoCliente.DataSource    = objDatos.ConsultaTabla("tipo_cliente", " order by descri_tip asc");
            this.cbmTipoCliente.DisplayMember = "descri_tip";
            this.cbmTipoCliente.ValueMember   = "codtip_tip";
            objDatos.Desconectar();
        }
Example #28
0
        private void cmdAgregarNCF_Click(object sender, EventArgs e)
        {
            datos objDato = new datos();

            objDato.Conectar();
            string sql = "";

            sql = ("select n.ncf_ncf from NCF n where n.codigo_tncf = " + this.cmbTipoNCF.SelectedValue.ToString() + " and estado = 1");
            objDato.Consulta_llenar_datos(sql);
            this.txtCantidad.Focus();

            if (objDato.ds.Tables[0].Rows.Count > 0)
            {
                string NCF;
                NCF = objDato.ds.Tables[0].Rows[0][0].ToString();
                this.txtNCF.Text = NCF.ToString();
            }
            else
            {
                MessageBox.Show("No hay NCF disponibles de este tipo");
            }
            objDato.Desconectar();
        }
Example #29
0
        private void cmdBuscarCodCli_Click(object sender, EventArgs e)
        {
            Busquedas.BusquedaCamiones BC = new Busquedas.BusquedaCamiones();
            DialogResult res = BC.ShowDialog();

            if (res == DialogResult.OK)
            {
                this.txtCamion.Text = BC.ReturnValue1;

                objDatos.Conectar();
                objDatos.Consulta_llenar_datos("select * from mantenimiento_vehiculos where mantenimiento_vehiculos.codveh_veh = " + txtCamion.Text);
                if (objDatos.ds.Tables[0].Rows.Count > 0)
                {
                    this.cmdProcesar.Enabled = true;
                }
                else
                {
                    MessageBox.Show("Antes de Darle salida al vehiculo, debe configurar la fecha de vencimiento del seguro, en el menu Administrar y luego en Configuracion de Mantenimientos a Camiones", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    this.cmdProcesar.Enabled = false;
                }
            }
        }
Example #30
0
        private void cmdProcesar_Click(object sender, EventArgs e)
        {
            if (this.txtPersonaEntrega.Text == "")
            {
                MessageBox.Show("Especifique quien entrega el vehiculo");
                this.txtPersonaEntrega.Focus();
            }
            if (this.txtPersonaEntrega.Text == "")
            {
                this.txtCedula.Text = "N/A";
            }
            if (this.txtKilometraje.Text == "")
            {
                MessageBox.Show("Especifique el kilometraje al recibir el camion");
                this.txtPersonaEntrega.Focus();
            }


            if (this.txtKilometraje.Text == "")
            {
                this.txtCombustibleEntrada.Text = "N/A";
            }

            if (this.txtReferencia.Text == "")
            {
                txtCombustibleEntrada.Text = "N/A";
            }

            if (this.txtCodigoCamion.Text != "Nuevo")
            {
                try
                {
                    //Calcular la cantidad de dias
                    txtFechaEntrada.Format       = DateTimePickerFormat.Custom;
                    txtFechaEntrada.CustomFormat = "dd/MM/yyyy";
                    salida = DateTime.ParseExact(this.txtFechaSalida.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
                    string   date       = txtFechaEntrada.Text;
                    DateTime entrada    = DateTime.ParseExact(date, "dd/MM/yyyy", CultureInfo.InvariantCulture);
                    TimeSpan difference = entrada - salida;

                    //Calcular la cantidad de horas
                    txtFechaEntrada.Format       = DateTimePickerFormat.Custom;
                    txtFechaEntrada.CustomFormat = "MM/dd/yyyy HH:mm:ss";

                    var src = HoraFechaSalida;
                    var hm  = new DateTime(src.Year, src.Month, src.Day, src.Hour, src.Minute, 0);

                    DateTime src2 = txtFechaEntrada.Value;
                    var      hm2  = new DateTime(src2.Year, src2.Month, src2.Day, src2.Hour, src2.Minute, 0);

                    int dias  = hm2.Day - hm.Day;
                    int horas = hm2.Hour - hm.Hour;
                    int minutos;


                    if (hm2.Hour > hm.Hour)
                    {
                        minutos = hm2.Minute - hm.Minute;
                    }
                    else
                    {
                        minutos = hm.Minute - hm2.Minute;
                    }



                    objDatos.Conectar();
                    string sql = "exec inserta_entrada_camiones " + this.txtCodigoCamion.Text + ",'" + entrada + "','" + this.txtPersonaEntrega.Text + "','" + this.txtCedula.Text + "','" + this.horaEntrada.Text.Substring(0, 8) + "','" + this.txtKilometraje.Text + "','" + this.txtReferencia.Text + "','" + this.txtCombustible.Text + "'," + difference.TotalDays + "," + horas;
                    if (objDatos.Insertar(sql))
                    {
                        string ActualizarAlquiler = "update vehiculo set alquilado = 'False', kilome_veh= " + txtKilometraje.Text + " where codveh_veh = " + this.txtCodigoCamion.Text;
                        if (objDatos.Insertar(ActualizarAlquiler))
                        {
                            MessageBox.Show("Registro Insertado");
                        }

                        NuevoKilometraje    = Convert.ToInt32(txtKilometraje.Text) - Convert.ToInt32(txtKmSalida.Text);
                        KilometrajeInsertar = NuevoKilometraje + kilometrajeActualCambioAceite();
                        //MessageBox.Show("El nuevo kilometraje es:" + NuevoKilometraje);
                        objDatos.Desconectar();
                        objDatos.Conectar();
                        string sql3 = "exec actualizar_kilometraje_aceite " + this.txtCodigoCamion.Text + "," + KilometrajeInsertar;
                        if (objDatos.Insertar(sql3))
                        {
                            objDatos.Desconectar();
                            //MessageBox.Show("Se actualizó la cantidad de KM para el cambio de aceite");
                        }

                        objDatos.Conectar();
                        string sql5 = "exec desactiva_salida_camion " + codigoSalidaCamion + "," + "'False'";
                        if (objDatos.Insertar(sql5))
                        {
                            objDatos.Desconectar();
                            //MessageBox.Show("se deactivo la salida de camion");
                        }
                        objDatos.Desconectar();
                        limpiarPantalla();
                    }
                    else
                    {
                        MessageBox.Show("Registro no pudo ser insertado");
                    }
                }
                catch (System.Data.SqlClient.SqlException ex)
                {
                    MessageBox.Show(ex.Message.ToString());
                }
            }
        }