Beispiel #1
0
        public FormaPagamentoService ObterService()
        {
            Mocker = new AutoMocker();
            FormaPagamentoService = Mocker.CreateInstance <FormaPagamentoService>();

            return(FormaPagamentoService);
        }
Beispiel #2
0
        protected async void CarregaPagamento()
        {
            try
            {
                if (!CrossConnectivity.Current.IsConnected)
                {
                    await DisplayAlert("Alerta!", "Sem conexão com à Internet.", "OK");

                    return;
                }
                List <FormaPagamentoModel> pag        = new List <FormaPagamentoModel>();
                FormaPagamentoService      pagService = new FormaPagamentoService();
                if (GlobalVariables.GlobalPedido.IdPedido > 0 && GlobalVariables.GlobalPedido.IdPagamento > 0)
                {
                    pag = await pagService.RetornaFormaPagamentoPorIdPedido(GlobalVariables.GlobalPedido.IdPedido);
                }
                else
                {
                    pag = await pagService.RetornaFormaPagamento();
                }
                pckPagamento.ItemsSource = null;
                if (pag[0].IdFormaPagamento > 0 && pag.Count > 0)
                {
                    pckPagamento.ItemsSource = pag;
                }
                if (GlobalVariables.formaPagamento == 145)
                {
                    pckPagamento.ItemsSource     = pag;
                    pckPagamento.SelectedIndex   = 36;
                    pckPagamento.IsEnabled       = false;
                    ECpercDesc.IsEnabled         = false;
                    GlobalVariables.percDesconto = Convert.ToDouble(ECpercDesc.Text);
                }
                else
                {
                    pckPagamento.ItemsSource     = pag;
                    pckPagamento.SelectedIndex   = 0;
                    pckPagamento.SelectedItem    = GlobalVariables.formaPagamento;
                    pckPagamento.IsEnabled       = true;
                    ECpercDesc.IsEnabled         = true;
                    GlobalVariables.percDesconto = Convert.ToDouble(ECpercDesc.Text);
                }
            }
            catch (Exception)
            {
            }
        }
 public FormaPagamentoServiceTests(FormaPagamentoTestsAutoMockerFixture formaPagamentoTestsFixture)
 {
     _formaPagamentoTestsAutoMockerFixture = formaPagamentoTestsFixture;
     _formaPagamentoService = _formaPagamentoTestsAutoMockerFixture.ObterService();
 }