using RDH.Data.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace RDH.Data.BLL
{
    public partial class ItemTransactionBLL : BaseOrclBLL<ItemTransaction>
    {
        public ItemTransactionBLL() : base()
        {
            AliasTableName = "itr";
        }

        internal override String TABLE_NAME { get { return "ITEM_TRANSACTION"; } }//TB_NAME
        internal override string ENTITY_NAME { get { return "ItemTransaction"; } }
        internal override String KEY_COLUMN { get { return "KEY"; } }//KEY_COLUMN

        internal override void InitMaps()
        {
            ColumnPropMaps.Add("KEY", "Key");
            ColumnPropMaps.Add("ITEM_KEY", "ItemKey");
            ColumnPropMaps.Add("CREATE_BY", "CreateBy");
            ColumnPropMaps.Add("CREATE_TIME", "CreateTime");
            ColumnPropMaps.Add("QUANTITY", "Quantity");
            ColumnPropMaps.Add("TRANSACTION_TYPE", "TransactionType");
            ColumnPropMaps.Add("WITNESS_USER_KEY", "WitnessUserKey");
            ColumnPropMaps.Add("USE_UNIT_CODE", "UseUnitCode");
            ColumnPropMaps.Add("FLAG", "Flag");
            ColumnPropMaps.Add("CLIENT_TIME", "ClientTime");
            ColumnPropMaps.Add("SERVER_TIME", "ServerTime");
            ColumnPropMaps.Add("EXT01", "Ext01");
            ColumnPropMaps.Add("EXT02", "Ext02");
            ColumnPropMaps.Add("EXT03", "Ext03");
            ColumnPropMaps.Add("EXT04", "Ext04");
            ColumnPropMaps.Add("EXT05", "Ext05");
            ColumnPropMaps.Add("EXT06", "Ext06");
            ColumnPropMaps.Add("EXT07", "Ext07");
            ColumnPropMaps.Add("EXT08", "Ext08");
            ColumnPropMaps.Add("EXT09", "Ext09");
            ColumnPropMaps.Add("EXT10", "Ext10");
            ColumnPropMaps.Add("DEVICE_KEY", "DeviceKey");
            ColumnPropMaps.Add("ITEM_SNAPSHOT_KEY", "ItemSnapshotKey");
            ColumnPropMaps.Add("PLAN_KEY", "PlanKey");//COLUMN_MAPS
        }

        internal override object GetParam(ItemTransaction itemtransaction)
        {
            return new
            {
                Key = itemtransaction.Key,
                ItemKey = itemtransaction.ItemKey,
                CreateBy = itemtransaction.CreateBy,
                CreateTime = itemtransaction.CreateTime,
                Quantity = itemtransaction.Quantity,
                TransactionType = itemtransaction.TransactionType,
                WitnessUserKey = itemtransaction.WitnessUserKey,
                UseUnitCode = itemtransaction.UseUnitCode,
                Flag = itemtransaction.Flag,
                ClientTime = itemtransaction.ClientTime,
                ServerTime = itemtransaction.ServerTime,
                Ext01 = itemtransaction.Ext01,
                Ext02 = itemtransaction.Ext02,
                Ext03 = itemtransaction.Ext03,
                Ext04 = itemtransaction.Ext04,
                Ext05 = itemtransaction.Ext05,
                Ext06 = itemtransaction.Ext06,
                Ext07 = itemtransaction.Ext07,
                Ext08 = itemtransaction.Ext08,
                Ext09 = itemtransaction.Ext09,
                Ext10 = itemtransaction.Ext10,
                DeviceKey = itemtransaction.DeviceKey,
                ItemSnapshotKey = itemtransaction.ItemSnapshotKey,
                PlanKey = itemtransaction.PlanKey,   //Params
            };
        }
    }
}
