| | |
| | | using FastReport.Table; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; |
| | | using System.Text.Json; |
| | | using System.Text.Json.Serialization; |
| | | |
| | | namespace Print.Controllers |
| | | { |
| | |
| | | { |
| | | const string PrintName = "Deli DL-888B(NEW)"; |
| | | [HttpGet, HttpPost, Route("PrintInboundOrder"), AllowAnonymous] |
| | | public object PrintInboundOrder([FromBody] List<InboundOrder> inbounds) |
| | | public object PrintInboundOrder([FromBody][ValidateNever] List<InboundOrder> inbounds) |
| | | { |
| | | Console.WriteLine($"{JsonSerializer.Serialize(inbounds)}"); |
| | | try |
| | | { |
| | | foreach (var inbound in inbounds) |
| | |
| | | TableCell DemandClassification = report.FindObject("DemandClassification") as TableCell; |
| | | if (DemandClassification != null) |
| | | { |
| | | DemandClassification.Text = inbound.DemandClassification.ToString(); |
| | | if (inbound.DemandClassification == null || inbound.DemandClassification=="") |
| | | { |
| | | DemandClassification.Text = " "; |
| | | } |
| | | else |
| | | { |
| | | DemandClassification.Text = inbound.DemandClassification; |
| | | } |
| | | } |
| | | report.Print(); |
| | | report.Dispose(); |
| | |
| | | public class InboundOrder |
| | | { |
| | | public string OrderNo { get; set; } |
| | | public string DemandClassification { get; set; } |
| | | public string? DemandClassification { get; set; } |
| | | public string UpperOrderNo { get; set; } |
| | | public string WarehouseName { get; set; } |
| | | public string MaterialNo { get; set; } |
| | | public string MaterialName { get; set; } |
| | | public string Specs { get; set; } |
| | | public string Unit { get; set; } |
| | | public string? MaterialName { get; set; } |
| | | public string? Specs { get; set; } |
| | | public string? Unit { get; set; } |
| | | public decimal Quantity { get; set; } |
| | | public string ProductDrawingNumber { get; set; } |
| | | public string Datetime { get; set; } |
| | | public decimal Weight { get; set; } |
| | | public string? ProductDrawingNumber { get; set; } |
| | | public string? Datetime { get; set; } |
| | | public decimal? Weight { get; set; } |
| | | } |
| | | } |
| | | } |