Exemplo n.º 1
0
        public HttpResponseMessage GetBalanceSheetThreshold(HttpRequestMessage request, int mprbalancesheetadjustmentId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                MPRBalanceSheetAdjustment mprbalancesheetadjustment = _MPRBSService.GetBalanceSheetAdjustment(mprbalancesheetadjustmentId);

                // notice no need to create a seperate model object since BalanceSheetThreshold entity will do just fine
                response = request.CreateResponse <MPRBalanceSheetAdjustment>(HttpStatusCode.OK, mprbalancesheetadjustment);

                return response;
            }));
        }
Exemplo n.º 2
0
        public HttpResponseMessage DeleteBalanceSheetThreshold(HttpRequestMessage request, [FromBody] int mprbalancesheetadjustmentId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                MPRBalanceSheetAdjustment mprbalancesheetadjustment = _MPRBSService.GetBalanceSheetAdjustment(mprbalancesheetadjustmentId);

                if (mprbalancesheetadjustment != null)
                {
                    _MPRBSService.DeleteBalanceSheetAdjustment(mprbalancesheetadjustmentId);

                    response = request.CreateResponse(HttpStatusCode.OK);
                }
                else
                {
                    response = request.CreateErrorResponse(HttpStatusCode.NotFound, "No mprbalancesheetadjustment found under that ID.");
                }

                return response;
            }));
        }
 public MPRBalanceSheetAdjustment UpdateBalanceSheetAdjustment(MPRBalanceSheetAdjustment balanceSheetAdjustment)
 {
     return(Channel.UpdateBalanceSheetAdjustment(balanceSheetAdjustment));
 }
Exemplo n.º 4
0
        public HttpResponseMessage UpdateMPRBalanceSheetAdjustment(HttpRequestMessage request, [FromBody] MPRBalanceSheetAdjustment mprbalanceSheetAdjustmentModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var mprbalanceSheetAdjustment = _MPRBSService.UpdateBalanceSheetAdjustment(mprbalanceSheetAdjustmentModel);

                return request.CreateResponse <MPRBalanceSheetAdjustment>(HttpStatusCode.OK, mprbalanceSheetAdjustment);
            }));
        }