Example #1
0
 public bool ValidarGuardar()
 {
     if (TxtNumeroIdentificacion.Text == "")
     {
         TxtNumeroIdentificacion.Focus();
         return(false);
     }
     else
     {
         if (TxtNombreCorto.Text == "")
         {
             TxtNombreCorto.Focus();
             return(false);
         }
         else
         {
             if (TxtNombreExtendido.Text == "")
             {
                 TxtNombreExtendido.Focus();
                 return(false);
             }
             else
             {
                 if (TxtDireccion.Text == "")
                 {
                     TxtDireccion.Focus();
                     return(false);
                 }
                 else
                 {
                     if (TxtTelefono.Text == "")
                     {
                         TxtTelefono.Focus();
                         return(false);
                     }
                     else
                     {
                         if (CboIdentificacion.SelectedIndex < 0)
                         {
                             CboIdentificacion.Focus();
                             return(false);
                         }
                         else
                         {
                             if (CboIdentificacion.SelectedIndex < 0)
                             {
                                 CboIdentificacion.Focus();
                                 return(false);
                             }
                             else
                             {
                                 if (TxtTelefono.Text == "")
                                 {
                                     TxtTelefono.Focus();
                                     return(false);
                                 }
                                 else
                                 {
                                     if (TxtCorreo.Text == "")
                                     {
                                         TxtCorreo.Focus();
                                         return(false);
                                     }
                                     else
                                     {
                                         if (TxtCodigoPostal.Text == "")
                                         {
                                             TxtCodigoPostal.Focus();
                                             return(false);
                                         }
                                         else
                                         {
                                             return(true);
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Example #2
0
        private bool ValidarCampos()
        {
            if (Editar)
            {
                if (IdSucursal == 0)
                {
                    Soporte.MsgError("Seleccione un registro al que desea Actualizar.");
                    TxtNombre.Focus();
                    return(false);
                }
            }


            if (string.IsNullOrEmpty(TxtNombre.Text) || TxtNombre.Text == "0")
            {
                Soporte.MsgError("Ingrese Nombre de la Sucursal");
                TxtNombre.Focus();
                return(false);
            }
            if (string.IsNullOrEmpty(TxtTelefono.Text) || TxtTelefono.Text == "0")
            {
                Telefono = "Registro Pendiente";
            }

            if (string.IsNullOrEmpty(TxtCorreo.Text) || TxtCorreo.Text == "0")
            {
                Correo = "*****@*****.**";
            }
            else
            {
                if (Soporte.ValidarMail(TxtCorreo.Text) == false)
                {
                    Soporte.MsgError("El correo no cuenta con el Formato correcto");
                    TxtCorreo.Focus();
                    TxtCorreo.SelectAll();
                    return(false);
                }
            }

            if (CmbEmpresa.SelectedIndex == 0)
            {
                Soporte.MsgError("Seleccione una empresa al que pertenecera la Sucursal");
                CmbEmpresa.Focus();
                CmbEmpresa.SelectAll();
                return(false);
            }
            if (CmbxPais.SelectedIndex == 0)
            {
                Soporte.MsgError("Seleccione un Pais");
                CmbxPais.Focus();
                CmbxPais.SelectAll();
                return(false);
            }
            if (CmbxEstado.SelectedIndex == 0)
            {
                Soporte.MsgError("Seleccione un Estado");
                CmbxEstado.Focus();
                CmbxEstado.SelectAll();
                return(false);
            }
            if (CmbxMunicipio.SelectedIndex == 0)
            {
                Soporte.MsgError("Seleccione un Municipio");
                CmbxMunicipio.Focus();
                CmbxMunicipio.SelectAll();
                return(false);
            }

            if (CmbColonias.SelectedIndex == 0)
            {
                Soporte.MsgError("Seleccione una Colonia");
                CmbColonias.Focus();
                CmbColonias.SelectAll();
                return(false);
            }
            if (TxtCodigoPostal.TextLength < 4)
            {
                Soporte.MsgError("Ingrse un Codigo Postal Valido.");
                TxtCodigoPostal.Focus();
                return(false);
            }
            if (TxtCalle.TextLength < 5)
            {
                Soporte.MsgError("Ingrse una calle valido");
                TxtCalle.Focus();

                return(false);
            }
            if (string.IsNullOrEmpty(TxtEntreCalles.Text) || TxtEntreCalles.Text == "0")
            {
                Entre_Calles = "Sin Registro";
            }
            if (string.IsNullOrEmpty(TxtNumExterno.Text) || TxtNumExterno.Text == "0")
            {
                Numero_Externo = "SIN NUMERO";
            }

            if (string.IsNullOrEmpty(TxtNumInterno.Text) || TxtNumInterno.Text == "0")
            {
                Numero_Interno = "SIN NUMERO";
            }

            return(true);
        }