/// <summary>
        /// 装载实体
        /// </summary>
        /// <param name="pReader">向前只读器</param>
        /// <param name="pInstance">实体实例</param>
        protected void Load(IDataReader pReader, out VipServicesLogEntity pInstance)
        {
            //将所有的数据从SqlDataReader中读取到Entity中
            pInstance = new VipServicesLogEntity();
            pInstance.PersistenceHandle = new PersistenceHandle();
            pInstance.PersistenceHandle.Load();

            if (pReader["ServicesLogID"] != DBNull.Value)
            {
                pInstance.ServicesLogID = (Guid)pReader["ServicesLogID"];
            }
            if (pReader["VipID"] != DBNull.Value)
            {
                pInstance.VipID = Convert.ToString(pReader["VipID"]);
            }
            if (pReader["ServicesTime"] != DBNull.Value)
            {
                pInstance.ServicesTime = Convert.ToDateTime(pReader["ServicesTime"]);
            }
            if (pReader["ServicesMode"] != DBNull.Value)
            {
                pInstance.ServicesMode = Convert.ToString(pReader["ServicesMode"]);
            }
            if (pReader["UnitID"] != DBNull.Value)
            {
                pInstance.UnitID = Convert.ToString(pReader["UnitID"]);
                var unitDao  = new TUnitDAO(this.CurrentUserInfo);
                var unitInfo = unitDao.GetByID(pInstance.UnitID);
                if (unitInfo != null)
                {
                    pInstance.UnitName = unitInfo.UnitName;
                }
            }
            if (pReader["UserID"] != DBNull.Value)
            {
                pInstance.UserID = Convert.ToString(pReader["UserID"]);
                var userDao  = new T_UserDAO(this.CurrentUserInfo);
                var userInfo = userDao.GetByID(pInstance.UserID);
                if (userInfo != null)
                {
                    pInstance.UserName = userInfo.user_name;
                }
            }
            if (pReader["ServicesType"] != DBNull.Value)
            {
                pInstance.ServicesType = Convert.ToInt32(pReader["ServicesType"]);
            }
            else
            {
                pInstance.ServicesType = 0;
            }
            if (pReader["Duration"] != DBNull.Value)
            {
                pInstance.Duration = Convert.ToString(pReader["Duration"]);
            }
            if (pReader["Content"] != DBNull.Value)
            {
                pInstance.Content = Convert.ToString(pReader["Content"]);
            }
            if (pReader["CustomerID"] != DBNull.Value)
            {
                pInstance.CustomerID = Convert.ToString(pReader["CustomerID"]);
            }
            if (pReader["CreateTime"] != DBNull.Value)
            {
                pInstance.CreateTime = Convert.ToDateTime(pReader["CreateTime"]);
            }
            if (pReader["CreateBy"] != DBNull.Value)
            {
                pInstance.CreateBy = Convert.ToString(pReader["CreateBy"]);
            }
            if (pReader["LastUpdateTime"] != DBNull.Value)
            {
                pInstance.LastUpdateTime = Convert.ToDateTime(pReader["LastUpdateTime"]);
            }
            if (pReader["LastUpdateBy"] != DBNull.Value)
            {
                pInstance.LastUpdateBy = Convert.ToString(pReader["LastUpdateBy"]);
            }
            if (pReader["IsDelete"] != DBNull.Value)
            {
                pInstance.IsDelete = Convert.ToInt32(pReader["IsDelete"]);
            }
        }
