예제 #1
0
        public IActionResult Index()
        {
            PagamentoModel objPagamento = new PagamentoModel();

            ViewBag.ListaPagamento = objPagamento.ListaPagamento();
            return(View());
        }
예제 #2
0
        public IActionResult ExcluirConta(int id)
        {
            PagamentoModel objPagamento = new PagamentoModel();

            //objPagamento.Excluir(id);
            return(RedirectToAction("Index"));
        }
예제 #3
0
        public ActionResult Pagamento(PagamentoModel model)
        {
            var origem = (EntregaModel)TempData["origemSolicitacao"];

            this.TempData["origemSolicitacao"] = origem;

            return(View(new PagamentoModel()));
        }
        public void Pagar(PagamentoModel pagamento_)
        {
            if (pagamento_.Senha == String.Empty)
            {
                throw new ApplicationException("Senha em Branco");
            }

            // Implementar acesso ao banco para Salvar os dados do pagamento
        }
예제 #5
0
        public void Pagar(PagamentoModel pagamento_)
        {
            if (pagamento_.Valor <= 10M)
            {
                throw new ApplicationException("Pelo menos R$10,00");
            }

            // Lógica
        }
예제 #6
0
        public IActionResult CriarPagamento(PagamentoModel formulario)
        {
            if (ModelState.IsValid)
            {
                formulario.Insert();
                return(RedirectToAction("Index"));
            }

            return(View());
        }
        public CadPagamentoWin(PagamentoModel pagamento, int idConsulta)
        {
            InitializeComponent();
            Iniciar();
            this.pagamento  = pagamento;
            this.idConsulta = idConsulta;

            Title = "EDITAR PAGAMENTO";
            CarregarDados();
        }
예제 #8
0
        public ServiceResult <string> PedirPagamento(PagamentoModel model)
        {
            IList <int> erros = new List <int>();

            return(new ServiceResult <string> {
                Erros = new ErrosDTO {
                    Erros = erros
                }, Sucesso = !erros.Any(), Resultado = Guid.NewGuid().ToString()
            });
        }
        public void Pagar(PagamentoModel pagamento_)
        {
            if (pagamento_.Valor > 10000M)
            {
                throw new ApplicationException("Valor acima do permitido.");
            }

            // Essa classe de negocio é uma Adaptador, ela faz o DE/PARA dos dados.
            // Ela adequa, faz a integração de classes incompativeis. O Debitar veio da classe pai, desceu via herança
            base.Debitar(pagamento_.Valor, pagamento_.Senha);
        }
예제 #10
0
        public void Pagar(PagamentoModel pagamento_)
        {
            if (String.IsNullOrWhiteSpace(pagamento_.Login))
            {
                throw new ApplicationException("Informe o Login");
            }

            if (String.IsNullOrWhiteSpace(pagamento_.Senha))
            {
                throw new ApplicationException("Informe o Senha");
            }
        }
