private Boolean Comprobar() { Boolean Resultado = true; Notificador.Clear(); if (txbUsuario.TextLength == 0) { Resultado = false; Notificador.SetError(txbUsuario, "Este campo no puedo quedar vacio"); } if (txbClave.TextLength == 0) { Resultado = false; Notificador.SetError(txbClave, "Este campo no puedo quedar vacio"); } if (txbEmpleado.TextLength == 0) { Resultado = false; Notificador.SetError(btnSeleccionar, "Seleccione un empleado para el usuario creado"); } return(Resultado); }
private Boolean Verificacion() { Boolean Verificado = true; Notificador.Clear(); if (rdbGeneral.Checked == false && rdbProductoEspe.Checked == false && rdbMarcaEspe.Checked == false) { Notificador.SetError(gpbTipoCompra, "Seleccione un una opción"); } else if (rdbProductoEspe.Checked == true) { if (txbProducto.TextLength <= 0) { Verificado = false; Notificador.SetError(btnProducto, "Seleccione un producto"); } } else if (rdbMarcaEspe.Checked == true) { if (txbIdMarca.TextLength <= 0) { Verificado = false; Notificador.SetError(btnMarca, "Seleccione un producto"); } } return(Verificado); }
private Boolean Comprobar() { Boolean Resultado = true; Notificador.Clear(); if (txbDescripcion.TextLength == 0) { Resultado = false; Notificador.SetError(txbDescripcion, "Este campo no puede quedar vacío"); } if (txbAula.TextLength == 0) { Resultado = false; Notificador.SetError(txbAula, "Este campo no puede quedar vacío"); } if (txbCupo.TextLength == 0) { Resultado = false; Notificador.SetError(txbCupo, "Este campo no puede quedar vacío"); } return(Resultado); }
private void enviarCorreoAsync(int intRegistroID, string vchEmail, string vchNombre) { dynamic response = null; try { string mensaje = ""; string ubicacion_sitio = ""; using (var db = new App_Data.TomoUDBEntities()) { var sitio = db.tbl_SYS_Configuraciones.FirstOrDefault(i => i.vchConfiguracion == "ubicacion_sitio"); ubicacion_sitio = sitio.vchValor; } string url = ubicacion_sitio + "/Confirmar.aspx?var=" + Security.Encrypt(intRegistroID.ToString()); mensaje = "<table border='0' cellspacing='0' cellpadding='0' width='652' height='400'><tbody><tr><td><table border='0' cellspacing='0' cellpadding='0' width='650' height='400'><tbody><tr><td><table cellspacing='0' cellpadding='0' border='0'><tbody><tr height='24'><td></td></tr><tr><td width='25'></td><td style='font:ArialMT;font-family:Arial;font-size:16px;font-weight:bold;color:#e91e63' align='left' width='300' height='17'>Apreciable profesional de la salud:</td></tr><tr height='19'><td></td></tr></tbody></table></td><td><table cellspacing='0' cellpadding='0'><tbody><tr height='20'><td></td></tr><tr><td align='right' width='299.8'><img src='http://www.tomo-u.com/wp-content/uploads/2017/09/logo01-tomo-u-e1506445011780.png' class='CToWUd'></td><td width='20.2'></td></tr><tr height='15'><td></td></tr></tbody></table></td></tr><tr height='5'><td bgcolor='#e91e63' colspan='2'></td></tr><tr height='10'><td bgcolor='#fafafa' colspan='2'></td></tr><tr bgcolor='#fafafa'><td colspan='2'><table cellspacing='0' cellpadding='0' border='0'><tbody><tr><td width='25'></td><td><table bgcolor='#ffffff' cellspacing='0' cellpadding='0' border='0' width='600'><tbody><tr><td><table cellspacing='0' cellpadding='0' border='0'><tbody><tr><td width='20'></td><td style='font:ArialMT;font-family:Arial;font-size:10px;line-height:2;text-align:right;color:#8c8c8c' height='20' width='560'>FechadelCorreo</td><td width='20'></td></tr></tbody></table></td></tr><tr><td><table cellspacing='0' cellpadding='0' border='0'><tbody><tr height='10'><td></td></tr><tr height='4'><td></td></tr><tr height='22'><td colspan='2'><table cellspacing='0' cellpadding='0' border='0'><tbody><tr><td width='55'></td><td style='font:ArialMT;font-family:Arial;line-height:1.54;text-align:left;color:#666666;font-size:14px' width='300'><b>NombredelProfesional</b></td><td width='15'></td></tr></tbody></table></td></tr><tr height='16'><td></td></tr><tr height='18'><td><table cellspacing='0' cellpadding='0' border='0'><tbody><tr><td width='55'></td><td style='font:ArialMT;font-family:Arial;line-height:1.13;font-size:16px;text-align:left;color:#666666' width='510'><div style='text-align: justify; text-justify: inter-word;'>Se ha realizado el <b>registro</b> al evento de Tomo-U 2018; si usted no realizó el registro favor de hacer caso omiso al presente correo, de lo contrario, favor de confirmar a través del siguiente link:</div></td><td width='45'></td></tr></tbody></table></td></tr><tr height='8'><td></td></tr></tbody></table></td></tr><tr height='10'><td colspan='5'></td></tr><tr height='27'><td colspan='5'><table cellspacing='0' cellpadding='0' border='0'><tbody><tr><td width='50'></td><td style='font:ArialMT;font-family:Arial;font-size:14px;line-height:1.93;text-align:right;color:#666666' width='500'><table width=100%><tr><td width='250'></td><td align='right' class='m_6713843551829686631button_style' id='m_6713843551829686631button_text' style='font-family:Calibri,Trebuchet,Arial,sans-serif;font-weight:300;font-stretch:normal;text-align:center;color:#fff;font-size:15px;background:#0079c1;border-radius:7px!important;line-height:1.45em;padding:7px 15px 8px;font-size:1em;padding-bottom:7px;margin:0 auto 16px' valign='middle'><span class='m_6713843551829686631aloha-editable'><a type='Link' style='text-decoration:none;color:#ffffff' href='https://www.google.com' target='_blank'>Confirmar</a></span></td><td width='250'></td></tr></table></td><td width='50'></td></tr></tbody></table></td></tr><tr height='10'><td colspan='5'></td></tr></tbody></table></td><td width='25'></td></tr></tbody></table></td></tr><tr bgcolor='#fafafa'><td colspan='2'><table cellspacing='0' cellpadding='0' border='0'><tbody><tr><td colspan='3'></td></tr><tr><td width='30'></td><td style='font:ArialMT;font-family:Arial;font-size:14px;line-height:1.14;text-align:center;color:#e91e63' width='590'><b>Tomo-U 2018</b></td><td width='30'></td></tr><tr height='15'><td width='30'></td><td style='font:ArialMT;font-family:Arial;font-size:11px;line-height:1.14;text-align:center;color:#e91e63' width='590'><b>[email protected]</b></td><td width='30'></td></tr><tr><td colspan='3'></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>"; mensaje = mensaje.Replace("NombredelProfesional", vchNombre); mensaje = mensaje.Replace("https://www.google.com", url); string fecha = DateTime.Now.ToString("U"); mensaje = mensaje.Replace("FechadelCorreo", fecha); Notificador.EnviarCorreo(vchEmail, "Registro Tomo-u", mensaje); } catch (Exception eEC) { response = new { Message = "Operación no permitida", Success = false }; Log.EscribeLog("Existe un error al enviar el correo: " + eEC.Message); } }
public async Task <PessoaDto> Armazenar(PessoaDto dto) { if (!ValidarDto(dto)) { return(null); } var pessoa = new Pessoa(dto.Nome, dto.DataDeNascimento, (TipoDaPessoaEnum)dto.TipoDaPessoa); if (pessoa.Invalid) { Notificador.Notificar(pessoa.Notificacoes); return(null); } await _pessoaRepositorio.Incluir(pessoa); await _pessoaRepositorio.Salvar(); return(new PessoaDto { Id = pessoa.Id, Nome = pessoa.Nome, DataDeNascimento = pessoa.DataDeNascimento }); }
public void FormatarResposta_TipoRequisicao_GET_Lista() { var notificador = new Notificador(); var responseFormatter = new ResponseFormatter(notificador); var editoras = new List <EditoraViewModel> { new() { Id = Guid.NewGuid(), Nome = "Editora", Email = "*****@*****.**", Pais = "Brasil" } }; var resposta = new Response <IEnumerable <EditoraViewModel> >(editoras, notificador); var resultado = responseFormatter.FormatarResposta(TipoRequisicao.Get, editoras); resultado.Should().BeOfType <OkObjectResult>() .Which.Value.Should().BeEquivalentTo(resposta); resultado.Should().BeOfType <OkObjectResult>() .Which.StatusCode.Should().Be((int)HttpStatusCode.OK); }
public UsuarioController(IMapper mapper, IConfiguration configuration, Notificador notificador, IUsuarioService usuarioService) { _mapper = mapper; _configuration = configuration; _notificador = notificador; _usuarioService = usuarioService; }
private void btnAgregarProd_Click(object sender, EventArgs e) { bool found = false; if (VerificacionProducto()) { for (int i = 0; i < dtgvDatosProducto.RowCount; i++) { if (dtgvDatosProducto.Rows[i].Cells["idconsumible"].Value.ToString().Equals(txbIdProducto.Text)) { found = true; Notificador.SetError(txbIdProducto, "Este producto ya está en la lista"); } } if (!found) { dtgvDatosProducto.Rows.Add( txbIdProducto.Text, txbProducto.Text, txbCantidad.Text, txbPrecioCompra.Text, txbPrecioVenta.Text); } } }
public async Task BuscarEditoraPorId_DeveRetornarComSucesso() { var newId = Guid.NewGuid(); var mapper = new Mock <IMapper>(); var notificador = new Notificador(); var editora = new Domain.Entities.Editora(newId, "Editora Fake", "*****@*****.**", "Brasil"); var editoraViewModel = new EditoraViewModel { Id = editora.Id, Nome = editora.Nome, Email = editora.Email, Pais = editora.Pais }; var query = new Mock <IEditoraRepository>(); query.Setup(x => x.BuscarEditoraPorId(It.IsAny <Guid>())) .ReturnsAsync(editora); mapper.Setup(x => x.Map <EditoraViewModel>(It.IsAny <Domain.Entities.Editora>())) .Returns(editoraViewModel); var useCase = new BuscarEditoraPorIdUseCase(query.Object, notificador, mapper.Object); var resultado = await useCase.Executar(newId); resultado.Should().Be(editoraViewModel); }
private Boolean Validar() { Boolean verificado = true; Notificador.Clear(); if (txbAlmacenamientos.TextLength == 0) { Notificador.SetError(txbAlmacenamientos, "Este campo no puede quedar vacío"); verificado = false; } //Verificacion para que no se repita un dato String Consulta = "SELECT LugarAlamacenamiento From almacenamientos WHERE LugarAlmacenamiento = '" + txbAlmacenamientos.Text + "';"; DataTable Datos = new DataTable(); DataManager.CLS.DBOperacion Consultor = new DataManager.CLS.DBOperacion(); Datos = Consultor.Consultar(Consulta); if (Datos.Rows.Count == 1) { verificado = false; MessageBox.Show("La zona de almacenamiento ya se encuentra registrada", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Warning); } return(verificado); }
private Boolean VerificacionProducto() { Boolean Verificado = true; Notificador.Clear(); if (txbIdProducto.TextLength <= 0) { Verificado = false; Notificador.SetError(txbIdProducto, "Este campo debe llenarse"); } if (txbPrecioCompra.TextLength <= 0) { Verificado = false; Notificador.SetError(txbPrecioCompra, "Este campo debe llenarse"); } if (txbPrecioVenta.TextLength <= 0) { Verificado = false; Notificador.SetError(txbPrecioVenta, "Este campo debe llenarse"); } if (txbCantidad.TextLength <= 0) { Verificado = false; Notificador.SetError(txbCantidad, "Este campo debe llenarse"); } return(Verificado); }
public void DadoClienteComInformacaoValidaDeveIncluirNoBanco() { //Arrange var clienteId = Guid.NewGuid(); var cliente = new Cliente() { Id = clienteId, Nome = "Carlos", Endereco = "Rua Teste", }; var options = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase("DbHungryPizzaContext") .Options; var contexto = new ApplicationDbContext(options); var clienteRepository = new ClienteRepository(contexto); var notificador = new Notificador(); var clienteService = new ClienteService(clienteRepository, notificador); //Act var retorno = clienteService.Adicionar(cliente); //Assert var cadastroCliente = clienteRepository.ObterCliente(clienteId); Assert.NotNull(cadastroCliente.Result); }
private Boolean Validar() { Boolean verificado = true; Notificador.Clear(); if (txbUsuarios.TextLength == 0) { Notificador.SetError(txbUsuarios, "Este campo no puede quedar vacío"); verificado = false; } if (txbCredencial.TextLength == 0) { Notificador.SetError(txbCredencial, "Este campo no puede quedar vacío"); verificado = false; } String Consulta = "SELECT Usuario From Usuarios WHERE usuario = '" + txbUsuarios.Text + "';"; DataTable Datos = new DataTable(); DataManager.CLS.DBOperacion Consultor = new DataManager.CLS.DBOperacion(); Datos = Consultor.Consultar(Consulta); if (Datos.Rows.Count == 1) { verificado = false; MessageBox.Show("Este Usuario ya se encuentra registrado", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Warning); } return(verificado); }
public async Task <RendaPorPessoaDto> Armazenar(RendaPorPessoaDto dto) { if (!ValidarDto(dto)) { return(null); } var rendaPorPessoa = new RendaPorPessoa( dto.PessoaId, dto.NomePessoa, dto.Valor); if (rendaPorPessoa.Invalid) { Notificador.Notificar(rendaPorPessoa.Notificacoes); return(null); } await _rendaPorPessoaRepositorio.Incluir(rendaPorPessoa); await _rendaPorPessoaRepositorio.Salvar(); var retorno = new RendaPorPessoaDto { Id = rendaPorPessoa.Id, PessoaId = rendaPorPessoa.PessoaId, NomePessoa = rendaPorPessoa.NomePessoa, Valor = rendaPorPessoa.Valor }; _alteradorDePontosPorInsercaoDeRenda.Alterar(retorno); return(retorno); }
public static void Main() { MinhaClasse c = new MinhaClasse(); Notificador notif = new Notificador(c.NotificadorInstanceHandler); notif += new Notificador(MinhaClasse.NotificadorStaticHandler); string retorno = notif("Broadcast..."); Console.WriteLine(retorno); notif -= new Notificador(MinhaClasse.NotificadorStaticHandler); retorno = notif("Broadcast..."); Console.WriteLine(retorno); notif -= new Notificador(c.NotificadorInstanceHandler); try { notif("Broadcast..."); } catch (Exception e) { Console.WriteLine(e); } }
public static void Main() { MinhaClasse c = new MinhaClasse(); Notificador s_notif = new Notificador(MinhaClasse.NotificadorStaticHandler); MinhaClasse.Notificador i_notif = new MinhaClasse.Notificador(c.NotificadorInstanceHandler); s_notif += i_notif; s_notif("[1] Broadcast s_notif..."); Notificador notif = s_notif + i_notif; notif("[2] Broadcast notif..."); notif = s_notif - i_notif; notif("[3] Broadcast notif..."); notif = null; s_notif("[4] Broadcast s_notif..."); i_notif("[5] Broadcast i_notif..."); }
public ControleVeiculoService(IVeiculoRepository veiculoRepository, IEstabelecimentoRepository estabelecimentoRepository, Notificador notificador, IControleVeiculoRepository controleVeiculoRepository) { _veiculoRepository = veiculoRepository; _estabelecimentoRepository = estabelecimentoRepository; _notificador = notificador; _controleVeiculoRepository = controleVeiculoRepository; }
private Boolean VerificarDatos() { Boolean Verificado = true; Notificador.Clear(); if (txbUsuario.TextLength == 0) { Notificador.SetError(txbUsuario, "Este campo no puede quedar vacio"); Verificado = false; } if (txbContra.TextLength == 0) { Notificador.SetError(txbContra, "Este campo no puede quedar vacio"); Verificado = false; } if (txbContra2.TextLength == 0) { Notificador.SetError(txbContra2, "Este campo no puede quedar vacio"); Verificado = false; } return(Verificado); }
private Boolean Verificacion() { Boolean Verificado = true; Notificador.Clear(); if (txbExpediente.TextLength <= 0) { Verificado = false; Notificador.SetError(txbExpediente, "Este campo debe llenarse"); } if (txbNombres.TextLength <= 0) { Verificado = false; Notificador.SetError(txbNombres, "Este campo debe llenarse"); } if (txbApellidos.TextLength <= 0) { Verificado = false; Notificador.SetError(txbApellidos, "Este campo debe llenarse"); } if (txbMunicipio.TextLength <= 0) { Verificado = false; Notificador.SetError(txbMunicipio, "Este campo debe llenarse"); } return(Verificado); }
private Boolean Verificacion() { Boolean Verificado = true; Notificador.Clear(); if (txbIdMarca.TextLength <= 0) { Verificado = false; Notificador.SetError(txbIdMarca, "Este campo debe llenarse"); } if (txbNombre.TextLength <= 0) { Verificado = false; Notificador.SetError(txbNombre, "Este campo debe llenarse"); } if (txbAlias.TextLength <= 0) { Verificado = false; Notificador.SetError(txbAlias, "Este campo debe llenarse"); } if (txbPrecioVenta.TextLength <= 0) { Verificado = false; Notificador.SetError(txbPrecioVenta, "Este campo debe llenarse"); } return(Verificado); }
private Boolean Comprobar() { Boolean Resultado = true; Notificador.Clear(); if (txtUsuario.TextLength == 0) { Resultado = false; Notificador.SetError(txtUsuario, "Este campo no puede quedar vacio."); } if (txtClave.TextLength == 0) { Resultado = false; Notificador.SetError(txtClave, "Este campo no puede quedar vacio."); } if (txtIDEmpleado.TextLength == 0) { Resultado = false; Notificador.SetError(txtIDEmpleado, "Este campo no puede quedar vacio."); } if (txtEmpleado.TextLength == 0) { Resultado = false; Notificador.SetError(txtEmpleado, "Este campo no puede quedar vacio."); } return(Resultado); }
public async Task <Resultado> IsUserAbleToAnswer(int idQuestionario, int idUsuario) { await _service.IsUserAbleToAnswer(idQuestionario, idUsuario); return(Notificador.HasNotification() ? Resultado.Failed(Notificador.GetNotificationsMessages()) : Resultado.Successfull()); }
public async Task <Resultado <List <QuestionarioRespostaViewModel> > > GetAnswersByQuiz(int idQuestionario) { var answers = MapToViewModel(await _service.GetAnswersByQuiz(idQuestionario)); return(Notificador.HasNotification() ? Resultado <List <QuestionarioRespostaViewModel> > .Failed(Notificador.GetNotificationsMessages()) : Resultado <List <QuestionarioRespostaViewModel> > .Successfull(answers)); }
public async Task <Resultado <QuestionarioRespostaDetailViewModel> > GetAnswersById(int id) { var answers = Mapper.Map <QuestionarioRespostaDetailViewModel>(await _service.GetByIdWithAnswers(id)); return(Notificador.HasNotification() ? Resultado <QuestionarioRespostaDetailViewModel> .Failed(Notificador.GetNotificationsMessages()) : Resultado <QuestionarioRespostaDetailViewModel> .Successfull(answers)); }
public EstacionamentoController(IEstabelecimentoService estabelecimentoService, IMapper mapper, Notificador notificador, IVeiculoService veiculoService, IControleVeiculoService controleVeiculoService) { _estabelecimentoService = estabelecimentoService; _mapper = mapper; _notificador = notificador; _veiculoService = veiculoService; _controleVeiculoService = controleVeiculoService; }
public async Task <Resultado <ManifestacaoViewModel> > GetById(int id) { var manifestation = MapToViewModel(await _service.GetByIdWithDetails(id, _user.GetId())); return(Notificador.HasNotification() ? Resultado <ManifestacaoViewModel> .Failed(Notificador.GetNotificationsMessages()) : Resultado <ManifestacaoViewModel> .Successfull(manifestation)); }
public static void Main() { MinhaClasse c = new MinhaClasse(); Notificador notif = new Notificador(c.NotificadorInstanceHandler); notif("Broadcast..."); }
public async Task <Resultado <QuestionarioReportViewModel> > GetQuizForReport(int id) { var quiz = Mapper.Map <QuestionarioReportViewModel>(await _service.GetQuizForReport(id)); return(Notificador.HasNotification() ? Resultado <QuestionarioReportViewModel> .Failed(Notificador.GetNotificationsMessages()) : Resultado <QuestionarioReportViewModel> .Successfull(quiz)); }
public async Task <Resultado> Delete(int id) { await _service.Delete(id); return(Notificador.HasNotification() ? Resultado <CursoViewModel> .Failed(Notificador.GetNotificationsMessages()) : Resultado.Successfull()); }
public async Task <Resultado> Delete(int id) { await _service.Delete(id); return(Notificador.HasNotification() ? Resultado.Failed(Notificador.GetNotifications().Select(x => x.Mensagem).ToArray()) : Resultado.Successfull()); }