using Forks.EnterpriseServices.DomainObjects2;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ButcherFactory.BO
{
  [MapToTable("Butcher_ClientGoodsSet")]
  public class ClientGoodsSet : BaseInfo
  {
    public long? ClientGoodsClass_ID { get; set; }
     
    public string ClientGoodsClass_Name { get; set; }

    private List<ClientGoodsSet_Detail> mDetails = new List<ClientGoodsSet_Detail>();
    [NonDmoProperty]
    public List<ClientGoodsSet_Detail> Details { get { return mDetails; } }
  }

  [MapToTable("Butcher_ClientGoodsSet_Detail")]
  [KeyField("ID", KeyGenType.assigned)]
  public class ClientGoodsSet_Detail
  {
    public long ClientGoodsSet_ID { get; set; }

    public long ID { get; set; }

    public long Goods_ID { get; set; }

    [ReferenceTo(typeof(Goods), "Name")]
    [Join("Goods_ID", "ID")]
    public string Goods_Name { get; set; }

    [ReferenceTo(typeof(Goods), "Spec")]
    [Join("Goods_ID", "ID")]
    public string Goods_Spec { get; set; }

    [ReferenceTo(typeof(Goods), "Code")]
    [Join("Goods_ID", "ID")]
    public string Goods_Code { get; set; }

    [ReferenceTo(typeof(Goods), "GoodsType")]
    [Join("Goods_ID", "ID")]
    public short? GoodsType { get; set; }

    [ReferenceTo(typeof(Goods), "MainUnit")]
    [Join("Goods_ID", "ID")]
    public string MainUnit { get; set; }

    [ReferenceTo(typeof(Goods), "ShotPrintName")]
    [Join("Goods_ID", "ID")]
    public string ShotPrintName { get; set; }

    [ReferenceTo(typeof(Goods), "EachNumber")]
    [Join("Goods_ID", "ID")]
    public int? EachNumber { get; set; }

    [ReferenceTo(typeof(Goods), "CustomerDefine")]
    [Join("Goods_ID", "ID")]
    public string Goods_CustomerDefine { get; set; }

    [ReferenceTo(typeof(Goods), "Spell")]
    [Join("Goods_ID", "ID")]
    public string Goods_Spell { get; set; }

    public decimal? StandardWeight { get; set; }

    public decimal? StandardWeightUp { get; set; }

    public decimal? StandardWeightLow { get; set; }

    [DbColumn(DefaultValue = 0)]
    public bool StandardPic { get; set; }

    [DbColumn(DefaultValue = 0)]
    public bool NoTotalCode { get; set; }

    [NonDmoProperty]
    public bool Selected { get; set; }

    [NonDmoProperty]
    public IEnumerable<GoodsIdentify> Identify { get; set; }

    [NonDmoProperty]
    public GoodsIdentify SelectedIdentify { get; set; }
  }
}
