public DBEntity Actualizar(ClienteInformacionAdministrativaEntity entity)
        {
            try
            {
                var result = sql.QueryExecute("ClienteInformacionAdministrativaActualizar", new
                {
                    entity.IdClienteInformacionAdmin,
                    entity.Tarifa,
                    entity.SesionesRayosUVA,
                    entity.FechaProximaRenovacion,
                    entity.Casillero,
                    entity.SaldoMonederoVirtual,
                    entity.TieneHijos
                });


                return(result);
            }
            catch (Exception ex)
            {
                return(new DBEntity {
                    CodeError = ex.HResult, MsgError = ex.Message
                });
            }
        }
        public ActionResult Save(ClienteInformacionAdministrativaEntity entity)
        {
            try
            {
                var result = new DBEntity();

                if (entity.IdClienteInformacionAdmin.HasValue)
                {
                    result          = IApp.clienteinformacionadministrativaService.Actualizar(entity);
                    TempData["msg"] = "Se Actualizo el registro con exito!";
                }
                else
                {
                    result          = IApp.clienteinformacionadministrativaService.Insertar(entity);
                    TempData["msg"] = "Se agrego el registro con exito!";
                }


                if (result.CodeError != 0)
                {
                    throw new Exception(result.MsgError);
                }



                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                return(Content(ex.Message));
            }
        }
        public ActionResult Edit(int?id)
        {
            this.SessionOnline();

            var entity = new ClienteInformacionAdministrativaEntity();

            try
            {
                ViewBag.Form = false;
                if (id.HasValue)
                {
                    //editar
                    ViewBag.Form = true;

                    entity = IApp.clienteinformacionadministrativaService.ObtenerLista(id).FirstOrDefault();
                }
            }
            catch (Exception ex)
            {
                return(Content(ex.Message));
            }


            return(View(entity));
        }
 public DBEntity Eliminar(ClienteInformacionAdministrativaEntity entity)
 {
     try
     {
         var result = sql.QueryExecute("ClienteInformacionAdministrativaEliminar", new
         {
             entity.IdClienteInformacionAdmin
         });
         return(result);
     }
     catch (Exception ex)
     {
         return(new DBEntity {
             CodeError = ex.HResult, MsgError = ex.Message
         });
     }
 }