Example #1
0
 private void Limpiar()
 {
     Myerror.Clear();
     IDnumericUpDown.Value   = 0;
     DescripciontextBox.Text = string.Empty;
     CantidadtextBox.Text    = string.Empty;
 }
Example #2
0
        private void Eliminarbutton3_Click(object sender, EventArgs e)
        {
            RepositorioBase <Usuarios> repositorio = new RepositorioBase <Usuarios>();
            int id = Convert.ToInt32(IDusuarionumericUpDown.Value);

            Myerror.Clear();

            if (IDusuarionumericUpDown.Value == 0)
            {
                MessageBox.Show("No se puede eliminar este usuario", "Fallo!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            Limpiar();
            try
            {
                if (repositorio.Eliminar(id))
                {
                    MessageBox.Show("Eliminado", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("No se puede eliminar este usuario", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception)
            {
                MessageBox.Show("No se pudo eliminar!");
            }
        }
Example #3
0
        private bool Validar()
        {
            Myerror.Clear();
            bool paso = true;

            if (ClientescomboBox.Text == "" || ClientescomboBox.SelectedIndex == -1 || !ExisteCliente())
            {
                Myerror.SetError(ClientescomboBox, "Debe seleccionar un Cliente");
                paso = false;
            }

            if (this.Detalles.Count == 0)
            {
                Myerror.SetError(Agregarbutton, "Debe agregar al menos un producto.");
                paso = false;
            }

            if (paso)
            {
                foreach (var item in this.Detalles)
                {
                    int cantidad        = GetCantidadArticulos(item.ArticulosId);
                    int cantidadDetalle = GetTotalArticulos(item.ArticulosId);
                    int resultado       = cantidad - cantidadDetalle;
                    if (resultado < 0)
                    {
                        MessageBox.Show("La cantidad de " + GetDescripcion(item.ArticulosId) + " supera a la existente.", "Isurus", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return(paso = false);
                    }
                }
            }
            return(paso);
        }
Example #4
0
        private void Eliminarbutton3_Click(object sender, EventArgs e)
        {
            Myerror.Clear();

            int id;

            int.TryParse(EvaluacionIdnumericUpDown1.Text, out id);
            bool paso;



            if (!Existe())
            {
                MessageBox.Show("No se pudo eliminar por que no existe", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Limpiar();
                return;
            }

            paso = EvaluacionBLL.Eliminar(id);

            if (paso)
            {
                MessageBox.Show("Se elimino correctamente", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Limpiar();
            }
            else
            {
                MessageBox.Show("No se pudo eliminar", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #5
0
 private void Limpiar()
 {
     Myerror.Clear();
     EventoIdnumericUpDown.Value = 0;
     TipotextBox.Text            = string.Empty;
     DirecciontextBox.Text       = string.Empty;
     FechadateTimePicker.Value   = DateTime.Now;
 }
Example #6
0
 private void Limpiar()
 {
     Myerror.Clear();
     IDusuarionumericUpDown.Value = 0;
     NombretextBox.Text           = string.Empty;
     ContraseñatextBox.Text       = string.Empty;
     admincheckBox.Checked        = false;
     almacencheckBox.Checked      = false;
     FechadateTimePicker.Value    = DateTime.Now;
 }
Example #7
0
 private void NombretextBox_KeyPress(object sender, KeyPressEventArgs e)
 {
     Myerror.Clear();
     if (!(char.IsLetter(e.KeyChar)) && (e.KeyChar == (char)Keys.Back))
     {
         Myerror.SetError(NombretextBox, "Solo se permiten letras");
         NombretextBox.Focus();
         e.Handled = true;
         return;
     }
 }
Example #8
0
 private void Limpiar()
 {
     EvaluacionIdnumericUpDown1.Value = 0;
     FechadateTimePicker1.Value       = DateTime.Now;
     EstudinatetextBox1.Text          = string.Empty;
     ValortextBox1.Text               = string.Empty;
     LogradotextBox1.Text             = string.Empty;
     PuntosperdidostextBox1.Text      = string.Empty;
     PronosticocomboBox1.SelectedItem = 0;
     Myerror.Clear();
 }
Example #9
0
 private void Limpiar()
 {
     Myerror.Clear();
     ClienteIDnumericUpDown.Value = 0;
     NombretextBox.Text           = string.Empty;
     ApellidotextBox.Text         = string.Empty;
     CedulamaskedTextBox.Text     = string.Empty;
     TelefonomaskedTextBox.Text   = string.Empty;
     EmailtextBox.Text            = string.Empty;
     DirecciontextBox.Text        = string.Empty;
     NombretextBox.Text           = string.Empty;
 }
Example #10
0
        private bool ValidarRemover()
        {
            bool paso = true;

            Myerror.Clear();
            if (dataGridView.SelectedRows == null)
            {
                Myerror.SetError(Eliminarbutton, "Debe seleccionar al menos una fila.");
                paso = false;
            }

            return(paso);
        }
Example #11
0
 private void Limpiar()
 {
     Myerror.Clear();
     FacturaIDnumericUpDown.Value = 0;
     ClientescomboBox.Text        = string.Empty;
     EventoscomboBox.Text         = string.Empty;
     FechadateTimePicker.Value    = DateTime.Now;
     ArticuloscomboBox.Text       = string.Empty;
     TamañotextBox.Text           = string.Empty;
     CantidadtextBox.Text         = string.Empty;
     PreciotextBox.Text           = string.Empty;
     ImportetextBox.Text          = string.Empty;
     TotaltextBox.Text            = string.Empty;
     this.Detalles = new List <DetalleFactura>();
     CargarGrid();
 }
Example #12
0
        private bool ValidarCampos()
        {
            bool paso = true;

            if (string.IsNullOrWhiteSpace(usuariotextBox.Text))
            {
                Myerror.SetError(usuariotextBox, "El campo Usuario no puede estar vacío");
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(contraseñatextBox.Text))
            {
                Myerror.SetError(contraseñatextBox, "El campo Clave no puede estar vacío");
                paso = false;
            }

            return(paso);
        }
Example #13
0
        private void Imprimirbutton_Click(object sender, EventArgs e)
        {
            FacturaBLL            factura = new FacturaBLL();
            List <DetalleFactura> lista   = new List <DetalleFactura>();

            lista = factura.Buscar((int)FacturaIDnumericUpDown.Value).Detalles;

            if (Detalles.Count > 0)
            {
                FacturaReport reporte = new FacturaReport(lista);
                reporte.ShowDialog();
            }
            else
            {
                Myerror.Clear();
                Myerror.SetError(Imprimirbutton, "No hay datos para imprimir.");
            }
        }
Example #14
0
        private bool Validar()
        {
            bool paso = true;

            Myerror.Clear();

            if (string.IsNullOrWhiteSpace(EstudinatetextBox1.Text))
            {
                Myerror.SetError(EstudinatetextBox1, "El campo estudiante no puede estar vacio");
                EstudinatetextBox1.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(ValortextBox1.Text))
            {
                Myerror.SetError(ValortextBox1, "El campo valor no puede estar vacio");
                ValortextBox1.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(LogradotextBox1.Text))
            {
                Myerror.SetError(LogradotextBox1, "El campo calificacion no puede estar vacio");
                LogradotextBox1.Focus();
                paso = false;
            }
            if (decimal.Parse(ValortextBox1.Text) < 0)
            {
                Myerror.SetError(ValortextBox1, "El campo valor no debe ser negativo");
                ValortextBox1.Focus();
                paso = false;
            }
            if (decimal.Parse(LogradotextBox1.Text) < 0)
            {
                Myerror.SetError(LogradotextBox1, "El campo calificacion no debe ser negativo");
                LogradotextBox1.Focus();
                paso = false;
            }
            if (decimal.Parse(PuntosperdidostextBox1.Text) < 0)
            {
                Myerror.SetError(PuntosperdidostextBox1, "El campo punto perdidos no debe ser negativo");
                PuntosperdidostextBox1.Focus();
                paso = false;
            }
            return(paso);
        }
Example #15
0
        private bool ValidarAgregar()
        {
            bool paso = true;

            Myerror.Clear();

            if (ArticuloscomboBox.Text == "" || ArticuloscomboBox.SelectedIndex == -1)
            {
                Myerror.SetError(ArticuloscomboBox, "Debe elegir un producto");
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(PreciotextBox.Text))
            {
                Myerror.SetError(PreciotextBox, "Este campo no puede estar vacio.");
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(TamañotextBox.Text))
            {
                Myerror.SetError(TamañotextBox, "Este campo no puede estar vacio.");
                paso = false;
            }

            if (Convert.ToInt32(PreciotextBox.Text) <= 0)
            {
                Myerror.SetError(PreciotextBox, "La precio no puede ser cero ni menor que cero.");
                paso = false;
            }

            if (Convert.ToInt32(CantidadtextBox.Text) <= 0)
            {
                Myerror.SetError(CantidadtextBox, "La cantidad no puede ser cero ni menor que cero.");
                paso = false;
            }

            if (Convert.ToInt32(TamañotextBox.Text) <= 0)
            {
                Myerror.SetError(TamañotextBox, "La Tamaño no puede ser cero ni menor que cero.");
                paso = false;
            }

            return(paso);
        }
Example #16
0
        private void Buscarbutton1_Click(object sender, EventArgs e)
        {
            Myerror.Clear();
            Evaluacion evaluacion = new Evaluacion();
            int        id;

            int.TryParse(EvaluacionIdnumericUpDown1.Text, out id);
            evaluacion = EvaluacionBLL.Buscar(id);

            if (evaluacion != null)
            {
                Limpiar();
                LlenaCampo(evaluacion);
            }
            else
            {
                MessageBox.Show("No Encontrado", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #17
0
        private bool Validar()
        {
            Myerror.Clear();
            bool paso = true;

            if (string.IsNullOrWhiteSpace(NombretextBox.Text))
            {
                Myerror.SetError(NombretextBox, "El campo nombre no debe estar vacio");
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(ContraseñatextBox.Text))
            {
                Myerror.SetError(ContraseñatextBox, "El campo contraseña no debe estar Vacio");
                paso = false;
            }

            if (admincheckBox.Checked == false && FacturacheckBox.Checked == false && almacencheckBox.Checked == false)
            {
                Myerror.SetError(NivelflowLayoutPanel, "Se debe seleccionar un ragon");
                paso = false;
            }

            if (IDusuarionumericUpDown.Value == 0)
            {
                RepositorioBase <Usuarios> repositorio = new RepositorioBase <Usuarios>();
                var listado = new List <Usuarios>();
                listado = repositorio.GetList(p => true);
                string descripcion = NombretextBox.Text;
                foreach (var u in listado)
                {
                    if (descripcion == u.Nombre)
                    {
                        MessageBox.Show("Este Usuario ya está registrado", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        paso = false;
                    }
                }
            }

            return(paso);
        }
Example #18
0
        private bool Validar()
        {
            bool paso = true;



            if (string.IsNullOrEmpty(DescripciontextBox.Text))
            {
                Myerror.SetError(DescripciontextBox, "El campo descripción no debe estar vacio");
                DescripciontextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrEmpty(CantidadtextBox.Text))
            {
                Myerror.SetError(CantidadtextBox, "El campo cantidad no debe estar vació");
                CantidadtextBox.Focus();
                paso = false;
            }

            return(paso);
        }
Example #19
0
        private bool Validar()
        {
            bool paso = true;



            if (string.IsNullOrEmpty(TipotextBox.Text))
            {
                Myerror.SetError(TipotextBox, "El campo tipo no debe estar vacio");
                TipotextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrEmpty(DirecciontextBox.Text))
            {
                Myerror.SetError(DirecciontextBox, "El campo dirección no debe estar vació");
                DirecciontextBox.Focus();
                paso = false;
            }

            return(paso);
        }
Example #20
0
        private bool Validar()
        {
            bool paso = true;

            Myerror.Clear();

            if (string.IsNullOrWhiteSpace(NombretextBox.Text))
            {
                Myerror.SetError(NombretextBox, "El campo nombre no debe estar vacio!");
                NombretextBox.Focus();
                paso = false;
            }

            if (ValidarNombre())
            {
                Myerror.SetError(NombretextBox, "Ya existe un cliente con el mismo nombre");
                paso = false;
            }

            if (ValidarCedula())
            {
                Myerror.SetError(CedulamaskedTextBox, "Ya existe un cliente con la misma cedula");
                paso = false;
            }

            if (ValidarTelefono())
            {
                Myerror.SetError(TelefonomaskedTextBox, "Ya existe un cliente con el mismo telefono");
                paso = false;
            }

            if (EmailValido())
            {
                Myerror.SetError(EmailtextBox, "Ya existe un cliente con el mismo email");
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(ApellidotextBox.Text))
            {
                Myerror.SetError(ApellidotextBox, "El campo apellido no debe estar vacio!");
                ApellidotextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(CedulamaskedTextBox.Text.Replace("-", "")) || CedulamaskedTextBox.MaskFull == false)
            {
                Myerror.SetError(CedulamaskedTextBox, "El campo cedula no puede estar vacio!");
                CedulamaskedTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(TelefonomaskedTextBox.Text.Replace("-", "")) || TelefonomaskedTextBox.MaskFull == false)
            {
                Myerror.SetError(TelefonomaskedTextBox, "El campo teléfono no puede estar vacio!");
                TelefonomaskedTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(EmailtextBox.Text))
            {
                Myerror.SetError(EmailtextBox, "El campo email no puede estar vacio!");
                EmailtextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(DirecciontextBox.Text))
            {
                Myerror.SetError(DirecciontextBox, "El campo dirección no puede estar vacio!");
                DirecciontextBox.Focus();
                paso = false;
            }

            if (!ValidarEmail(EmailtextBox.Text))
            {
                Myerror.SetError(EmailtextBox, "El formato del correo no es valido");
                EmailtextBox.Focus();
            }

            return(paso);
        }
Example #21
0
 private void EmailtextBox_TextChanged(object sender, EventArgs e)
 {
     Myerror.Clear();
 }