Exemple #2
0
        /// <summary>
        /// 装载实体
        /// </summary>
        /// <param name="pReader">向前只读器</param>
        /// <param name="pInstance">实体实例</param>
        protected void Load(IDataReader pReader, out VipAmountDetailEntity pInstance)
        {
            //将所有的数据从SqlDataReader中读取到Entity中
            pInstance = new VipAmountDetailEntity();
            pInstance.PersistenceHandle = new PersistenceHandle();
            pInstance.PersistenceHandle.Load();

            if (pReader["VipAmountDetailId"] != DBNull.Value)
            {
                pInstance.VipAmountDetailId = (Guid)pReader["VipAmountDetailId"];
            }
            if (pReader["VipId"] != DBNull.Value)
            {
                pInstance.VipId = Convert.ToString(pReader["VipId"]);
            }
            if (pReader["VipCardCode"] != DBNull.Value)
            {
                pInstance.VipCardCode = Convert.ToString(pReader["VipCardCode"]);
            }
            if (pReader["UnitID"] != DBNull.Value)
            {
                pInstance.UnitID = Convert.ToString(pReader["UnitID"]);
            }
            if (pReader["UnitName"] != DBNull.Value)
            {
                pInstance.UnitName = Convert.ToString(pReader["UnitName"]);
            }
            if (pReader["SalesAmount"] != DBNull.Value)
            {
                pInstance.SalesAmount = Convert.ToDecimal(pReader["SalesAmount"]);
            }
            if (pReader["Amount"] != DBNull.Value)
            {
                pInstance.Amount = Convert.ToDecimal(pReader["Amount"]);
            }
            if (pReader["UsedReturnAmount"] != DBNull.Value)
            {
                pInstance.UsedReturnAmount = Convert.ToDecimal(pReader["UsedReturnAmount"]);
            }
            if (pReader["Reason"] != DBNull.Value)
            {
                pInstance.Reason = Convert.ToString(pReader["Reason"]);
            }
            if (pReader["EffectiveDate"] != DBNull.Value)
            {
                pInstance.EffectiveDate = Convert.ToDateTime(pReader["EffectiveDate"]);
            }
            if (pReader["DeadlineDate"] != DBNull.Value)
            {
                pInstance.DeadlineDate = Convert.ToDateTime(pReader["DeadlineDate"]);
            }
            if (pReader["AmountSourceId"] != DBNull.Value)
            {
                pInstance.AmountSourceId = Convert.ToString(pReader["AmountSourceId"]);
            }
            if (pReader["ObjectId"] != DBNull.Value)
            {
                pInstance.ObjectId = Convert.ToString(pReader["ObjectId"]);
            }
            if (pReader["Remark"] != DBNull.Value)
            {
                pInstance.Remark = Convert.ToString(pReader["Remark"]);
            }
            if (pReader["IsValid"] != DBNull.Value)
            {
                pInstance.IsValid = Convert.ToInt32(pReader["IsValid"]);
            }
            if (pReader["IsWithdrawCash"] != DBNull.Value)
            {
                pInstance.IsWithdrawCash = Convert.ToInt32(pReader["IsWithdrawCash"]);
            }
            if (pReader["CustomerID"] != DBNull.Value)
            {
                pInstance.CustomerID = Convert.ToString(pReader["CustomerID"]);
            }
            if (pReader["CreateTime"] != DBNull.Value)
            {
                pInstance.CreateTime = Convert.ToDateTime(pReader["CreateTime"]);
            }
            if (pReader["CreateBy"] != DBNull.Value)
            {
                pInstance.CreateBy = Convert.ToString(pReader["CreateBy"]);
                if (pInstance.AmountSourceId == "23" || pInstance.AmountSourceId == "24")
                {
                    var userDao  = new T_UserDAO(CurrentUserInfo);
                    var userInfo = userDao.GetByID(pInstance.CreateBy);
                    pInstance.CreateByName = userInfo != null ? userInfo.user_name : "";
                }
            }
            if (pReader["LastUpdateTime"] != DBNull.Value)
            {
                pInstance.LastUpdateTime = Convert.ToDateTime(pReader["LastUpdateTime"]);
            }
            if (pReader["LastUpdateBy"] != DBNull.Value)
            {
                pInstance.LastUpdateBy = Convert.ToString(pReader["LastUpdateBy"]);
            }
            if (pReader["IsDelete"] != DBNull.Value)
            {
                pInstance.IsDelete = Convert.ToInt32(pReader["IsDelete"]);
            }
        }
        /// <summary>
        /// 装载实体
        /// </summary>
        /// <param name="pReader">向前只读器</param>
        /// <param name="pInstance">实体实例</param>
        protected void Load(IDataReader pReader, out VipCardStatusChangeLogEntity pInstance)
        {
            //将所有的数据从SqlDataReader中读取到Entity中
            pInstance = new VipCardStatusChangeLogEntity();
            pInstance.PersistenceHandle = new PersistenceHandle();
            pInstance.PersistenceHandle.Load();

            if (pReader["LogID"] != DBNull.Value)
            {
                pInstance.LogID = Convert.ToString(pReader["LogID"]);
            }
            if (pReader["VipCardID"] != DBNull.Value)
            {
                pInstance.VipCardID = Convert.ToString(pReader["VipCardID"]);
            }
            if (pReader["VipCardStatusID"] != DBNull.Value)
            {
                pInstance.VipCardStatusID = Convert.ToInt32(pReader["VipCardStatusID"]);
            }
            if (pReader["UnitID"] != DBNull.Value)
            {
                pInstance.UnitID = Convert.ToString(pReader["UnitID"]);
                t_unitEntity unitData = new t_unitDAO(CurrentUserInfo).GetByID(pInstance.UnitID);
                pInstance.UnitName = unitData == null ? "" : unitData.unit_name;
            }
            if (pReader["Action"] != DBNull.Value)
            {
                pInstance.Action = Convert.ToString(pReader["Action"]);
            }
            if (pReader["Reason"] != DBNull.Value)
            {
                pInstance.Reason = Convert.ToString(pReader["Reason"]);
            }
            if (pReader["PicUrl"] != DBNull.Value)
            {
                pInstance.PicUrl = Convert.ToString(pReader["PicUrl"]);
            }
            if (pReader["OldStatusID"] != DBNull.Value)
            {
                pInstance.OldStatusID = Convert.ToInt32(pReader["OldStatusID"]);
            }
            if (pReader["Remark"] != DBNull.Value)
            {
                pInstance.Remark = Convert.ToString(pReader["Remark"]);
            }
            if (pReader["CreateTime"] != DBNull.Value)
            {
                pInstance.CreateTime = Convert.ToDateTime(pReader["CreateTime"]);
            }
            if (pReader["CreateBy"] != DBNull.Value)
            {
                pInstance.CreateBy = Convert.ToString(pReader["CreateBy"]);
                //员工名称赋值
                T_UserEntity UserData = new T_UserDAO(CurrentUserInfo).GetByID(pInstance.CreateBy);
                pInstance.CreateByName = UserData == null ? "" : UserData.user_name;
            }
            if (pReader["LastUpdateTime"] != DBNull.Value)
            {
                pInstance.LastUpdateTime = Convert.ToDateTime(pReader["LastUpdateTime"]);
            }
            if (pReader["LastUpdateBy"] != DBNull.Value)
            {
                pInstance.LastUpdateBy = Convert.ToString(pReader["LastUpdateBy"]);
            }
            if (pReader["IsDelete"] != DBNull.Value)
            {
                pInstance.IsDelete = Convert.ToInt32(pReader["IsDelete"]);
            }
            if (pReader["CustomerID"] != DBNull.Value)
            {
                pInstance.CustomerID = Convert.ToString(pReader["CustomerID"]);
            }
        }