public ActionResult Edit(string id) { UsuarioCliente usuarioCliente = null; if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } else { usuarioCliente = Gerenciador.FindById(id); if (usuarioCliente.Email != HttpContext.User.Identity.Name) { return(new HttpStatusCodeResult(HttpStatusCode.Unauthorized)); } } if (usuarioCliente == null) { return(new HttpNotFoundResult()); } UsuarioEditViewModel usuarioClienteView = new UsuarioEditViewModel(); usuarioClienteView.UsuarioId = usuarioCliente.Id; usuarioClienteView.EmailAntigo = usuarioCliente.Email; return(View(usuarioClienteView)); }
public frmLogin() { InitializeComponent(); gerenciador = new Gerenciador(); gerenciador.Carregar(); }
// Start is called before the first frame update void Start() { _estado = 0; _Costas = GetComponent <SpriteRenderer>(); _Frente = GetComponentInChildren <SpriteRenderer>(); _Gerencia = GameObject.Find("Gerenciador").GetComponent <Gerenciador>(); }
// Use this for initialization void Start() { // Instancia da main main = GameObject.FindGameObjectWithTag("Gerenciador").GetComponent <Gerenciador>() as Gerenciador; //Instancia da animato pegando do GO que possui o animetor animator = player.GetComponent <Animator> (); }
public void SalvarAction(object sender, EventArgs args) { bool erro = false; if (!(Nome.Text.Trim().Length > 0)) { erro = true; } if (!(this.prior > 0)) { erro = true; } if (erro == false) { //Salvar dados Tarefa tarefa = new Tarefa() { Nome = Nome.Text.Trim(), Status = this.prior }; Gerenciador.Salvar(tarefa); App.Current.MainPage = new NavigationPage(new Inicio()); } else { DisplayAlert("Erro", "Verifique se todos os dados foram preenchidos!", "Ok"); } }
public static Gerenciador getInstance() { if (uniqueGerenciador == null) { uniqueGerenciador = new Gerenciador(); } return(uniqueGerenciador); }
public virtual IHttpActionResult Inserir(TDominio entidade) { if (!ModelState.IsValid && Gerenciador.Inserir(entidade)) { // TODO: Verificar forma de não deixar rota chapada: return(CreatedAtRoute("DefaultApi", new { id = entidade.Id }, entidade)); } return(BadRequest(ModelState)); }
// Use this for initialization void Start() { count = PlayerPrefs.GetInt("Historia"); print("Count " + count); main = GameObject.FindGameObjectWithTag("Gerenciador").GetComponent <Gerenciador>() as Gerenciador; guiTexture.texture = imagemExibida [count]; narracoes[count].transform.position = this.transform.position; narracoes [count].Play(); }
// Use this for initialization void Start() { main = GameObject.FindGameObjectWithTag("Gerenciador").GetComponent <Gerenciador>() as Gerenciador; arrows = GameObject.Find("Arrows"); actualLevel = 1; winsStreak = 0; PlaceAtRandomPosition(); InvokeRepeating("decreaseTimeRemaining", 1.0f, 1.0f); }
public override IHttpActionResult Buscar(int id) { var entidade = Gerenciador.Buscar(id); if (entidade == null) { return(NotFound()); } return(Ok(CriarDto(entidade))); }
public frmControle(Usuario admin) { InitializeComponent(); this.admin = admin; gerenciador = new Gerenciador(); gerenciador.Carregar(); usuarios = gerenciador.ObterUsuarios(); }
void Awake() { if (inst == null) { inst = this; } else if (inst != null) { Destroy(gameObject); } }
private void OnTriggerEnter(Collider other) { if (other.CompareTag("Projetil")) { text.text = "Você perdeu!"; speed = 0; //StartCoroutine(Whatever()); SceneManager.LoadScene(5); } if (other.CompareTag("WinTrigger")) { speed = 0; if (gerenciador.isZerou()) { SceneManager.LoadScene(4); } else { SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); } } if (other.CompareTag("Botao")) { if (Gerenciador.getInstance().isLiberadoBotao1()) { if (!gerenciador.isCarregado()) { GetComponent <AudioSource> ().clip = sem_municao; GetComponent <AudioSource> ().Play(); } gerenciador.setCarregado(true); Gerenciador.getInstance().setLiberadoBotao2(false); } } if (other.CompareTag("Botao2")) { if (Gerenciador.getInstance().isLiberadoBotao2()) { if (!gerenciador.isCarregado()) { GetComponent <AudioSource> ().clip = sem_municao; GetComponent <AudioSource> ().Play(); } gerenciador.setCarregado(true); Gerenciador.getInstance().setLiberadoBotao1(false); } } }
public virtual IHttpActionResult Inserir(TDto entidade) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var dominio = entidade.ConstruirDominio(); if (Gerenciador.Inserir(dominio)) { // TODO: Verificar forma de não deixar rota chapada: return(CreatedAtRoute("DefaultApi", new { id = entidade.Id }, CriarDto(Gerenciador.Buscar(dominio.Id)))); } return(BadRequest(ModelState)); }
public ActionResult Edit(UsuarioEditViewModel usuarioEditView) { if (ModelState.IsValid) { bool alterado = false; var user = Gerenciador.Find(usuarioEditView.EmailAntigo, usuarioEditView.SenhaAtual); if (user == null) { TempData["UserChangeError"] = "Senha atual inválida!"; return(View(usuarioEditView)); } Cliente cliente = ClienteService.ObterClientePFPorId(long.Parse(usuarioEditView.UsuarioId)); if (cliente == null) { cliente = ClienteService.ObterClientePJPorId(long.Parse(usuarioEditView.UsuarioId)); } if (!string.IsNullOrEmpty(usuarioEditView.NovoEmail) || !string.IsNullOrWhiteSpace(usuarioEditView.NovoEmail)) { cliente.Email = usuarioEditView.NovoEmail; ClienteService.GravarCliente(cliente); UsuarioClienteDAL.AlterarUsuarioCliente(usuarioEditView.UsuarioId, novoEmail: usuarioEditView.NovoEmail); alterado = true; } if (!string.IsNullOrEmpty(usuarioEditView.NovaSenha) || !string.IsNullOrWhiteSpace(usuarioEditView.NovaSenha)) { UsuarioClienteDAL.AlterarUsuarioCliente(usuarioEditView.UsuarioId, novaSenha: usuarioEditView.NovaSenha); alterado = true; } if (alterado) { TempData["Message"] = "Usuário alterado com sucesso! Por favor realize login novamente."; return(Logout()); } else { TempData["UserChangeError"] = "Nenhuma informação para ser alterada"; } } return(View(usuarioEditView)); }
// PUT: api/Entidade/5 //[HttpPut] public virtual IHttpActionResult Editar(int id, TDominio entidade) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != entidade.Id) { return(BadRequest()); } if (Gerenciador.Editar(entidade)) { return(StatusCode(HttpStatusCode.NoContent)); } return(BadRequest(ModelState)); }
// Use this for initialization void Start() { panel.gameObject.SetActive(false); Debug.Log(PlayerPrefs.GetString("emailPF")); Debug.Log(PlayerPrefs.GetString("senhaPF")); if (PlayerPrefs.GetString("emailPF") == null && PlayerPrefs.GetString("senhaPF") == null) { Debug.Log("Acontece nada"); } else { inputEmail.text = PlayerPrefs.GetString("emailPF"); inputPassword.text = PlayerPrefs.GetString("senhaPF"); } manager = this.gameObject.GetComponent <Gerenciador> (); }
private void Carregar() { List <Tarefa> tarefas = Gerenciador.Listar(); int i = 0; if (tarefas.Count > 0) { foreach (Tarefa tar in tarefas) { LinhaTarefa(tar, i); i++; } } else { ListaVazia(); } }
public ActionResult Login(LoginViewModel model, string returnUrl) { if (ModelState.IsValid) { UsuarioCliente usuario = Gerenciador.Find(model.Email, model.Senha); if (usuario == null) { @ViewBag.Error = "Usuário não encontrado ou senha inválida!"; } else { Cliente cliente = ClienteService.ObterClientePFPorId(long.Parse(usuario.Id)); if (cliente == null) { ClienteService.ObterClientePFPorId(long.Parse(usuario.Id)); } if (cliente == null) { @ViewBag.Error = "Usuário não encontrado ou senha inválida!"; } else { if (cliente.Ativo == false) { TempData["Error"] = "Cadastro desativado!" + Environment.NewLine + "Entre em contato com a empresa para mais detalhes."; return(View(model)); } ClaimsIdentity identity = Gerenciador.CreateIdentity(usuario, DefaultAuthenticationTypes.ApplicationCookie); AuthManager.SignOut(); AuthManager.SignIn(new AuthenticationProperties { IsPersistent = false }, identity); if (returnUrl == null) { returnUrl = "/Home"; } return(Redirect(returnUrl)); } } } return(View(model)); }
public virtual IHttpActionResult Editar(int id, TDto entidade) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var dominio = entidade.ConstruirDominio(); if (id != dominio.Id) { return(BadRequest()); } if (Gerenciador.Editar(dominio)) { return(StatusCode(HttpStatusCode.NoContent)); } return(BadRequest(ModelState)); }
public override IHttpActionResult Buscar() { return(Ok(Gerenciador.Buscar().Select(rf => CriarDto(rf)).ToList())); }
// Use this for initialization void Start() { main = GameObject.FindGameObjectWithTag("Gerenciador").GetComponent <Gerenciador>() as Gerenciador; }
// Use this for initialization void Start() { manager = this.gameObject.GetComponent <Gerenciador> (); StartCoroutine(EnviarDados()); cronometer.time = 0; }
private Gerenciador main; // variavel que recebera uma instancia da main // Use this for initialization void Start() { //criaçao de uma instancia da classe principal main = GameObject.FindGameObjectWithTag("Gerenciador").GetComponent <Gerenciador>() as Gerenciador; }
// Use this for initialization void Start() { mostraVidas.text = "" + Gerenciador.getInstance().getVidas(); InvokeRepeating("atualizar", 0.0f, 1.0f); this.velocidade = 3; }
public frmAlterarPerfil(Usuario u, Gerenciador g) { InitializeComponent(); usuario = u; gerenciador = g; }
// Use this for initialization void Start() { typeAccount = "conventional"; manager = this.gameObject.GetComponent <Gerenciador> (); }
public frmAlterarSenha(Projeto_F2.Modulos.Usuarios.Usuario usuario, Gerenciador gerenciador) { InitializeComponent(); this.usuario = usuario; this.gerenciador = gerenciador; }
public void LinhaTarefa(Tarefa tarefa, int i) { string imgCheck; DateTime vazio = new DateTime(0001, 01, 01); StackLayout StackCentral = null; Label lbl = null; if (tarefa.DataFinalizacao != vazio) { StackCentral = new StackLayout() { Spacing = 0, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.Center }; lbl = new Label() { Text = tarefa.Nome, TextColor = Color.Gray }; Label dtFinal = new Label() { TextColor = Color.Gray, FontSize = 10, Text = "Finalizado em " + tarefa.DataFinalizacao.Date.ToString("dd/MM/yyyy - hh:mm") + "h" }; StackCentral.Children.Add(lbl); StackCentral.Children.Add(dtFinal); imgCheck = "CheckOn.png"; } else { lbl = new Label() { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.Center, Text = tarefa.Nome }; imgCheck = "CheckOff.png"; } StackLayout linha = new StackLayout() { Spacing = 15, Orientation = StackOrientation.Horizontal }; TapGestureRecognizer encerrarTarefa = new TapGestureRecognizer(); encerrarTarefa.Tapped += (sender, e) => { Image image = (Image)sender; Gerenciador.Finalizar(i, tarefa); App.Current.MainPage = new NavigationPage(new Inicio()); }; Image check = new Image() { VerticalOptions = LayoutOptions.Center, Source = ImageSource.FromFile(imgCheck) }; if (Device.RuntimePlatform == Device.UWP) { check.Source = ImageSource.FromFile("Resources/" + imgCheck); } check.GestureRecognizers.Add(encerrarTarefa); Image prior = new Image() { VerticalOptions = LayoutOptions.Center, Source = ImageSource.FromFile("p" + tarefa.Status + ".png") }; if (Device.RuntimePlatform == Device.UWP) { prior.Source = ImageSource.FromFile("Resources/p" + tarefa.Status + ".png"); } TapGestureRecognizer deletar = new TapGestureRecognizer(); deletar.Tapped += (sender, e) => { Image image = (Image)sender; Gerenciador.Remover(i, tarefa); App.Current.MainPage = new NavigationPage(new Inicio()); }; Image del = new Image() { VerticalOptions = LayoutOptions.Center, Source = ImageSource.FromFile("Delete.png") }; if (Device.RuntimePlatform == Device.UWP) { del.Source = ImageSource.FromFile("Resources/Delete.png"); } del.GestureRecognizers.Add(deletar); linha.Children.Add(check); if (StackCentral == null) { linha.Children.Add(lbl); } else { linha.Children.Add(StackCentral); } linha.Children.Add(prior); linha.Children.Add(del); slTarefas.Children.Add(linha); }
public override IHttpActionResult Buscar() { return(Ok(Gerenciador.Buscar().GroupBy(gd => gd.Grade).Select(gd => gd.Key).ToList())); }