public static TransferPrice CreateTransferPrice(string dataAreaId,
                                                        string resourceId,
                                                        string borrowingLegalEntity,
                                                        string projectId,
                                                        string categoryId,
                                                        global::System.DateTimeOffset effectiveDate,
                                                        string salesCurrency,
                                                        string projectContractId,
                                                        string roleId,
                                                        decimal pricing)
        {
            TransferPrice transferPrice = new TransferPrice();

            transferPrice.dataAreaId           = dataAreaId;
            transferPrice.ResourceId           = resourceId;
            transferPrice.BorrowingLegalEntity = borrowingLegalEntity;
            transferPrice.ProjectId            = projectId;
            transferPrice.CategoryId           = categoryId;
            transferPrice.EffectiveDate        = effectiveDate;
            transferPrice.SalesCurrency        = salesCurrency;
            transferPrice.ProjectContractId    = projectContractId;
            transferPrice.RoleId  = roleId;
            transferPrice.Pricing = pricing;
            return(transferPrice);
        }
Ejemplo n.º 2
0
        public HttpResponseMessage UpdateTransferPrice(HttpRequestMessage request, [FromBody] TransferPrice transferpriceModel)
        {
            return(GetHttpResponse(request, () =>
            {
                var transferprice = _MPRCoreService.UpdateTransferPrice(transferpriceModel);

                return request.CreateResponse <TransferPrice>(HttpStatusCode.OK, transferprice);
            }));
        }
Ejemplo n.º 3
0
        public HttpResponseMessage GetTransferPrice(HttpRequestMessage request, int transferPriceId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                TransferPrice transferPrice = _MPRCoreService.GetTransferPrice(transferPriceId);

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

                return response;
            }));
        }
Ejemplo n.º 4
0
        public HttpResponseMessage DeleteTransferPrice(HttpRequestMessage request, [FromBody] int transferPriceId)
        {
            return(GetHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;

                // not that calling the WCF service here will authenticate access to the data
                TransferPrice transferPrice = _MPRCoreService.GetTransferPrice(transferPriceId);

                if (transferPrice != null)
                {
                    _MPRCoreService.DeleteTransferPrice(transferPriceId);

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

                return response;
            }));
        }
Ejemplo n.º 5
0
 public TransferPrice UpdateTransferPrice(TransferPrice transferPrice)
 {
     return(Channel.UpdateTransferPrice(transferPrice));
 }