Ejemplo n.º 1
0
        private void Date_ValueChanged(object sender, EventArgs e)
        {
            DateTime thisDay = DateTime.Today;

            Date.MaxDate = thisDay;
            TxtBxCantidad.Focus();
        }
Ejemplo n.º 2
0
        private void BttGuardar_Click(object sender, EventArgs e)
        {
            a = 0;
            if (TxtBxNombreUsuario.Text == "")
            {
                MessageBox.Show("campo de cédula vacio");
                date.Text          = "";
                BttGuardar.Enabled = false;
                TxtBxNombreUsuario.Focus();
                a++;
            }
            if (TxtBxCantidad.Text == "")
            {
                MessageBox.Show("la cantidad no se ha ingresado");
                TxtBxCantidad.Focus();
                BttGuardar.Enabled = false;
                a++;
            }

            if (a == 0)
            {
                this.DialogResult  = DialogResult.OK;
                BttGuardar.Enabled = true;
            }
        }
Ejemplo n.º 3
0
        private void TxtBxNombreUsuario_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == Convert.ToChar(Keys.Enter))
            {
                int    lim = 10;
                int    res;
                string Cedula = TxtBxCedula.Text;
                char[] num    = Cedula.ToArray();

                if (num.Length == 10)
                {
                    ClCedula objVerificar = new ClCedula(num, lim);
                    res = objVerificar.Verificar();
                    if (res > 0)
                    {
                        matSeg1.TblEmpleados.ReadXml(Application.StartupPath + "\\ArchEmpleados.xml");
                        System.Data.DataRow[] mats;
                        mats = matSeg1.TblEmpleados.Select("Cedula='" + TxtBxCedula.Text + "'");

                        if (mats.Length > 0)
                        {
                            LblNombre.Text   = mats[0]["Nombre"].ToString();
                            LblApellido.Text = mats[0]["Apellido"].ToString();


                            cant = int.Parse(LblCExis.Text);

                            if (cant == 0)
                            {
                                MessageBox.Show("No existe ningún material de seguridad", "Atencion", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                TxtBxCantidad.Enabled = false;
                                Bttguardar.Enabled    = false;
                                this.Close();
                            }
                            TxtBxCantidad.Focus();
                        }
                        else
                        {
                            MessageBox.Show("La cédula del responsable no existe en la empresa", "Atencion", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            TxtBxCedula.Text = "";
                        }
                    }
                    else
                    {
                        MessageBox.Show("Cédula Incorrecta");
                        TxtBxCedula.Text = "";
                    }
                }
                else
                {
                    MessageBox.Show("Cedula con mayor a 10 dígitos, INCORRECTO");
                    TxtBxCedula.Text = "";
                }
            }
        }
Ejemplo n.º 4
0
 private void TxtBxNombreUsuario_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)Keys.Enter)
     {
         if (TxtBxNombreUsuario.Text == "")
         {
             MessageBox.Show("El campo del nombre del responsable esta vacio", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
             TxtBxNombreUsuario.Text = "";
         }
         else
         {
             TxtBxCantidad.Focus();
         }
     }
 }
Ejemplo n.º 5
0
 private void TxtBxNombreR_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (Char)Keys.Enter)
     {
         if (TxtBxNombreR.Text == "")
         {
             MessageBox.Show("El nombre se encuentra vacio", "¡AVISO!", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
             TxtBxNombreR.Text = "";
         }
         else
         {
             TxtBxCantidad.Focus();
         }
     }
 }
Ejemplo n.º 6
0
 private void TxtBxNombreUsuario_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (Char)Keys.Enter)
     {
         if (TxtBxModelo.Text == "")
         {
             MessageBox.Show("Datos ingresado vacio, ingrese un nombre del material de seguridad");
             TxtBxModelo.Text = "";
         }
         else
         {
             Date.Focus();
         }
         TxtBxCantidad.Focus();
     }
 }
Ejemplo n.º 7
0
 private void TxtBxNombreUsuario_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == (Char)Keys.Enter)
     {
         nombre = LblTxtNomreUsuario.Text;
         if (nombre == "")
         {
             MessageBox.Show("Debe ingresar un Nombre de quien va a recibir el producto", "Atencion", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             LblTxtNomreUsuario.Text = "";
         }
         else
         {
             TxtBxCantidad.Focus();
         }
     }
 }
