public async Task <IActionResult> Create([Bind("Id,Nombre,FechaModificacion")] Cliente cliente)
        {
            var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());

            XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));

            var logger = LogManager.GetLogger(typeof(ClientesController));


            if (!ClienteNombreExists(cliente.Nombre))
            {
                if (ModelState.IsValid)
                {
                    _context.Add(cliente);
                    logger.Info("Se Agrego El Cliente :" + cliente.Nombre.ToString());
                    await _context.SaveChangesAsync();

                    return(RedirectToAction(nameof(Index)));
                }
            }
            else
            {
                logger.Error("Se Quizo agregar El Cliente :" + cliente.Nombre.ToString());
                return(View(cliente));
            }

            return(View(cliente));
        }
        public async Task <IActionResult> PuttipoPago(int id, tipoPago tipoPago)
        {
            if (id != tipoPago.TipoPagoId)
            {
                return(BadRequest());
            }

            _context.Entry(tipoPago).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!tipoPagoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> Putoferta(int id, oferta oferta)
        {
            if (id != oferta.OfertaId)
            {
                return(BadRequest());
            }

            _context.Entry(oferta).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ofertaExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> Putnotificacion(int id, notificacion notificacion)
        {
            if (id != notificacion.NotificacionId)
            {
                return(BadRequest());
            }

            _context.Entry(notificacion).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!notificacionExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutdestinoCompra(int id, destinoCompra destinoCompra)
        {
            if (id != destinoCompra.DestinoCompraId)
            {
                return(BadRequest());
            }

            _context.Entry(destinoCompra).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!destinoCompraExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> Putlog(int id, log log)
        {
            if (id != log.LogId)
            {
                return(BadRequest());
            }

            _context.Entry(log).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!logExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> Putrol(int id, rol rol)
        {
            if (id != rol.RolId)
            {
                return(BadRequest());
            }

            _context.Entry(rol).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!rolExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> Create([Bind("Id,Descripcion,FechaModificacion,ClienteId")] Plan plan)
        {
            var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());

            XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));

            var logger = LogManager.GetLogger(typeof(ClientesController));

            logger.Info("Se Agrego El Plan :" + plan.Descripcion.ToString());

            if (ModelState.IsValid)
            {
                _context.Add(plan);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClienteId"] = new SelectList(_context.Cliente, "Id", "Id", plan.ClienteId);
            return(View(plan));
        }