Exemplo n.º 1
0
        public static bool Add(ParkDerateConfig model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            model.RecordID = GuidGenerator.GetGuidString();
            IParkDerateConfig       factory = ParkDerateConfigFactory.GetFactory();
            List <ParkDerateConfig> configs = factory.QueryByParkingId(model.PKID);

            configs = configs.Where(p => (p.ConsumeStartAmount <= model.ConsumeStartAmount && p.ConsumeEndAmount >= model.ConsumeStartAmount) ||
                                    (p.ConsumeStartAmount <= model.ConsumeEndAmount && p.ConsumeEndAmount >= model.ConsumeEndAmount)).ToList();
            if (configs.Count > 0)
            {
                throw new MyException("消费金额重复");
            }
            bool result = factory.Add(model);

            if (result)
            {
                OperateLogServices.AddOperateLog <ParkDerateConfig>(model, OperateType.Add);
            }
            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据车场编号和消费金额获优免配置信息
        /// </summary>
        /// <param name="parkingId">车场编号</param>
        /// <param name="amount">消费金额</param>
        /// <returns></returns>
        public static ParkDerateConfig QueryByParkingIdAndAmount(string parkingId, decimal amount)
        {
            IParkDerateConfig factory = ParkDerateConfigFactory.GetFactory();

            return(factory.QueryByParkingIdAndAmount(parkingId, amount));
        }
Exemplo n.º 3
0
        public static List <ParkDerateConfig> QueryByParkingId(string parkingId)
        {
            IParkDerateConfig factory = ParkDerateConfigFactory.GetFactory();

            return(factory.QueryByParkingId(parkingId));
        }
Exemplo n.º 4
0
        public static ParkDerateConfig QueryByRecordId(string recordId)
        {
            IParkDerateConfig factory = ParkDerateConfigFactory.GetFactory();

            return(factory.QueryByRecordId(recordId));
        }
Exemplo n.º 5
0
        public static bool Delete(string recordId)
        {
            IParkDerateConfig factory = ParkDerateConfigFactory.GetFactory();

            return(factory.Delete(recordId));
        }