Ejemplo n.º 1
0
        public HttpResponseMessage DeleteLookupType(LookupTypeParams obj)
        {
            try
            {
                if (obj == null)
                {
                    goto ThrowBadRequest;
                }

                var lookups = db.LookupTypeDelete(obj.ID);
                return(Request.CreateResponse(HttpStatusCode.OK, lookups));
            }
            catch (Exception)
            {
                return(Request.CreateResponse(HttpStatusCode.InternalServerError));
            }
ThrowBadRequest:
            return(Request.CreateResponse(HttpStatusCode.BadRequest));
        }
Ejemplo n.º 2
0
        public HttpResponseMessage SelectLookupType(LookupTypeParams obj, int pageNumber = 1, int pageSize = 10)
        {
            try
            {
                if (obj == null)
                {
                    goto ThrowBadRequest;
                }

                var lookups = db.LookupTypeSelect(obj.ID == 0 ? null : (int?)obj.ID, obj.Title, obj.IsDeleted, pageNumber, pageSize);
                return(Request.CreateResponse(HttpStatusCode.OK, lookups));
            }
            catch (Exception)
            {
                return(Request.CreateResponse(HttpStatusCode.InternalServerError));
            }
ThrowBadRequest:
            return(Request.CreateResponse(HttpStatusCode.BadRequest));
        }