using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TZONE.Model
{

    /// <summary>
    /// Commissioned by the temporary data
    /// </summary>
    public delegate void TempDataHandler(tempdata _temp);//delegate

    [Serializable]
    public class tempdata : ICloneable
    {
        /// <summary>
        /// Temporary data processing events
        /// </summary>
        public event TempDataHandler EventTempData;

        /// <summary>
        /// Product id
        /// </summary>
        public int PID { get; set; }

        /// <summary>
        /// Product IMEI identifies the
        /// </summary>
        public string imei { get; set; }

        /// <summary>
        /// Data arrives at the server time
        /// </summary>
        public string server_time { get; set; }

        /// <summary>
        /// Original upload data
        /// </summary>
        public string message { get; set; }

        /// <summary>
        /// model
        /// </summary>
        public string product_model { get; set; }

        /// <summary>
        /// type id
        /// </summary>
        public int type_id { get; set; }

        /// <summary>
        /// is active
        /// </summary>
        public bool isactive { get; set; }

        /// <summary>
        /// Whether or not to record the raw data to the database (0: no, 1: yes)
        /// </summary>
        public int isoriginal { get; set; }

        /// <summary>
        /// 原始数据
        /// </summary>
        public byte[] data_body { get; set; }

        /// <summary>
        /// execute event
        /// </summary>
        public void ExecuteEvent()
        {
            EventTempData(this);
        }


        #region ICloneable
        public object Clone()
        {
            return this.MemberwiseClone();
        }
        #endregion
    }
}
