/// <summary>
        /// Insert into XMGiftStorageRecord
        /// </summary>
        /// <param name="xmgiftstoragerecord">XMGiftStorageRecord</param>
        public void InsertXMGiftStorageRecord(XMGiftStorageRecord xmgiftstoragerecord)
        {
            if (xmgiftstoragerecord == null)
            {
                return;
            }

            if (!this._context.IsAttached(xmgiftstoragerecord))
            {
                this._context.XMGiftStorageRecords.AddObject(xmgiftstoragerecord);
            }

            this._context.SaveChanges();
        }
        /// <summary>
        /// Update into XMGiftStorageRecord
        /// </summary>
        /// <param name="xmgiftstoragerecord">XMGiftStorageRecord</param>
        public void UpdateXMGiftStorageRecord(XMGiftStorageRecord xmgiftstoragerecord)
        {
            if (xmgiftstoragerecord == null)
            {
                return;
            }

            if (this._context.IsAttached(xmgiftstoragerecord))
            {
                this._context.XMGiftStorageRecords.Attach(xmgiftstoragerecord);
            }

            this._context.SaveChanges();
        }
        public List <XMGiftStorageRecord> GetXMGiftStorageRecordListByParm()
        {
            string batch = DateTime.Now.ToString("yyMMddHHmmss");
            var    query = from p in this._context.XMProducts
                           where p.IsEnable == false &&
                           p.IsPremiums == true
                           select p;
            List <XMGiftStorageRecord> list = new List <XMGiftStorageRecord>();

            foreach (XMProduct p in query.ToList())
            {
                XMGiftStorageRecord one = new XMGiftStorageRecord();
                one.ProductId = p.Id;
                one.Batch     = batch;
                list.Add(one);
            }
            return(list);
        }