예제 #1
0
        private void ValidarDatosEmpresa(List <string> errors)
        {
            if (string.IsNullOrEmpty(TxtNombre.Text))
            {
                errors.Add(Resources.ErrorRazonSocial);
            }
            else
            {
                Empresa empresa = UsuariosService.GetEmpresaByRazonSocial(TxtNombre.Text);
                if (empresa.IdUsuario != 0)
                {
                    if (empresa.IdUsuario != Usuario.IdUsuario)
                    {
                        errors.Add(Resources.ErrorEmpresaExistenteRazonSocial);
                    }
                }
            }

            if (string.IsNullOrEmpty(TxtCuit.Text))
            {
                errors.Add(Resources.ErrorCuit);
            }
            else
            {
                Empresa empresa = UsuariosService.GetEmpresaByCuit(TxtCuit.Text);
                if (empresa.IdUsuario != 0)
                {
                    if (empresa.IdUsuario != Usuario.IdUsuario)
                    {
                        errors.Add(Resources.ErrorEmpresaExistenteCUIT);
                    }
                }
            }
        }