Beispiel #1
0
        private void BTN_ACEITE_Click(object sender, RoutedEventArgs e)
        {
            Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Wait, 10);

            using (RP_Database d = new classes.RP_Database())
            {
                PV1.SelectedIndex = 0;
            }

            Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Arrow, 10);
        }
Beispiel #2
0
        public MainPage()
        {
            this.InitializeComponent();

            this.WV_POLITICA.Text = new RPass_Politica().termo();

            if (IsolatedStorageFile.GetUserStoreForApplication().FileExists(arquivoDatabase))
            {
                using (RP_Database d = new classes.RP_Database())
                {
                    TXT_EMAIL.Text = d.buscaLogin();
                    TXT_EMAIL.Focus(FocusState.Pointer);
                }
            }
            else
            {
                PV1.SelectedIndex = 3;
            }
        }
Beispiel #3
0
        private void carregaTipos()
        {
            try
            {
                Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Wait, 10);

                using (RP_Database d = new classes.RP_Database())
                {
                    LBX_TIPO.ItemsSource = d.listaTipos();
                }
            }
            catch (Exception ex)
            {
                MainPage.ShowMessage(MainPage.titulo, ex.Message);
            }
            finally
            {
                Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Arrow, 10);
            }
        }
Beispiel #4
0
        private async void deletaSenha(int ID_SENHA)
        {
            MessageDialog message1 = MainPage.ConfirmMessage("Você confirma deletar esta senha?");

            var result = await message1.ShowAsync();

            if (result.Id.Equals(0)) // Sim
            {
                try
                {
                    Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Wait, 10);

                    LISTA_DE_SENHAS item = ((List <LISTA_DE_SENHAS>)LBX_senhas.ItemsSource).Where(_ => _.ID_SENHA == ID_SENHA).First();

                    using (RP_Database d = new classes.RP_Database())
                    {
                        d.deletaSenha(new TB_SENHA()
                        {
                            DESCRICAO_SENHA = item.DESCRICAO_SENHA,
                            ID_SENHA        = ID_SENHA,
                            SENHA           = d.Encrypt(item.SENHA),
                            ID_USUARIO      = this.ID_USUARIO,
                            TIPO_SENHA      = item.TIPO
                        });
                    }

                    listaSenhas();

                    PV1.SelectedIndex = 0;
                }
                catch (Exception ex)
                {
                    MainPage.ShowMessage(MainPage.titulo, ex.Message);
                }
                finally
                {
                    Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Arrow, 10);
                }
            }
        }
Beispiel #5
0
        private void listaSenhas()
        {
            try
            {
                Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Wait, 10);

                using (RP_Database d = new classes.RP_Database())
                {
                    this.LBX_senhas.ItemsSource = d.listaSenhas(this.TGL_SENHAS.IsOn, TXT_FILTRO.Text);
                }

                LBL_TOTAL_SENHAS.Text = ((List <LISTA_DE_SENHAS>)LBX_senhas.ItemsSource).Count.ToString();
            }
            catch (Exception ex)
            {
                MainPage.ShowMessage(MainPage.titulo, ex.Message);
            }
            finally
            {
                Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Arrow, 10);
            }
        }
Beispiel #6
0
        private async void deletaAnexo(int ID_ANEXO)
        {
            MessageDialog message1 = MainPage.ConfirmMessage("Você confirma deletar este anexo?");

            var result = await message1.ShowAsync();

            if (result.Id.Equals(0)) // Sim
            {
                try
                {
                    Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Wait, 10);

                    ANEXO_SENHA item = ((List <ANEXO_SENHA>)LBX_ANEXO.ItemsSource).Where(_ => _.ID_ANEXO == ID_ANEXO).First();

                    using (RP_Database d = new classes.RP_Database())
                    {
                        d.deletaAnexo(new TB_ANEXO_SENHA()
                        {
                            ID_ANEXO = item.ID_ANEXO,
                            ID_SENHA = item.ID_SENHA,
                            CONTEUDO = item.CONTEUDO,
                            ANEXO    = item.ANEXO
                        });
                    }

                    carregaAnexos();
                    listaSenhas();
                }
                catch (Exception ex)
                {
                    MainPage.ShowMessage(MainPage.titulo, ex.Message);
                }
                finally
                {
                    Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Arrow, 10);
                }
            }
        }
Beispiel #7
0
        private void validaLogin()
        {
            try
            {
                if (this.TXT_EMAIL.Text.Trim().Equals("") ||
                    this.TXT_SENHA.Password.Trim().Equals(""))
                {
                    throw new Exception("Preencha os campos");
                }

                Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Wait, 10);

                using (RP_Database d = new classes.RP_Database())
                {
                    int ID_USUARIO = d.validaLogin(TXT_EMAIL.Text, TXT_SENHA.Password);

                    d.gravaEmailLogin(new EMAIL_LOGIN()
                    {
                        EMAIL = TXT_EMAIL.Text.Trim().ToLower()
                    });

                    Navigator nav = new Navigator();
                    nav.navigatorName  = "ID_USUARIO";
                    nav.navigatorValue = ID_USUARIO.ToString();

                    this.Frame.Navigate(typeof(Gerenciador), nav);
                }
            }
            catch (Exception ex)
            {
                ShowMessage(titulo, ex.Message);
            }
            finally
            {
                Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Arrow, 10);
            }
        }