/// <summary>
        /// 删除
        /// </summary>
        /// <param name="pc">pc</param>
        /// <returns>影响的记录行数</returns>
        public int DeleteMultiple(ParameterCollection pc)
        {
            int ret = 0;

            PayPosMachineInfoModel payposmachineinfo = new PayPosMachineInfoModel();

            ret = DbUtil.Current.DeleteMultiple(payposmachineinfo, pc);

            return(ret);
        }
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="payposmachineinfo">实体</param>
        /// <param name="pc">pc</param>
        /// <returns>影响的记录行数</returns>
        public int UpdateMultiple(PayPosMachineInfoModel payposmachineinfo, ParameterCollection pc)
        {
            int ret = 0;

            payposmachineinfo.ModifiedBy = SessionUtil.Current.UserId;
            payposmachineinfo.ModifiedOn = DateTime.Now;

            ret = DbUtil.Current.UpdateMultiple(payposmachineinfo, pc);

            return(ret);
        }
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="payposmachineinfo">实体</param>
        /// <returns>影响的记录行数</returns>
        public int Update(PayPosMachineInfoModel payposmachineinfo)
        {
            int ret = 0;

            payposmachineinfo.ModifiedBy = SessionUtil.Current.UserId;
            payposmachineinfo.ModifiedOn = DateTime.Now;

            ret = DbUtil.Current.Update(payposmachineinfo);

            return(ret);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="posmachineid"></param>
        /// <returns>影响的记录行数</returns>
        public int Delete(string posmachineid)
        {
            int ret = 0;

            PayPosMachineInfoModel payposmachineinfo = new PayPosMachineInfoModel();

            payposmachineinfo.PosMachineId = posmachineid;

            ret = DbUtil.Current.Delete(payposmachineinfo);

            return(ret);
        }
        /// <summary>
        /// 根据条件获取实体集合
        /// </summary>
        /// <param name="pc">pc</param>
        /// <param name="obc">obc</param>
        /// <returns>实体</returns>
        public List <PayPosMachineInfoModel> RetrieveMultiple(ParameterCollection pc, OrderByCollection obc)
        {
            List <PayPosMachineInfoModel> payposmachineinfos = new List <PayPosMachineInfoModel>();

            PayPosMachineInfoModel payposmachineinfo = new PayPosMachineInfoModel();
            DataTable dt = DbUtil.Current.RetrieveMultiple(payposmachineinfo, pc, obc);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                payposmachineinfo = new PayPosMachineInfoModel();
                payposmachineinfo.ConvertFrom(dt, i);
                payposmachineinfos.Add(payposmachineinfo);
            }

            return(payposmachineinfos);
        }
Exemplo n.º 6
0
        // 在此添加你的代码...

        public PayPosMachineInfoModel GetPosMachineById(string posMachineId, bool clear)
        {
            string cacheKey = CacheKey.POS_MACHINE_DATAMODEL.GetKeyDefine(posMachineId);

            PayPosMachineInfoModel model = CacheUtil.Get <PayPosMachineInfoModel>(cacheKey);

            if (model == null || clear)
            {
                model = Retrieve(posMachineId);
                if (model != null)
                {
                    CacheUtil.Set(cacheKey, model);
                }
            }

            return(model);
        }
        /// <summary>
        /// 根据主键获取实体
        /// </summary>
        /// <param name="posmachineid"></param>
        /// <returns>实体</returns>
        public PayPosMachineInfoModel Retrieve(string posmachineid)
        {
            PayPosMachineInfoModel payposmachineinfo = new PayPosMachineInfoModel();

            payposmachineinfo.PosMachineId = posmachineid;

            DataTable dt = DbUtil.Current.Retrieve(payposmachineinfo);

            if (dt.Rows.Count < 1)
            {
                return(null);
            }

            payposmachineinfo.ConvertFrom(dt);

            return(payposmachineinfo);
        }