using System;
using System.Collections.Generic;
using System.Text;
using ChuPiao.Common.Communication.GtdJson.Items;

namespace ChuPiao.Common.Communication.GtdJson.Packs
{
    public class A10007UploadMachinePay : PackBase
    {
        public override string Action
        {
            get { return "uploadPayment"; }
        }

        public override void PackBody(Newtonsoft.Json.JsonWriter jsonWriter)
        {
            jsonWriter.WritePropertyName("paymentList");
            jsonWriter.WriteStartArray();
            foreach (UploadMachinePayItem item in PaymentList)
            {
                jsonWriter.WriteStartObject();

                jsonWriter.WritePropertyName("paymoney");
                jsonWriter.WriteValue(item.PayMoney);

                jsonWriter.WritePropertyName("paytime");
                jsonWriter.WriteValue(item.PayTime.ToString("yyyyMMddHHmmss"));

                jsonWriter.WritePropertyName("btype");
                jsonWriter.WriteValue(item.Btype);

                jsonWriter.WritePropertyName("payfee");
                jsonWriter.WriteValue(item.PayFee);

                jsonWriter.WriteEndObject();
            }
            jsonWriter.WriteEndArray();

            jsonWriter.WritePropertyName("querytime");
            jsonWriter.WriteValue(QueryTime.ToString("yyyyMMddHHmmss"));
        }

        private List<UploadMachinePayItem> _paymentlist = new List<UploadMachinePayItem>();
        public List<UploadMachinePayItem> PaymentList
        {
            get { return _paymentlist; }
            set { _paymentlist = value; }
        }

        private DateTime _querytime;
        public DateTime QueryTime
        {
            get { return _querytime; }
            set { _querytime = value; }
        }
    }
}
