public HttpResponseMessage Login(Autenticacao autenticacao) { var response = new HttpResponseMessage(); try { var lista = _service.Autenticacao.Authenticate(autenticacao.Email, autenticacao.Senha); response = Request.CreateResponse(HttpStatusCode.OK, lista); } catch (Exception ex) { response = Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message); } return response; }
public ClienteController(IHttpContextAccessor context) { AutenticacaoServico = new Autenticacao(context); }
public bool Delete(string id, Autenticacao value) { return(_service.ScheduleDelete(id, value)); }
public CheckList() { InitializeComponent(); ConfiguracoesBLL BLL3 = new ConfiguracoesBLL(); conf = BLL3.Busca(); if (conf != null) { int qtd; try { qtd = Convert.ToInt32(conf.QtdAreas); } catch { qtd = 1; } for (int i = 1; i <= qtd; i++) { comboArea.Items.Add(i); } } OleoBLL BLL = new OleoBLL(); veiculos = BLL.ListaVeiculos(); if (veiculos != null) { foreach (Veiculo p in veiculos) { if (p.Situacao == 0) { comboPlaca.Items.Add(p.Placa); veiculosB.Add(p); } } } CadItemBLL BLL2 = new CadItemBLL(); item = BLL2.ListaItem(); if (item != null) { check1.Visible = true; check1.Text = item[0].Nome; if (item.Count > 1) { check2.Visible = true; check2.Text = item[1].Nome; } if (item.Count > 2) { check3.Visible = true; check3.Text = item[2].Nome; } if (item.Count > 3) { check4.Visible = true; check4.Text = item[3].Nome; } if (item.Count > 4) { check5.Visible = true; check5.Text = item[4].Nome; } if (item.Count > 5) { check6.Visible = true; check6.Text = item[5].Nome; } if (item.Count > 6) { check7.Visible = true; check7.Text = item[6].Nome; } if (item.Count > 7) { check8.Visible = true; check8.Text = item[7].Nome; } if (item.Count > 8) { check9.Visible = true; check9.Text = item[8].Nome; } if (item.Count > 9) { check10.Visible = true; check10.Text = item[9].Nome; } if (item.Count > 10) { check11.Visible = true; check11.Text = item[10].Nome; } if (item.Count > 11) { check12.Visible = true; check12.Text = item[11].Nome; } if (item.Count > 12) { check13.Visible = true; check13.Text = item[12].Nome; } if (item.Count > 13) { check14.Visible = true; check14.Text = item[13].Nome; } if (item.Count > 14) { check15.Visible = true; check15.Text = item[14].Nome; } if (item.Count > 15) { check16.Visible = true; check16.Text = item[15].Nome; } if (item.Count > 16) { check17.Visible = true; check17.Text = item[16].Nome; } if (item.Count > 17) { check18.Visible = true; check18.Text = item[17].Nome; } if (item.Count > 18) { check19.Visible = true; check19.Text = item[18].Nome; } if (item.Count > 19) { check20.Visible = true; check20.Text = item[19].Nome; } if (item.Count > 20) { check21.Visible = true; check21.Text = item[20].Nome; } if (item.Count > 21) { check22.Visible = true; check22.Text = item[21].Nome; } } dateTimeInicio.Value = DateTime.Now; txtTatico.Text = Autenticacao.GetApelido(); MensagemErro(); }
//TELA TO ENTITY private Check TelaToEntity() { Check c = new Check(); c.CodTatico = Autenticacao.GetCodUsuario().ToString(); c.Tatico = Autenticacao.GetNomeUsuario(); //c.Area = comboArea.Text; RadioGroup Area = FindViewById <RadioGroup>(Resource.Id.Area); RadioButton AreaSelected = FindViewById <RadioButton>(Area.CheckedRadioButtonId); if (AreaSelected.Text.ToString().Equals("ALPHA 1")) { c.Area = "1"; } else { c.Area = "2"; } RadioGroup VTR = FindViewById <RadioGroup>(Resource.Id.VTR); RadioButton VtrSelected = FindViewById <RadioButton>(VTR.CheckedRadioButtonId); if (VtrSelected != null) { c.Placa = VtrSelected.Text; } else { return(null); } EditText KM = FindViewById <EditText>(Resource.Id.KM); c.KmInicial = KM.Text; if (!string.IsNullOrEmpty(c.KmInicial)) { if (c.KmInicial.Length <= 2) { return(null); } } if (string.IsNullOrEmpty(c.KmInicial)) { return(null); } EditText Obs1 = FindViewById <EditText>(Resource.Id.OBS1); c.Obs = Obs1.Text; if (string.IsNullOrEmpty(c.Obs)) { c.Obs = "Plantão S.A."; } Switch oleo = FindViewById <Switch>(Resource.Id.Oleo); Switch checkCombustivel = FindViewById <Switch>(Resource.Id.Combustivel); Switch checkP90 = FindViewById <Switch>(Resource.Id.Oleo); Switch checkRetrovisores = FindViewById <Switch>(Resource.Id.Retrovisores); Switch checkFarois = FindViewById <Switch>(Resource.Id.Oleo); Switch checkFerramentas = FindViewById <Switch>(Resource.Id.Ferramentas); Switch checkPneu = FindViewById <Switch>(Resource.Id.Pneu); Switch checkLanternas = FindViewById <Switch>(Resource.Id.Lanternas); Switch checkPintura = FindViewById <Switch>(Resource.Id.Pintura); Switch checkDocumento = FindViewById <Switch>(Resource.Id.Documento); Switch checkChave = FindViewById <Switch>(Resource.Id.Chave); if (oleo.Checked) { c.Oleo = 1; } else { c.Oleo = 0; } if (checkCombustivel.Checked) { c.Combustivel = 1; } else { c.Combustivel = 0; } if (checkP90.Checked) { c.P90 = 1; } else { c.P90 = 0; } if (checkRetrovisores.Checked) { c.Retrovisores = 1; } else { c.Retrovisores = 0; } if (checkFarois.Checked) { c.Farois = 1; } else { c.Farois = 0; } if (checkFerramentas.Checked) { c.Ferramentas = 1; } else { c.Ferramentas = 0; } if (checkPneu.Checked) { c.Pneu = 1; } else { c.Pneu = 0; } if (checkLanternas.Checked) { c.Lanternas = 1; } else { c.Lanternas = 0; } if (checkDocumento.Checked) { c.Documento = 1; } else { c.Documento = 0; } if (checkChave.Checked) { c.Chave = 1; } else { c.Chave = 0; } if (checkPintura.Checked) { c.Pintura = 1; } else { c.Pintura = 0; } c.suporte = 0; c.carregador = 0; return(c); }
public bool ContactDelete(string email, Autenticacao value) { var _value = Mapper.Map <Authentication>(value); return(ExecuteById(email, _value, (c, i, v) => c.ContactDelete(email, _value))); }
public IActionResult Delete(string email, [FromBody] Autenticacao value) { _logger.LogDebug("Contact Delete Call"); return(Execute("ContatoExact", email, Method.Delete, value, (s, v, a) => s.Delete(v, a))); }
public void CriarUmBlogueiroValidoTeste() { var autenticacao = new Autenticacao("*****@*****.**", "123"); var blogueiro = new Blogueiro("Blogueiro 1", autenticacao); }
public bool Delete(string email, Autenticacao value) { return(_service.ContactDelete(email, value)); }
public bool Fields(Autenticacao value) { return(_service.ContactGetFields(value)); }
protected IActionResult Execute(string entityName, string parameter, Method method, Autenticacao autenticacao, Func <T, string, Autenticacao, bool> function, bool addLog = true) { try { if (ModelState.IsValid) { var log = AddLoggerApi(parameter, method, autenticacao, parameter, addLog, entityName); bool success = function(_service, parameter, autenticacao); UpdateLoggerApi(log, addLog, success); return(success ? Ok(_service.MessageController().GetAllMessage()) : StatusCode(400, _service.MessageController().GetAllMessage())); } return(ErrorValidation()); } catch (Exception ex) { return(StatusCode(400, new { type = "ERROR", message = ex.Message })); } }
public VeiculoController(Microsoft.AspNetCore.Http.IHttpContextAccessor contexto) { AutenticacaoAPI = new Autenticacao(contexto); }
public ClientesController(IHttpContextAccessor context) { repository = new UsuarioRepository(); autenticacao = new Autenticacao(context); }
public bool Fields(Autenticacao value) { return(_service.AccountGetFields(value)); }
public IActionResult Delete(string id, [FromBody] Autenticacao value) { _logger.LogDebug("Schedule Delete Call"); return(Execute("Schedule", id, Method.Delete, value, (s, v, a) => s.Delete(v, a))); }
public void CriarUmBlogueiroComEmailInvalido() { var autenticacao = new Autenticacao("blog@blog.", "123"); var blogueiro = new Blogueiro("Blogueiro 1", autenticacao); }
public IActionResult MensagemEnviada([FromBody] EventHook eventHook) { var jsonEventHook = JsonConvert.SerializeObject(eventHook); _logger.LogInformation($"Acessando POST mensagem-enviada {nameof(ClienteController)} {nameof(eventHook)}: {jsonEventHook}"); foreach (var conteudo in eventHook.Message.Contents.Where(x => x.Type == "text")) { var mensagem = new MensagemZAP { From = eventHook.Message.From, Channel = eventHook.Message.Channel, Direction = eventHook.Message.Direction, To = eventHook.Message.To, Conteudo = conteudo.Text, VisitorFullName = eventHook.Message.Visitor.Name, Data = DateTime.Now, }; _context.MensagemZAP.Add(mensagem); var cliente = _context.Cliente.Where(x => x.Celular == mensagem.From).FirstOrDefault(); if (cliente == null) { cliente = new Cliente(); cliente.Celular = mensagem.From; cliente.Nome = mensagem.VisitorFullName; _context.Cliente.Add(cliente); } _context.SaveChanges(); if (mensagem.Conteudo.ToLower().Contains("oi") && mensagem.Direction == "IN") { Autenticacao autenticacao = new Autenticacao(); autenticacao.ClienteId = cliente.ClienteId; autenticacao.Data = DateTime.Now; autenticacao.GerarCodigo(); _context.Autenticacao.Add(autenticacao); _context.SaveChanges(); var mensagemAutenticacao = $"Digite:{autenticacao.Codigo} para completar a autenticação:"; var sender = new SenderMessageRequest(); sender.From = "furry-time"; sender.To = cliente.Celular; sender.Contents = new List <Models.SendMessageZenvia.Content>(); sender.Contents.Add(new Models.SendMessageZenvia.Content { Type = "text", Text = mensagemAutenticacao, Payload = string.Empty }); var json = JsonConvert.SerializeObject(sender); var httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, $"https://api.zenvia.com/v1/channels/whatsapp/messages"); httpRequestMessage.Headers.Add("X-API-TOKEN", "sxyGdagDRB3AFLl51p_y5gGzXnIyx2w4qmzR"); httpRequestMessage.Content = new StringContent(json, Encoding.UTF8, "application/json"); var httpClient = new HttpClient(); var response = httpClient.SendAsync(httpRequestMessage).Result; } } return(Ok()); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); //PARAMETROS PARA OS INTENS LayoutParams lp = new LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); LayoutParams lpL = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); LayoutParams person = new LayoutParams(LayoutParams.MatchParent, 240); lp.Height = 200; //LAYOUT PRINCIPAL QUE IRÀ DENTRO DO SCROLL LinearLayout layout = new LinearLayout(this); layout.Orientation = Orientation.Vertical; layout.LayoutParameters = lpL; //SCROLL DE ROLAGEM ScrollView scroll = new ScrollView(this); scroll.LayoutParameters = lpL; this.SetContentView(scroll); scroll.AddView(layout); TextView lblChaves = new TextView(this); lblChaves.Text = "Encerre seu CHECKLIST Sr. " + Autenticacao.GetApelido() + "\n Digite o KM Final"; lblChaves.SetTextSize(Android.Util.ComplexUnitType.Sp, 30); Button botao = new Button(this); botao.Text = "CONCLUIR"; EditText km = new EditText(this); km.SetMaxLines(1); km.InputType = Android.Text.InputTypes.ClassNumber; km.SetTextSize(Android.Util.ComplexUnitType.Sp, 60); //MAX LENGHT km.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(5) }); TextView lblObs = new TextView(this); lblObs.Text = "Observações Finais"; lblObs.SetTextSize(Android.Util.ComplexUnitType.Sp, 30); EditText obs2 = new EditText(this); obs2.SetMaxLines(4); obs2.SetTextSize(Android.Util.ComplexUnitType.Sp, 40); obs2.Text = "Plantão S.A."; obs2.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(999) }); Switch problema = new Switch(this); problema.Text = "Transformar em Problema"; problema.SetTextColor(Android.Graphics.Color.Red); problema.SetTextSize(Android.Util.ComplexUnitType.Sp, 24); layout.AddView(lblChaves, lp); layout.AddView(km, lp); layout.AddView(lblObs, lp); layout.AddView(obs2, lp); layout.AddView(problema, lp); layout.AddView(botao, person); botao.Click += delegate { // Aguarde.MostraAguarde(true, this); var task = Task.Factory.StartNew(() => { certo = BLL.Cadastra_Finaliza(km.Text, obs2.Text, problema.Checked); }); task.ContinueWith( t => { if (certo) { Toast.MakeText(this, "CHECKLIST FINALIZADO", ToastLength.Long).Show(); this.FinishAffinity(); } else { Toast.MakeText(this, "VERIFIQUE OS CAMPOS OBRIGATÓRIOS", ToastLength.Long).Show(); } Aguarde.MostraAguarde(false, this); }, TaskScheduler.FromCurrentSynchronizationContext()); // }; }
public IActionResult Delete(string id, [FromBody] Autenticacao value) { _logger.LogDebug("Company Delete Call"); return(Execute("EmpresaExact", id, Method.Delete, value, (s, v, a) => s.Delete(v, a))); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); Button button = new Button(this); SetContentView(Resource.Layout.CheckList); RadioButton Vtr1 = FindViewById <RadioButton>(Resource.Id.VTR1); RadioButton Vtr2 = FindViewById <RadioButton>(Resource.Id.VTR2); RadioButton Vtr3 = FindViewById <RadioButton>(Resource.Id.VTR3); RadioButton Area1 = FindViewById <RadioButton>(Resource.Id.Area1); RadioButton Area2 = FindViewById <RadioButton>(Resource.Id.Area2); //AO CLICAR NOS SELETORES ELE ABAIXA O TECLADO Area1.Click += delegate { HideKeybord(); }; Area2.Click += delegate { HideKeybord(); }; Vtr1.Click += delegate { HideKeybord(); }; Vtr2.Click += delegate { HideKeybord(); }; Vtr3.Click += delegate { HideKeybord(); }; OleoBLL BLL = new OleoBLL(); veiculos = BLL.ListaVeiculos(); if (veiculos != null) { foreach (Veiculo p in veiculos) { if (p.Situacao == 0) { //comboPlaca.Items.Add(p.Placa); veiculosB.Add(p); if (p.Id.Equals("1")) { Vtr1.Visibility = ViewStates.Visible; } else if (p.Id.Equals("2")) { Vtr2.Visibility = ViewStates.Visible; } else if (p.Id.Equals("3")) { Vtr3.Visibility = ViewStates.Visible; } } } } TextView tatico = FindViewById <TextView>(Resource.Id.Tatico); tatico.Text = "TÁTICO " + Autenticacao.GetApelido(); //TELA TO ENTITY Button btnProximo = FindViewById <Button>(Resource.Id.btnPro); btnProximo.Click += delegate { Aguarde.MostraAguarde(true, this); var task = Task.Factory.StartNew(() => { result = CheckChaves(); }); task.ContinueWith( t => { Aguarde.MostraAguarde(false, this); if (result) { var activity = new Intent(this, typeof(CheckChavesActivity)); StartActivity(activity); } else { Toast.MakeText(this, "VERIFIQUE OS CAMPOS OBRIGATÓRIOS", ToastLength.Long).Show(); } }, TaskScheduler.FromCurrentSynchronizationContext()); //Toast.MakeText(this, "IR PARA TELA DE CHECKCHAVES", ToastLength.Long).Show(); }; }
public IActionResult Fields([FromBody] Autenticacao value) { _logger.LogDebug("Company Fields Call"); return(Execute("EmpresaExact", string.Empty, Method.Fields, value, (s, v, a) => s.Fields(a))); }
public bool LeadDelete(string id, Autenticacao value) { var _value = Mapper.Map <Authentication>(value); return(ExecuteById(id, _value, (c, i, v) => c.LeadDelete(id, _value))); }
public login LoginMatricula(string Origem, int Matricula, string Senha) { return(Autenticacao.Logar("", Matricula, 0, Senha, Origem, "")); }
public Login() : base(new FormLogin()) { autenticacao = Autenticacao.ObterInstancia(); Vista.Notificavel = this; Vista.ShowDialog(); }
public login LoginBiometria(string Origem, string ApiKey, int IndiceBiometria) { return(Autenticacao.Logar("", 0, IndiceBiometria, "", Origem, ApiKey)); }
public bool Fields(Autenticacao value) { return(_service.ScheduleGetFields(value)); }
public login LoginUsuario(string Origem, string Usuario, string Senha) { return(Autenticacao.Logar(Usuario, 0, 0, Senha, Origem, "")); }
public MovimentacaoController(IHttpContextAccessor context) { AutenticacaoServico = new Autenticacao(context); }
public string Logout(string Origem, string ApiKey, string Usuario, int IndiceBiometria, int Matricula) { return(Autenticacao.logout(Origem, ApiKey, Usuario, IndiceBiometria, Matricula)); }
public bool Cadastra(Caixa_Movimento c) { if (string.IsNullOrEmpty(c.Descricao)) { c.Descricao = "S.A."; } if (string.IsNullOrEmpty(c.Autorizado)) { c.Autorizado = Autenticacao.GetApelido(); } if (c.SaidaEntrada == 1) { if (string.IsNullOrEmpty(c.Numcupom)) { return(false); } } if (c.Abastecimento == 1) { if (string.IsNullOrEmpty(c.KM)) { return(false); } if (string.IsNullOrEmpty(c.Placa)) { return(false); } if (string.IsNullOrEmpty(c.Tatico)) { return(false); } } else { c.Tatico = "Operador"; } if (c.Valor > 0) { MovimentoDAO DAO = new MovimentoDAO(); DataTable Result = new DataTable(); c.Caixa_Situacao_Id = Autenticacao.GetCaixa_Situacao().Id; Result = DAO.Cadastra(c, Autenticacao.GetCodUsuario()); if (Result != null) { if (Result.Rows.Count > 0) { if (Result.Rows[0].ItemArray[0].ToString().Equals("1")) { return(true); } else { return(false); } } } } return(false); }
public bool Delete(string id, Autenticacao value) { return(_service.AccountDelete(id, value)); }