コード例 #1
0
        public static ReturnResponse Get(int returnCode, Object obj)
        {
            ReturnResponse returnValue  = new ReturnResponse();
            ReturnStatus   returnStatus = new ReturnStatus(returnCode.ToString(), (returnCode > 0 ? ReturnConstant.SUCCESS_MESSAGE : ReturnConstant.FAILURE_MESSAGE));

            returnValue.Status = returnStatus;
            returnValue.Result = obj;
            return(returnValue);
        }
コード例 #2
0
        public static ReturnResponse Get(User user)
        {
            ReturnResponse returnValue  = new ReturnResponse();
            ReturnStatus   returnStatus = new ReturnStatus(ReturnConstant.SUCCESS.ToString(), ReturnConstant.SUCCESS_MESSAGE);

            returnValue.Result = user;
            returnValue.Status = returnStatus;
            return(returnValue);
        }
コード例 #3
0
        public static ReturnResponse GetFailureStatus(Object obj)
        {
            ReturnResponse r = new ReturnResponse();
            ReturnStatus   s = new ReturnStatus("-1", "Failure");

            r.Result = obj;
            r.Status = s;

            return(r);
        }
コード例 #4
0
        public static ReturnResponse GetSuccessStatus(Object obj)
        {
            ReturnResponse r = new ReturnResponse();
            ReturnStatus   s = new ReturnStatus("1", "Success");

            r.Result = obj;
            r.Status = s;

            return(r);
        }