Ejemplo n.º 1
0
        public static bool ModifyChargingBase(ChargingBaseEntity entity)
        {
            int result = 0;

            if (entity != null)
            {
                ChargeRepository mr = new ChargeRepository();

                ChargingBaseInfo info = TranslateChargingBaseEntity(entity);


                if (entity.ChargeBaseID > 0)
                {
                    result = mr.ModifyChargingBase(info);
                }
                else
                {
                    info.CreateDate = DateTime.Now;
                    result          = mr.CreateNewChargingBase(info);
                }

                List <ChargingBaseInfo> miList = mr.GetAllChargingBaseInfo();//刷新缓存
                Cache.Add("ChargingBaseALL", miList);
            }
            return(result > 0);
        }