public void DeleteItem(SessionRegistrationInfo i)
 {
     using (IDataContext ctx = DataContext.Instance())
     {
         var rep = ctx.GetRepository<SessionRegistrationInfo>();
         rep.Delete(i);
     }
 }
Example #2
0
 public void UpdateItem(SessionRegistrationInfo i)
 {
     using (IDataContext ctx = DataContext.Instance())
     {
         var rep = ctx.GetRepository <SessionRegistrationInfo>();
         rep.Update(i);
     }
 }
Example #3
0
        public SessionRegistrationInfo GetItem(int itemId, int sessionId)
        {
            SessionRegistrationInfo i = null;

            using (IDataContext ctx = DataContext.Instance())
            {
                var rep = ctx.GetRepository <SessionRegistrationInfo>();
                i = rep.GetById(itemId, sessionId);
            }
            return(i);
        }
        public HttpResponseMessage CreateSessionRegistration(SessionRegistrationInfo registration)
        {
            try
            {
                SessionRegistrationDataAccess.CreateItem(registration);

                var savedRegistration = SessionRegistrationDataAccess.GetItems(registration.SessionId).FirstOrDefault(r => r.RegistrationId == registration.RegistrationId);

                var response = new ServiceResponse<SessionRegistrationInfo> { Content = savedRegistration };

                return Request.CreateResponse(HttpStatusCode.OK, response.ObjectToJson());
            }
            catch (Exception ex)
            {
                Exceptions.LogException(ex);
                return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ERROR_MESSAGE);
            }
        }
 public void UpdateItem(SessionRegistrationInfo i)
 {
     repo.UpdateItem(i);
 }
 public void DeleteItem(SessionRegistrationInfo i)
 {
     repo.DeleteItem(i);
 }
 public void CreateItem(SessionRegistrationInfo i)
 {
     repo.CreateItem(i);
 }
 public void UpdateItem(SessionRegistrationInfo i)
 {
     repo.UpdateItem(i);
 }
 public void DeleteItem(SessionRegistrationInfo i)
 {
     repo.DeleteItem(i);
 }
 public void CreateItem(SessionRegistrationInfo i)
 {
     repo.CreateItem(i);
 }