﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LJH.GeneralLibrary;

namespace LJH.Inventory.BusinessModel
{
    /// <summary>
    /// 表示出库单
    /// </summary>
    public static class StackInSheetExtension
    {
        public static decimal? GetWeight(this StackInItem info)
        {
            var weight = info.GetPropertyByDecimal(ItemNote.重量);
            return weight;
        }

        public static void SetWeight(this StackInItem info, decimal? weight)
        {
            info.SetProperty(ItemNote.重量, weight.HasValue ? weight.ToString() : null);
        }

        public static decimal GetWeight(this StackInSheet info)
        {
            var weight = info.GetPropertyByDecimal(ItemNote.重量);
            return weight.HasValue ? weight.Value : 0;
        }

        public static void SetWeight(this StackInSheet info, decimal weight)
        {
            info.SetProperty(ItemNote.重量, weight.ToString());
        }
    }
}