예제 #11
0
 public IActionResult Create([FromBody] PagamentoModel _pagamentoModel)
 {
     try
     {
         var _pagamento = _mapper.Map <Pagamento>(_pagamentoModel);
         _pagamento = _pagamentoService.Add(_pagamento);
         return(Ok(_pagamento));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
 public ActionResult Definitivo(List <string> acquisti)
 {
     using (DatabaseContext db = new DatabaseContext())
     {
         try
         {
             db.Database.Connection.Open();
             foreach (string acquisto in acquisti)
             {
                 PagamentoModel model       = new PagamentoModel();
                 PersonaModel   utente      = Session["utente"] as PersonaModel;
                 int?           idPagamento = model.eseguiFromStoredProcedure(acquisto, utente);
                 if (idPagamento != null)
                 {
                     TRANSAZIONE pagamento = db.TRANSAZIONE.Include("CONTO_CORRENTE.PERSONA.PERSONA_EMAIL").Where(p => p.ID == idPagamento).SingleOrDefault();
                     // aggiorno punti attuali utente
                     Session["utente"] = new PersonaModel(db.PERSONA.Where(u => u.ID == utente.Persona.ID).FirstOrDefault());
                     model.SendEmail(ControllerContext, pagamento, utente);
                     return(Json(new { Messaggio = Language.CompletedPurchase }));
                 }
                 else
                 {
                     return(Json(model.Errore.ToString()));
                 }
             }
         }
         catch (Exception ex)
         {
             //Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
             LoggatoreModel.Errore(ex);
             // log errore, invio mail
             Response.StatusCode = (int)System.Net.HttpStatusCode.BadRequest;
             return(Json(ex.ToString()));
         }
         finally
         {
             if (db.Database.Connection.State != System.Data.ConnectionState.Closed)
             {
                 db.Database.Connection.Close();
             }
         }
     }
     Response.StatusCode = (int)System.Net.HttpStatusCode.BadRequest;
     return(Json(Language.ErrorPayment));
 }
예제 #13
0
        public static async Task <bool> Post(PagamentoModel request)
        {
            var uri = new Uri(string.Format("{0}/Logger/", urlBase));

            using (var cliente = new HttpClient())
            {
                var data    = JsonConvert.SerializeObject(request);
                var content = new StringContent(data, Encoding.UTF8, "application/json");

                HttpResponseMessage response = await cliente.PostAsync(uri, content);

                if (response.IsSuccessStatusCode)
                {
                    return(true);
                }
            }
            return(false);
        }
        public void Pagar(PagamentoModel pagamento_)
        {
            const Decimal VALOR_MINIMO_PAGAMENTO = 10;

            if (String.IsNullOrWhiteSpace(pagamento_.Login))
            {
                throw new ApplicationException("Informe o Login");
            }

            if (String.IsNullOrWhiteSpace(pagamento_.Senha))
            {
                throw new ApplicationException("Informe o Senha");
            }

            if (pagamento_.Valor <= VALOR_MINIMO_PAGAMENTO)
            {
                throw new ApplicationException("Valor minimo excedido");
            }
        }
예제 #15
0
        public IActionResult ExtratoConsultas(ConsultaModel formulario)
        {
            ClienteModel objClinte = new ClienteModel();

            ViewBag.ListaCliente = objClinte.ListaCliente();
            ConsultaModel objConsulta = new ConsultaModel();

            ViewBag.ListaConsulta = objConsulta.ListaConsulta();
            ServicoModel objServico = new ServicoModel();

            ViewBag.ListaServico = objServico.ListaServico();
            FuncionarioModel objFuncionario = new FuncionarioModel();

            ViewBag.ListaFuncionario = objFuncionario.ListaFuncionarioModel();
            PagamentoModel objPagamento = new PagamentoModel();

            ViewBag.ListaPagamento = objPagamento.ListaPagamento();
            return(View());
        }
예제 #16
0
        public IActionResult CriarConsulta(int?id)
        {
            if (id != null)
            {
            }
            ClienteModel objClinte = new ClienteModel();

            ViewBag.ListaCliente = objClinte.ListaCliente();
            ConsultaModel objConsulta = new ConsultaModel();

            ViewBag.ListaConsulta = objConsulta.ListaConsulta();
            ServicoModel objServico = new ServicoModel();

            ViewBag.ListaServico = objServico.ListaServico();
            FuncionarioModel objFuncionario = new FuncionarioModel();

            ViewBag.ListaFuncionario = objFuncionario.ListaFuncionarioModel();
            PagamentoModel objPagamento = new PagamentoModel();

            ViewBag.ListaPagamento = objPagamento.ListaPagamento();

            return(View());
        }
예제 #17
0
 public override void ItemClick(IItem item)
 {
     try
     {
         if (item != null)
         {
             var agenda = (SchedulerDto)Model;
             var model  = agenda.Model;
             if (model.GetType() == typeof(FatturaAcquistoDto))
             {
                 var obj       = (FatturaAcquistoDto)model;
                 var space     = new FatturaAcquistoModel();
                 var viewModel = new FatturaAcquistoViewModel();
                 AddSpace(space, obj, viewModel);
             }
             else if (model.GetType() == typeof(FatturaVenditaDto))
             {
                 var obj       = (FatturaVenditaDto)model;
                 var space     = new FatturaVenditaModel();
                 var viewModel = new FatturaVenditaViewModel();
                 AddSpace(space, obj, viewModel);
             }
             else if (model.GetType() == typeof(PagamentoDto))
             {
                 var obj       = (PagamentoDto)model;
                 var space     = new PagamentoModel();
                 var viewModel = new PagamentoViewModel();
                 AddSpace(space, obj, viewModel);
             }
         }
     }
     catch (Exception ex)
     {
         UtilityError.Write(ex);
     }
 }
예제 #18
0
        public async Task <LoggerPost> Post([FromBody] PagamentoModel request)
        {
            LoggerPost result = new LoggerPost(200);

            return(result);
        }
예제 #19
0
 public static async Task <bool> Incluir(PagamentoModel request)
 {
     return(await LoggerApiAdapter.Post(request));
 }
예제 #20
0
 public void Inicialize()
 {
     _pagamento = new PagamentoModel();
 }
 //Podemos implementar o padrao aDAPTADOR de 2 formas
 // COMPOSICAO (DAMOS UM NEW) = BOLETOS
 //HERANÇA (HERDAMOS) = ESSA CLASSE AQUI, OPERADORES
 public void Pagar(PagamentoModel pagamento_)
 {
     Debitar(pagamento_.Valor, pagamento_.Senha);
 }