Exemplo n.º 1
0
        public ServiceHeaders DeleteServiceHeader(int headerId)
        {
            ServiceHeaders dbentry = context.ServiceHeaders.Find(headerId);

            if (dbentry != null)
            {
                context.ServiceHeaders.Remove(dbentry);
                context.SaveChanges();
            }
            return(dbentry);
        }
Exemplo n.º 2
0
        public ServiceRequests DeleteServiceRequest(int requestId)
        {
            ServiceRequests dbentry = context.ServiceRequests.Find(requestId);

            if (dbentry != null)
            {
                context.ServiceRequests.Remove(dbentry);
                context.SaveChanges();
            }
            return(dbentry);
        }
Exemplo n.º 3
0
        public ServiceResponses DeleteServiceResponse(int responseId)
        {
            ServiceResponses dbentry = context.ServiceResponses.Find(responseId);

            if (dbentry != null)
            {
                context.ServiceResponses.Remove(dbentry);
                context.SaveChanges();
            }
            return(dbentry);
        }
Exemplo n.º 4
0
        /// <summary>
        /// This method returns records gotten from DB matching users phone number
        /// </summary>
        /// <param name="tell"></param>
        /// <returns></returns>
        public ReturnMessage UpdateGameUserLastAccess(string tell, GameData.Game game)
        {
            ReturnMessage returnMessage;

            if (tell.Trim() != game.MSISDN.Trim())
            {
                return(returnMessage = new ReturnMessage()
                {
                    Message = "Record Mismatch",
                    Success = false
                });
            }

            try
            {
                //Update Last Access DateTime to Today
                game.LastAccess = DateTime.Today;

                _NGSubscriptionsEntities.Entry(game).State = EntityState.Modified;
                var retVal = _NGSubscriptionsEntities.SaveChanges();
                return(returnMessage = new ReturnMessage()
                {
                    ID = retVal,
                    Message = "Operation Successful",
                    Success = true,
                    Data = game
                });
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SubscriberExists(tell))
                {
                    return(returnMessage = new ReturnMessage()
                    {
                        Message = "Record Not Found",
                        Success = false
                    });
                }
                else
                {
                    throw;
                }
            }
        }