コード例 #1
0
 public IHttpActionResult checkinscantaxis2([FromBody] getdata data)
 {
     try
     {
         MultigymEntities1 context = new MultigymEntities1();
         string            res     = "";
         res = check_gym(data.idgym);
         MG_Gym gym = new MG_Gym();
         if (res == "ok")
         {
             gym = (from x in context.MG_Gym
                    where x.ID == data.idgym &&
                    x.Id_TipoEntidad == (int)tipoEntidad.taxi &&
                    x.Activo == true
                    select x).First();
             res = check_persona(data.idusuario, data.montoapagar, gym.Nombre, true);
         }
         if (res != "ok")
         {
             return(Ok(RespuestaApi <string> .createRespuestaError(res)));
         }
         else
         {
             res = "Desea pagar " + data.montoapagar + " creditos a " + gym.Nombre;
             return(Ok(RespuestaApi <string> .createRespuestaSuccess(res)));
         }
     }
     catch (Exception ex)
     {
         return(Ok(RespuestaApi <string> .createRespuestaError(ex.Message)));
     }
 }
コード例 #2
0
 public IHttpActionResult checkinscanother([FromBody] getdata data)
 {
     try
     {
         MultigymEntities1 context = new MultigymEntities1();
         string            res     = "";
         res = check_gym(data.idgym);
         MG_Gym gym = new MG_Gym();
         if (res == "ok")
         {
             gym = (from x in context.MG_Gym
                    where x.ID == data.idgym &&
                    x.Id_TipoEntidad == (int)tipoEntidad.comercio &&
                    x.Activo == true
                    select x).First();
         }
         if (res != "ok")
         {
             return(Ok(RespuestaApi <string> .createRespuestaError(res)));
         }
         else
         {
             res = "Ingrese el monto a pagar en " + gym.Nombre;
             return(Ok(RespuestaApi <string> .createRespuestaSuccess(res)));
         }
     }
     catch (Exception ex)
     {
         return(Ok(RespuestaApi <string> .createRespuestaError(ex.Message)));
     }
 }