Ejemplo n.º 1
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           = "";
        }
Ejemplo n.º 2
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();
 }
Ejemplo n.º 3
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();
        }
Ejemplo n.º 4
0
 private void proCuentasXPagar_Load(object sender, EventArgs e)
 {
     txtFecha.Text = DateTime.Now.Date.Date.ToString("yyyy-MM-dd");
     objDatos.Conectar();
     this.cmbTipoPago.DataSource    = objDatos.ConsultaTabla("tipo_pagos", " descri_tpa");
     this.cmbTipoPago.DisplayMember = "descri_tpa";
     this.cmbTipoPago.ValueMember   = "codigo_tpa";
     objDatos.Desconectar();
 }
Ejemplo n.º 5
0
        private void proRegistroAccidentes_Load(object sender, EventArgs e)
        {
            this.txtCamion.Text = "Nuevo";

            objDatos.Conectar();
            this.cmbTipoAccidente.DataSource    = objDatos.ConsultaTabla("tipo_accidentes", " order by descripcion asc");
            this.cmbTipoAccidente.DisplayMember = "descripcion";
            this.cmbTipoAccidente.ValueMember   = "codigo_tac";
            objDatos.Desconectar();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 7
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();
        }
Ejemplo n.º 8
0
        private void mantContactosTelefomicos_Load(object sender, EventArgs e)
        {
            this.cmdEliminar.Enabled = false;
            this.AcceptButton        = this.cmdGuardar;
            this.CancelButton        = cmdCancelar;

            objDatos.Conectar();
            this.cbmTipoCliente.DataSource    = objDatos.ConsultaTabla("tipo_contacto", " tipo_contacto");
            this.cbmTipoCliente.DisplayMember = "tipo_contacto";
            this.cbmTipoCliente.ValueMember   = "codigo_tipo_contacto";
            objDatos.Desconectar();

            try
            {
                cargarMarcas();
            }
            catch (System.Data.SqlClient.SqlException ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
Ejemplo n.º 9
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();
        }
Ejemplo n.º 10
0
        public virtual void cargarMarcas()
        {
            estado.Checked           = true;
            this.txtID.Text          = "Nuevo";
            this.txtAño.Text         = "";
            this.txtKm.Text          = "";
            this.txtDescripcion.Text = "";
            this.txtPlaca.Text       = "";
            this.txtChasis.Text      = "";
            this.txtDescripcion.Focus();
            this.txtID.Enabled     = false;
            this.pictureBox1.Image = RentATruck.Properties.Resources.place_holder1;
            objDatos.Conectar();

            string sring = ("exec obtenerVehiculos");

            objDatos.Consulta_llenar_datos(sring);

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

            this.dataGridView1.Columns[0].Width                          = 50;
            this.dataGridView1.Columns[0].HeaderText                     = "ID";
            this.dataGridView1.Columns[1].Width                          = 125;
            this.dataGridView1.Columns[1].HeaderText                     = "Marca";
            this.dataGridView1.Columns[2].Width                          = 125;
            this.dataGridView1.Columns[2].HeaderText                     = "Modelo";
            this.dataGridView1.Columns[3].Width                          = 80;
            this.dataGridView1.Columns[3].HeaderText                     = "Año";
            this.dataGridView1.Columns[4].Width                          = 170;
            this.dataGridView1.Columns[4].HeaderText                     = "Descripcion";
            this.dataGridView1.Columns[5].Width                          = 100;
            this.dataGridView1.Columns[5].HeaderText                     = "Placa";
            this.dataGridView1.Columns[6].Width                          = 125;
            this.dataGridView1.Columns[6].HeaderText                     = "Chasis";
            this.dataGridView1.Columns[7].Width                          = 75;
            this.dataGridView1.Columns[7].HeaderText                     = "Estado";
            this.dataGridView1.Columns[8].Width                          = 63;
            this.dataGridView1.Columns[8].HeaderText                     = "Color";
            this.dataGridView1.Columns[9].Visible                        = false;
            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();

            foreach (DataGridViewColumn col in dataGridView1.Columns)
            {
                col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
                col.HeaderCell.Style.Font      = new Font("Arial", 12F, FontStyle.Bold, GraphicsUnit.Pixel);
            }

            dataGridView1.RowsDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            objDatos.Conectar();
            this.cbmMarca.DataSource    = objDatos.ConsultaTabla("marca_articulos", " order by descripcion asc");
            this.cbmMarca.DisplayMember = "descripcion";
            this.cbmMarca.ValueMember   = "codigo_marca";

            this.cbmTipo.DataSource    = objDatos.ConsultaTabla("tipo_vehiculos", " order by descripcion asc");
            this.cbmTipo.DisplayMember = "descripcion";
            this.cbmTipo.ValueMember   = "codigo_tipo_vehiculo";

            this.cbmColor.DataSource    = objDatos.ConsultaTabla("colores", " order by descripcion asc");
            this.cbmColor.DisplayMember = "descripcion";
            this.cbmColor.ValueMember   = "codigo_color";

            this.cbmModelo.DataSource    = objDatos.ConsultaTabla("modelos_vehiculos", " order by descripcion asc");
            this.cbmModelo.DisplayMember = "descripcion";
            this.cbmModelo.ValueMember   = "codigo_modelos";

            buscarImagen();
            objDatos.Desconectar();
        }