using ButcherFactory.BO.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace ButcherFactory.WeightCount_
{
  public class DiscontSetting
  {
    public string Name { get; set; }

    public decimal Standard { get; set; }

    public int Number { get; set; }

    [XmlIgnore]
    public decimal Weight { get { return Standard * Number; } }

    public static BindingList<DiscontSetting> Load()
    {
      return XmlUtil.DeserializeFromFile<BindingList<DiscontSetting>>("Config\\DiscontSetting.xml");
    }

    public static void Save(BindingList<DiscontSetting> list)
    {
      XmlUtil.SerializerObjToFile(list, "Config\\DiscontSetting.xml");
    }
  }
}