Ejemplo n.º 8
0
        private void BttGuardar_Click(object sender, EventArgs e)
        {
            cont = 0;


            if (TxtBxNombre.Text == "")
            {
                MessageBox.Show("No se ha registrado ningun nombre del material de seguridad ", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                TxtBxNombre.Focus();
                cont++;
            }

            /*if (TxtBxCodigo.Text == "")
             * {
             *  MessageBox.Show("No se ha registrado ningun codigo", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
             *  TxtBxCodigo.Focus();
             *  cont++;
             * }*/
            if (TxtBxCantidad.Text == "")
            {
                MessageBox.Show("No se ha registrado ninguna cantidad", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                TxtBxCantidad.Focus();
                cont++;
            }
            if (TxtBxPrecio.Text == "")
            {
                MessageBox.Show("No se ha registrado ningun precio", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                TxtBxCantidad.Focus();
                cont++;
            }



            if (cont == 0)
            {
                matSeg1.ReadXml(Application.StartupPath + "\\ArchOficina.xml");
                object[] matseg = new object[8];

                matseg[0] = TxtBxNombre.Text;
                matseg[1] = codigo;
                matseg[2] = Date.Text;
                matseg[4] = TxtBxCantidad.Text;
                matseg[5] = TxtBxPrecio.Text;
                matseg[7] = cant * precio;
            }
        }
Ejemplo n.º 9
0
 private void CmBxEstado_ValueMemberChanged(object sender, EventArgs e)
 {
     try
     {
         estado = CmBxEstado.SelectedItem.ToString();
         if (estado == "")
         {
             MessageBox.Show("No se ha seleccionado ningun dato", "¡Atencion!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             CmBxEstado.Focus();
         }
         else
         {
             TxtBxCantidad.Focus();
         }
     }
     catch
     {
         MessageBox.Show("Valores mal ingresados, seleccione los valores en la flecha", "¡Atención!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         CmBxEstado.Text = "";
     }
 }
Ejemplo n.º 10
0
        private void BttGuardar_Click(object sender, EventArgs e)
        {
            cont = 0;


            if (CmBxEstado.Text == "")
            {
                MessageBox.Show("No se ha registrado ningun dato en estado ", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                //TxtBxCodigo.Focus();
                cont++;
            }
            if (TxtBxNombre.Text == "")
            {
                MessageBox.Show("No se ha registrado ningun nombre del material de seguridad ", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                TxtBxNombre.Focus();
                cont++;
            }

            if (TxtBxCantidad.Text == "")
            {
                MessageBox.Show("No se ha registrado ninguna cantidad", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                TxtBxCantidad.Focus();
                cont++;
            }
            if (TxtBxPrecio.Text == "")
            {
                MessageBox.Show("No se ha registrado ningun precio", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                TxtBxCantidad.Focus();
                cont++;
            }


            if (cont == 0)
            {
                //matSeg1.WriteXml(Application.StartupPath + "\\ArchUniformes.xml");
                matSeg1.ReadXml(Application.StartupPath + "\\ArchUniformes.xml");
                object[] matseg = new object[10];

                matseg[0] = TxtBxNombre.Text;
                matseg[2] = TxtBxPrecio.Text;
                matseg[3] = TxtBxCantidad.Text;
                matseg[4] = CbxTalla.Text;
                matseg[5] = CmBxEstado.Text;
                matseg[7] = Date.Text;
                matseg[9] = LblPrecioT.Text;

                System.Data.DataRow[] talla;
                System.Data.DataRow[] nombre;

                talla  = matSeg1.TblUniformes.Select("Talla='" + CbxTalla.Text + "'");
                nombre = matSeg1.TblUniformes.Select("Nombre='" + TxtBxNombre.Text + "'");

                if (talla.Length > 0 && nombre.Length > 0)
                {
                    MessageBox.Show("El Uniforme ya existe solo se puede modificar", "ALERTA", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    this.Close();
                }
                else
                {
                    LblCodigo.Text = matSeg1.TblUniformes.Rows.Count.ToString();
                    agregar        = int.Parse(LblCodigo.Text);
                    agregar++;
                    LblCodigo.Text = agregar.ToString();
                    UniformesCodigo mostrarCodigo = new UniformesCodigo();
                    mostrarCodigo.LblCodigo.Text = agregar.ToString();
                    matSeg1.TblUniformes.Rows.Add(matseg);
                    matSeg1.WriteXml(Application.StartupPath + "\\ArchUniformes.xml");
                    this.Hide();
                    mostrarCodigo.ShowDialog();
                    if (mostrarCodigo.DialogResult == DialogResult.OK)
                    {
                        MessageBox.Show("Se ha guardado exitosamente", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                    }
                }
            }
        }
Ejemplo n.º 11
0
        private void BttGuardar_Click(object sender, EventArgs e)
        {
            cont = 0;


            if (TxtBxNombre.Text == "")
            {
                MessageBox.Show("No se ha registrado ningun nombre del material de seguridad ", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
                TxtBxNombre.Focus();
                cont++;
            }


            if (TxtBxCantidad.Text == "")
            {
                MessageBox.Show("No se ha registrado ninguna cantidad", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
                TxtBxCantidad.Focus();
                cont++;
            }
            if (TxtBxPrecio.Text == "")
            {
                MessageBox.Show("No se ha registrado ningun precio", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
                TxtBxCantidad.Focus();
                cont++;
            }



            if (cont == 0)
            {
                matSeg1.ReadXml(Application.StartupPath + "\\ArchOficina.xml");
                object[] oficina = new object[8];

                oficina[0] = TxtBxNombre.Text;
                oficina[2] = Date.Text;
                oficina[4] = TxtBxCantidad.Text;
                oficina[5] = TxtBxPrecio.Text;
                oficina[7] = LblPrecioT.Text;

                System.Data.DataRow[] nombre;
                nombre = matSeg1.TblOficina.Select("Nombre='" + TxtBxNombre.Text + "'");

                if (nombre.Length > 0)
                {
                    MessageBox.Show("El Material de Oficina ya existe solo se puede modificar", "ALERTA", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    this.Close();
                }
                else
                {
                    LblTxtCodigo.Text = matSeg1.TblOficina.Rows.Count.ToString();
                    agregar           = int.Parse(LblTxtCodigo.Text);
                    agregar++;
                    LblTxtCodigo.Text = agregar.ToString();
                    OficinaCodigo mostrarCodigo = new OficinaCodigo();
                    mostrarCodigo.LblCodigo.Text = agregar.ToString();
                    matSeg1.TblOficina.Rows.Add(oficina);
                    matSeg1.WriteXml(Application.StartupPath + "\\ArchOficina.xml");
                    this.Hide();
                    mostrarCodigo.ShowDialog();
                    if (mostrarCodigo.DialogResult == DialogResult.OK)
                    {
                        MessageBox.Show("Se ha guardado exitosamente", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                    }
                }
            }
        }
Ejemplo n.º 12
0
 private void Date_ValueChanged(object sender, EventArgs e)
 {
     TxtBxCantidad.Focus();
 }
Ejemplo n.º 13
0
        private void BttGuardar_Click(object sender, EventArgs e)
        {
            cont = 0;


            if (CmBxEstado.Text == "")
            {
                MessageBox.Show("No se ha registrado ningun dato en estado ", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                //TxtBxCodigo.Focus();
                cont++;
            }
            if (TxtBxNombre.Text == "")
            {
                MessageBox.Show("No se ha registrado ningun nombre del material de seguridad ", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                TxtBxNombre.Focus();
                cont++;
            }

            if (TxtBxMarca.Text == "")
            {
                MessageBox.Show("No se ha registrado ninguna marca del material", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                TxtBxNombre.Focus();
                cont++;
            }
            if (TxtBxModelo.Text == "")
            {
                MessageBox.Show("No se ha registrado ninguna marca del modelo", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                TxtBxNombre.Focus();
                cont++;
            }

            /*if (TxtBxCodigo.Text == "")
             * {
             *  MessageBox.Show("No se ha registrado ningun codigo", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
             *  TxtBxCodigo.Focus();
             *  cont++;
             * }*/
            if (TxtBxCantidad.Text == "")
            {
                MessageBox.Show("No se ha registrado ninguna cantidad", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                TxtBxCantidad.Focus();
                cont++;
            }
            if (TxtBxPrecio.Text == "")
            {
                MessageBox.Show("No se ha registrado ningun precio", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                TxtBxCantidad.Focus();
                cont++;
            }


            if (cont == 0)
            {
                matSeg1.WriteXml(Application.StartupPath + "\\ArchMatSeg.xml");
                matSeg1.ReadXml(Application.StartupPath + "\\ArchMatSeg.xml");
                object[] matseg = new object[11];

                matseg[0]  = TxtBxNombre.Text;
                matseg[2]  = TxtBxMarca.Text;
                matseg[3]  = TxtBxModelo.Text;
                matseg[4]  = Date.Text;
                matseg[7]  = TxtBxCantidad.Text;
                matseg[8]  = TxtBxPrecio.Text;
                matseg[9]  = CmBxEstado.Text;
                matseg[10] = cant * precio;

                LblTxtCodigo.Text = matSeg1.TblUniformes.Rows.Count.ToString();
                agregar           = int.Parse(LblTxtCodigo.Text);
                agregar++;
                LblTxtCodigo.Text = agregar.ToString();
                MatSegCodigo mostrarCodigo = new MatSegCodigo();
                mostrarCodigo.LblCodigo.Text = agregar.ToString();
                matSeg1.TblMatSeg.Rows.Add(matseg);
                matSeg1.WriteXml(Application.StartupPath + "\\ArchMatSeg.xml");
                this.Hide();
                mostrarCodigo.ShowDialog();
                if (mostrarCodigo.DialogResult == DialogResult.OK)
                {
                    MessageBox.Show("Se ha guardado exitosamente", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                }

                //TxtBxCantidad.Text = Datos.ToString();

                /*if (Datos.Length > 0)
                 * {
                 *  MessageBox.Show("El material de seguridad ya esta registrado");
                 *  this.Close();
                 *
                 * }
                 * else
                 * {
                 *  matSeg1.TblMatSeg.Rows.Add(matseg);
                 *  matSeg1.WriteXml(Application.StartupPath + "\\ArchMatSeg.xml");
                 *  MessageBox.Show("Se ha guardado exitosamente", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                 *  this.DialogResult = System.Windows.Forms.DialogResult.OK;
                 *  this.Close();
                 * }*/
            }
        }
Ejemplo n.º 14
0
        private void BttGuardar_Click(object sender, EventArgs e)
        {
            cont = 0;


            if (TxtBxNombre.Text == "")
            {
                MessageBox.Show("No se ha registrado ningun nombre del material de seguridad ", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
                TxtBxNombre.Focus();
                cont++;
            }


            if (TxtBxCantidad.Text == "")
            {
                MessageBox.Show("No se ha registrado ninguna cantidad", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
                TxtBxCantidad.Focus();
                cont++;
            }
            if (TxtBxPrecio.Text == "")
            {
                MessageBox.Show("No se ha registrado ningun precio", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
                TxtBxCantidad.Focus();
                cont++;
            }



            if (cont == 0)
            {
                //matSeg1.WriteXml(Application.StartupPath + "\\ArchOficina.xml");
                matSeg1.ReadXml(Application.StartupPath + "\\ArchOficina.xml");
                object[] oficina = new object[8];

                oficina[0] = TxtBxNombre.Text;
                oficina[2] = Date.Text;
                oficina[4] = TxtBxCantidad.Text;
                oficina[5] = TxtBxPrecio.Text;
                oficina[7] = LblPrecioT.Text;


                LblTxtCodigo.Text = matSeg1.TblOficina.Rows.Count.ToString();
                agregar           = int.Parse(LblTxtCodigo.Text);

                /*if (agregar == 99)
                 * {
                 *  MessageBox.Show("Ya no se podran ingresar mas datos o se ELIMINAR todos ", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
                 * }
                 *
                 */
                agregar++;

                LblTxtCodigo.Text = agregar.ToString();
                MatSegCodigo mostrarCodigo = new MatSegCodigo();
                mostrarCodigo.LblCodigo.Text = agregar.ToString();

                matSeg1.TblOficina.Rows.Add(oficina);
                matSeg1.WriteXml(Application.StartupPath + "\\ArchOficina.xml");
                this.Hide();
                mostrarCodigo.ShowDialog();
                if (mostrarCodigo.DialogResult == DialogResult.OK)
                {
                    MessageBox.Show("Se ha guardado exitosamente", "AVISO", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                }
            }
        }