Пример #1
0
        public JsonResult DeleteSale([FromBody] DeleteSaleRequest request)
        {
            BaseResponse baseResponse = new BaseResponse();
            AdminSale    sale         = this._adminSaleService.GetSale(request.SaleId);

            this._adminSaleService.UpdateSaleStock(sale, sale.Quantity);
            this._dealerProductService.UpdateDealerStock(this._dealerProductService.IsExists(sale.DealerId, sale.ProductId), sale.Quantity);
            baseResponse.Number  = 1;
            baseResponse.Message = "Satış işlemi başarıyla silinmiştir..";
            return(this.Json((object)baseResponse));
        }
Пример #2
0
        public JsonResult DeleteSale([FromBody] DeleteSaleRequest request)
        {
            BaseResponse baseResponse = new BaseResponse();
            DealerSale   sale         = this._dealerSaleService.GetSale(request.SaleId);

            sale.IsActive = false;
            this._dealerSaleService.Update(sale);
            DealerProduct dealerProduct = this._dealerProductService.IsExists(sale.DealerId, sale.ProductId);

            dealerProduct.Stock += sale.Quantity;
            this._dealerProductService.Update(dealerProduct);
            baseResponse.Number  = 1;
            baseResponse.Message = "Satış işlemi başarıyla silinmiştir..";
            return(this.Json((object)baseResponse));
        }