示例#1
0
        public static SalesReceiptLine ToQBAccessSalesReceiptLine(this Line line)
        {
            var ineDetail = (line.AnyIntuitObject as SalesItemLineDetail) ?? new SalesItemLineDetail {
                Qty = 0, ItemRef = new ReferenceType()
                {
                    name = ""
                }
            };
            var qbAccessLine = new SalesReceiptLine
            {
                Id          = line.Id,
                Amount      = line.Amount,
                Description = line.Description,
                LineNum     = line.LineNum,
                Qty         = ineDetail.Qty,
                Sku         = ineDetail.ItemRef.name,
            };

            if (ineDetail.ItemElementName == ItemChoiceType.UnitPrice && (ineDetail.AnyIntuitObject is double))
            {
                qbAccessLine.UnitPrice = ( double )ineDetail.AnyIntuitObject;
            }

            return(qbAccessLine);
        }
        public async Task <bool> StoreNewSalesReceiptLineAsync(int SalesReceiptId, SalesReceiptLine SalesReceiptLine)
        {
            SalesReceiptLine.SalesReceiptId = SalesReceiptId;

            _context.SalesReceiptLines.Add(SalesReceiptLine);
            return((await _context.SaveChangesAsync()) > 0);
        }
示例#3
0
        public static OrderLine ToQBOrderLine(this SalesReceiptLine source)
        {
            var line = new OrderLine()
            {
                Amount      = source.Amount,
                Description = source.Description,
                Id          = source.Id,
                LineNum     = source.LineNum,
                Qty         = source.Qty,
                Sku         = source.Sku,
                UnitPrice   = source.UnitPrice
            };

            return(line);
        }
 public async Task <bool> DeleteSalesReceiptLine(SalesReceiptLine SalesReceiptLine)
 {
     _context.Remove(SalesReceiptLine);
     return((await _context.SaveChangesAsync()) > 0);
 }
        public async Task <bool> UpdateSalesReceiptLineAsync(int SalesReceiptId, SalesReceiptLine SalesReceiptLine)
        {
            SalesReceiptLine.SalesReceiptId = SalesReceiptId;

            return((await _context.SaveChangesAsync()) > 0);
        }