//private readonly ComercioDbContext _context; //public BancoController(ComercioDbContext context) //{ // _context = context; //} // GET: Banco public ActionResult Index() { //var result = await _context.Bancos.ToListAsync(); BancoRespuesta result = new BancoRespuesta(); result = new BancoService().ListarAll(); return(View(result.Lista)); }
public IActionResult Eliminar(int id) { try { //var res = BancoLogic.Eliminar(id); var res = BancoService.Eliminar(id); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public BancoQuery(BancoService bancoService) { Field <BancoType>( name: "banco", arguments: new QueryArguments(new QueryArgument <IntGraphType> { Name = "id" }), resolve: context => { int id = (int)context.Arguments["id"]; return(bancoService.GetBancoById(id)); } ); Field <ListGraphType <BancoType> >( name: "GetAllBancos", resolve: context => { return(bancoService.GetAllBancos()); } ); }
// GET: Banco/Create public IActionResult Registro(int id = 0) { if (id == 0) { return(View(new Banco())); } else { BancoRespuesta result = new BancoRespuesta(); result = new BancoService().GetReg(id); if (result.Entidad == null) { return(View(new Banco())); } else { return(View(result.Entidad)); } } }
public IActionResult Registro([Bind("ID,nombre,direccion,fecha_registro")] Banco _banco) { if (ModelState.IsValid) { BancoRespuesta result = new BancoRespuesta(); if (_banco.ID == 0) { //result = BancoLogic.Registrar(_banco); result = BancoService.Registrar(_banco); } else { //result = BancoLogic.Actualizar(_banco); result = BancoService.Actualizar(_banco); } return(RedirectToAction(nameof(Index))); } return(View(_banco)); }
public static MvcHtmlString SelectBanco(this HtmlHelper html, int idBanco = 0, bool selecione = false) { var idEmpresa = new UsuarioService().GetUsuario(System.Web.HttpContext.Current.User.Identity.Name).IdEmpresa; var bancos = new BancoService().Listar() .Where(x => x.Ativo == true && x.IdEmpresa == idEmpresa) .OrderBy(x => x.Descricao) .ToList(); TagBuilder tag = new TagBuilder("select"); tag.MergeAttribute("id", "IdBanco"); tag.MergeAttribute("name", "IdBanco"); tag.MergeAttribute("class", "form-control"); if (selecione == true) { TagBuilder itemSel = new TagBuilder("option"); itemSel.MergeAttribute("value", "0"); itemSel.SetInnerText(""); tag.InnerHtml += itemSel.ToString(); } foreach (var item in bancos) { TagBuilder itemTag = new TagBuilder("option"); itemTag.MergeAttribute("value", item.Id.ToString()); if (item.Id == idBanco) { itemTag.MergeAttribute("selected", "selected"); } itemTag.SetInnerText(item.Descricao); tag.InnerHtml += itemTag.ToString(); } return(new MvcHtmlString(tag.ToString())); }
public BancoController(IConfiguration configuration) { _configuration = configuration; _BancoService = new BancoService(_configuration); }
public BancoController(BancoService servico) { _servico = servico; }
public BancoController(IRepositoryWrapper repository) { _repository = repository; _service = new BancoService(); }
public BancoController(BancoService bancoService) { _bancoService = bancoService; }
public GraphQlController(BancoService bancoService) { this.bancoService = bancoService; }