Esempio n. 1
0
 public OrdemServicoPageViewModel(INavigationService navigationService, IPageDialogService dialogService)
     : base(navigationService)
 {
     _navigationService  = navigationService; //Navegação
     _dialogService      = dialogService;     //DisplayAlert
     _kontactoAPIService = new KontactoAPIService();
 }
Esempio n. 2
0
 public PedidoVendaPageViewModel(INavigationService navigationService, IPageDialogService dialogService)
     : base(navigationService)
 {
     _navigationService  = navigationService; //Navegação
     _dialogService      = dialogService;     //DisplayAlert
     _kontactoAPIService = new KontactoAPIService();
     RetListUsuarios();
     UsusarioSelCommand = new DelegateCommand(UsuarioSelect);
     ItemTappedCommand  = new DelegateCommand <Pedido_Venda>(PedidoSelect);
     DateSelCommand     = new DelegateCommand(DateSel);
     RetListPedidos();
     DataSel = DateTime.Now.Date;
 }
Esempio n. 3
0
 public MainPageViewModel(INavigationService navigationService, IPageDialogService dialogService)
     : base(navigationService)
 {
     Title = "Painel";
     _navigationService  = navigationService; //Navegação
     _dialogService      = dialogService;     //DisplayAlert
     _kontactoAPIService = new KontactoAPIService();
     _nomeusu            = "";
     RetListUsuarios();
     //ListUsuarios = new ObservableCollection<Usuarios>();
     UsusarioSelCommand = new DelegateCommand <Usuarios>(UsuarioSelect);
     ItemTappedCommand  = new DelegateCommand <Pedido_Venda>(PedidoSelect);
     RetListPedidos();
 }
Esempio n. 4
0
        //CONTRUTOR
        public LoginViewModel(INavigationService navigationService, IPageDialogService dialogService) //injetando o INavigationService e o serviço DisplayAlert do IPageDialogService
            : base(navigationService)
        {
            _navigationService  = navigationService; //Navegação
            _dialogService      = dialogService;     //DisplayAlert
            _kontactoAPIService = new KontactoAPIService();

            //    ObjDao = new Usuarios_Dao();
            usuarioAsync      = new Usuarios();
            LoginCommand      = new DelegateCommand(ExecVerif_Login, AutorizaLogin);
            EmpresaCommand    = new DelegateCommand(ExecEmpresa);
            EmpresaSelCommand = new Command(ExecEmpresaSelItem);

            //Verifica se o usuário já se logou alguma vez
            LocalFile    = Xamarin.Forms.DependencyService.Get <ISaveAndLoad>().LoadText("usuario.json");
            usuarioAsync = JsonConvert.DeserializeObject <Usuarios>(LocalFile);
            if (usuarioAsync != null)
            {
                this._usuario = usuarioAsync.Usuario;
                this._senha   = usuarioAsync.Senha;
                //   if(Mn!="Sair")
                //       ExecVerif_Login();
            }



            //Verifica se já tem usuário no SQLite
            // ObjDao.DeletaUsuario();
            // usuSqlite = new Usuarios();
            // usuSqlite = ObjDao.GetUsuario("");
            //
            // if (usuSqlite != null)
            // {
            //     this._usuario = usuSqlite.Usuario;
            //     this._senha = usuSqlite.Senha;
            //     ExecVerif_Login();
            // }
        }