Example #1
0
        /// <inheritdoc />
        Task <ApiResponse <BillResponse> > IStorageApi.CreateBillAsync(CreateBillRequest billRequest)
        {
            var arguments = new object[] { billRequest };
            var func      = requestBuilder.BuildRestResultFuncForMethod("CreateBillAsync", new Type[] { typeof(CreateBillRequest) });

            return((Task <ApiResponse <BillResponse> >)func(Client, arguments));
        }
        public async Task <IActionResult> CreateAsync([FromBody] CreateBillRequest billRequest)
        {
            var bill = new Bill
            {
                Date     = billRequest.Date,
                Price    = billRequest.Price,
                Quantity = billRequest.Quantity,
                TypeId   = billRequest.TypeId
            };

            await _billService.CreateBillAsync(bill);

            var locationUrl = _uriService.GetProductUri(bill.Id.ToString());

            //var response = new ProductTypeResponse { Id = productType.Id };
            return(Created(locationUrl, _mapper.Map <BillResponse>(bill)));
        }
        public async Task <IActionResult> CreateBills(CreateBillRequest request)
        {
            var result = await _service.CreateBillsForPeriod(request.Period, request.Category);

            return(Ok(result));
        }
Example #4
0
 /// <remarks/>
 public void CreateBillAsync(CreateBillRequest CreateBillRequest, object userState) {
     if ((this.CreateBillOperationCompleted == null)) {
         this.CreateBillOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateBillOperationCompleted);
     }
     this.InvokeAsync("CreateBill", new object[] {
                 CreateBillRequest}, this.CreateBillOperationCompleted, userState);
 }
Example #5
0
 /// <remarks/>
 public void CreateBillAsync(CreateBillRequest CreateBillRequest) {
     this.CreateBillAsync(CreateBillRequest, null);
 }