示例#1
0
        private bool Validar()
        {
            bool paso = true;

            if (DescripcionTextBox.Text == string.Empty)
            {
                MyErrorProvider.SetError(DescripcionTextBox, "Debes agregar un dato a este campo");
                DescripcionTextBox.Focus();

                paso = false;
            }
            if (this.Detalle.Count == 0)
            {
                MyErrorProvider.SetError(DetalleDataGrid, "Debes agregar Tareas a este Data grid");
                DetalleDataGrid.Focus();

                paso = false;
            }
            if (ProyectosBLL.ExisteDescripcion(DescripcionTextBox.Text, (int)ProyectoIdNumericUpDown.Value))
            {
                MyErrorProvider.SetError(DescripcionTextBox, "Esta descripcion ya existe, agrega otra diferente!");
                DescripcionTextBox.Focus();

                paso = false;
            }

            return(paso);
        }
示例#2
0
        private bool Validar()
        {
            bool paso = true;

            if (NombreTextBox.Text == string.Empty)
            {
                MessageBox.Show(NombreTextBox.Text, "El campo Nombre no puede estar vacio ");
                NombreTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(DireccionTextBox.Text))
            {
                MessageBox.Show(DireccionTextBox.Text, "El campo Direccion no puede estar vacio");
                DireccionTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(CedulaTextBox.Text.Replace("-", "")))
            {
                MessageBox.Show(CedulaTextBox.Text, "El campo Cedula no puede estar vacio");
                CedulaTextBox.Focus();
                paso = false;
            }


            if (this.Detalles.Count == 0)
            {
                MessageBox.Show(DetalleDataGrid.ToString(), "Debe Agregar algun Telefono");
                TelefonoTextBox.Focus();
                paso = false;
            }

            return(paso);
        }
示例#3
0
        private bool Validar()
        {
            bool paso = true;

            if (NombreTextBox.Text == string.Empty)
            {
                MessageBox.Show("El campo no puede estar vacio", "Error");
                NombreTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(DireccionTextBox.Text))
            {
                MessageBox.Show("El campo Direccion no puede estar vacio", "Error");
                DireccionTextBox.Focus();
                paso = false;
            }

            if (string.IsNullOrWhiteSpace(CedulaTextBox.Text.Replace("-", "")))
            {
                MessageBox.Show("El campo Cedula no puede estar vacio", "Error");
                CedulaTextBox.Focus();
                paso = false;
            }


            if (string.IsNullOrEmpty(FechaDatePicker.Text))
            {
                MessageBox.Show("El campo Fecha no puede estar vacio", "Error");
                FechaDatePicker.Focus();
                paso = false;
            }

            if (this.Detalle.Count == 0)
            {
                MessageBox.Show("Esta campo no puede estar vacio", "Error");
                DetalleDataGrid.Focus();
                paso = false;
            }

            return(paso);
        }
示例#4
0
        private void RemoverFilaButton_Click(object sender, EventArgs e)
        {
            string tiempo;
            int    total = Convert.ToInt32(TiempoTotalTextBox.Text);

            MyErrorProvider.Clear();

            if ((DetalleDataGrid.Rows.Count > 0) && (DetalleDataGrid.CurrentRow != null))
            {
                tiempo = DetalleDataGrid.CurrentRow.Cells[5].Value.ToString();
                total -= Convert.ToInt32(tiempo);

                TiempoTotalTextBox.Text = Convert.ToString(total);

                Detalle.RemoveAt(DetalleDataGrid.CurrentRow.Index);
                CargarGrid();
            }
            else
            {
                MyErrorProvider.SetError(DetalleDataGrid, "Debes agregar Datos.");
                DetalleDataGrid.Focus();
            }
        }
示例#5
0
        private bool Validar()
        {
            bool paso = true;

            if (string.IsNullOrWhiteSpace(NombreTex.Text))
            {
                MessageBox.Show("El Campo Nombre no puede estar vacio");
                NombreTex.Focus();
                paso = false;
            }
            else
            {
                foreach (var caracter in NombreTex.Text)
                {
                    if (!char.IsLetter(caracter) && !char.IsWhiteSpace(caracter))
                    {
                        paso = false;
                        MessageBox.Show("El Campo nombre solo recibe TEXTO...");
                    }
                    else
                    if (!char.IsLetter(caracter) && !char.IsWhiteSpace(caracter))
                    {
                        paso = true;
                    }
                }
            }

            if (string.IsNullOrWhiteSpace(DireccionTex.Text))
            {
                MessageBox.Show("El Campo Direccion Debe LLenarse..");
                DireccionTex.Focus();
                paso = false;
            }
            if (FechaNacimientoDataPike.Text == string.Empty)
            {
                MessageBox.Show("Seleccione una Fecha Por favor...");
                FechaNacimientoDataPike.Focus();
                paso = false;
            }
            if (string.IsNullOrWhiteSpace(CedulaTex.Text))
            {
                MessageBox.Show("El Campo Cadula no puede estar vacio");
                CedulaTex.Focus();
                paso = false;
            }
            else
            {
                foreach (var caracter in CedulaTex.Text)
                {
                    if (!char.IsDigit(caracter))
                    {
                        paso = false;
                        MessageBox.Show("Escriba solo numeros en el campo CEDULA..");
                    }
                    else
                    if (!char.IsDigit(caracter))
                    {
                        paso = true;
                    }
                }
            }

            if (DetalleDataGrid.Columns.Count == 0)
            {
                MessageBox.Show("Tiene qe agragar el TELEFONO y el TIPO para Guardar...");
                DetalleDataGrid.Focus();
                paso = false;
            }
            return(paso);
        }