예제 #1
0
        /// <inheritdoc/>
        public async Task <SalesDetails> UpdateSaleAsync(int saleId, UpdateSaleModel updateSaleModel, CancellationToken cancellationToken)
        {
            var saleDetails = await this.salesRepository.GetSaleByIdAsync(saleId, cancellationToken);

            if (saleDetails is null)
            {
                throw new Exception("No sale details found with provided id.");
            }

            saleDetails.PaymentTypeId = updateSaleModel.Sale.PaymentTypeId;
            saleDetails.SalesStatusId = updateSaleModel.Sale.SalesStatusId;

            return(await this.salesRepository.UpdateSaleAsync(saleId, this.mapper.Map <Sale>(saleDetails), cancellationToken));
        }
예제 #2
0
 public async Task <bool> UpdateSaleAsyncAsync(UpdateSaleModel model, int profileId)
 {
     using (var con = GetConnection())
     {
         await con.ExecuteAsync("sp_MCredit_TempProfile_update_Sale", new
         {
             profileId,
             model.SaleId,
             model.SaleNumber,
             model.SaleName
         }, commandType : CommandType.StoredProcedure);
     }
     return(true);
 }
예제 #3
0
 public async Task <ActionResult <SalesDetails> > UpdateSale(int id, UpdateSaleModel updateSaleModel, CancellationToken cancellationToken)
 {
     return(this.Ok(await this.salesService.UpdateSaleAsync(id, updateSaleModel, cancellationToken)));
 }