public async Task <IActionResult> GetGoodCateCode([FromRoute] int id) { try { var goodCateCode = await _context.GoodCateCode.SingleOrDefaultAsync(m => m.Id == id); var response = new GoodCateResponse { SubPromotionDropDowns = iCodeProService.SubPromotionDropDowns(), GoodCateCodeDropDowns = iGetTranInvService.ProductDropDowns(), goodCate = goodCateCode }; return(Ok(response)); } catch (Exception ex) { return(StatusCode(500, ex)); } }
public async Task <IActionResult> GetListProductPromotion([FromRoute] int id) { try { var listProductPromotion = await _context.ListProductPromotion.SingleOrDefaultAsync(m => m.Id == id); var response = new ListProductResponse { SubPromotionDropDowns = iCodeProService.SubPromotionDropDowns(), GoodCodeDropDowns = iGetTranInvService.GoodCodeDropDowns(), GoodCode = listProductPromotion }; return(Ok(response)); } catch (Exception ex) { return(StatusCode(500, ex)); } }
public async Task <IActionResult> GetSaleproFrpcostRf(int id) { try { var saleproFrpcostRf = await _context.SaleproFrpcostRf.SingleOrDefaultAsync(m => m.Id == id); var response = new FrpcostRfResponse { ProductDropDowns = iGetTranInvService.ProductDropDowns(), SubPromotionDropDowns = iCodeProService.SubPromotionDropDowns(), promotionCostRF = saleproFrpcostRf }; return(Ok(response)); } catch (Exception ex) { return(StatusCode(500, ex)); } }
public async Task <IActionResult> GetSaleproGoodPattn([FromRoute] int id) { try { var saleproGoodPattn = await _context.SaleproGoodPattn.SingleOrDefaultAsync(m => m.Id == id); var response = new SpecialResponse { SubPromotionDropDowns = iCodeProService.SubPromotionDropDowns(), GoodPattnDropDowns = iGetTranInvService.PattnDropDowns(), GoodClassDropDowns = iGetTranInvService.ClassDropDowns(), promotionSpecial = saleproGoodPattn }; return(Ok(response)); } catch (Exception ex) { return(StatusCode(500, ex)); } }