Ejemplo n.º 1
0
        public HttpResponseMessage UpdatePrayerAnswered(string QueueActionGUID, string PrayerID, PrayerAnswered p)
        {
            PenYourPrayerIdentity user = (PenYourPrayerIdentity)User.Identity;

            using (DBDataContext db = new DBDataContext())
            {
                String res = "";
                db.usp_UpdatePrayerAnswered(QueueActionGUID, (long?)user.ID, long.Parse(p.AnsweredID), p.Answered, p.TouchedWhen, ref res);
                return(Request.CreateResponse(HttpStatusCode.OK, new CustomResponseMessage()
                {
                    StatusCode = (int)HttpStatusCode.OK, Description = res
                }));
            }
        }
Ejemplo n.º 2
0
        public HttpResponseMessage AddNewPrayerAnswered(string QueueActionGUID, string PrayerID, PrayerAnswered p)
        {
            PenYourPrayerIdentity user = (PenYourPrayerIdentity)User.Identity;

            using (DBDataContext db = new DBDataContext())
            {
                String res        = "";
                long?  AnsweredID = -1;
                db.usp_AddNewPrayerAnswered(QueueActionGUID, (long?)user.ID, long.Parse(p.OwnerPrayerID), p.Answered, p.CreatedWhen, p.TouchedWhen, ref res, ref AnsweredID);
                if (res.ToUpper() == "OK")
                {
                    return(Request.CreateResponse(HttpStatusCode.OK, new CustomResponseMessage()
                    {
                        StatusCode = (int)HttpStatusCode.OK, Description = "OK-" + AnsweredID.ToString()
                    }));
                }
                else
                {
                    return(Request.CreateResponse(HttpStatusCode.OK, new CustomResponseMessage()
                    {
                        StatusCode = (int)HttpStatusCode.OK, Description = res
                    }));
                }
            }
        }