Exemplo n.º 1
0
 public static IParkArea GetFactory()
 {
     if (factory == null)
     {
         Type type = Type.GetType("Common." + SystemDefaultConfig.DatabaseProvider + "Repository.ParkAreaDAL,Common." + SystemDefaultConfig.DatabaseProvider + "Repository", true);
         factory = (IParkArea)Activator.CreateInstance(type);
     }
     return(factory);
 }
Exemplo n.º 2
0
        public static List <ParkArea> GetTopParkAreaByParkingId(string parkingId)
        {
            if (string.IsNullOrWhiteSpace(parkingId))
            {
                throw new ArgumentNullException("parkingId");
            }

            IParkArea factory = ParkAreaFactory.GetFactory();

            return(factory.GetTopParkAreaByParkingId(parkingId));
        }
Exemplo n.º 3
0
        public static List <ParkArea> GetParkAreaByParkingIds(List <string> parkingIds)
        {
            if (parkingIds.Count == 0)
            {
                throw new ArgumentNullException("parkingIds");
            }

            IParkArea factory = ParkAreaFactory.GetFactory();

            return(factory.GetParkAreaByParkingIds(parkingIds));
        }
Exemplo n.º 4
0
        public static List <ParkArea> GetParkAreaByMasterId(string masterId)
        {
            if (string.IsNullOrWhiteSpace(masterId))
            {
                throw new ArgumentNullException("masterId");
            }

            IParkArea factory = ParkAreaFactory.GetFactory();

            return(factory.GetParkAreaByMasterId(masterId));
        }
Exemplo n.º 5
0
        public static List <ParkArea> GetParkAreaByParkBoxIps(List <string> ips)
        {
            if (ips.Count == 0)
            {
                throw new ArgumentNullException("ips");
            }

            IParkArea factory = ParkAreaFactory.GetFactory();

            return(factory.GetParkAreaByParkBoxIps(ips));
        }
Exemplo n.º 6
0
        public static ParkArea GetParkAreaByParkGateRecordId(string recordId)
        {
            if (string.IsNullOrWhiteSpace(recordId))
            {
                throw new ArgumentNullException("recordId");
            }

            IParkArea factory = ParkAreaFactory.GetFactory();

            return(factory.GetParkAreaByParkGateRecordId(recordId));
        }
Exemplo n.º 7
0
        public static List <BaseParkinfo> QueryPage(string villageId, int pageIndex, int pageSize, out int totalCount)
        {
            IParking            factory     = ParkingFactory.GetFactory();
            List <BaseParkinfo> parkings    = factory.QueryPage(villageId, pageIndex, pageSize, out totalCount);
            IParkArea           factoryArea = ParkAreaFactory.GetFactory();

            foreach (var item in parkings)
            {
                item.CarBitNum = factoryArea.GetCarBitNumByParkingId(item.PKID);
            }
            return(parkings);
        }
Exemplo n.º 8
0
        public static bool AddDefualt(ParkArea model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }
            IParkArea factory = ParkAreaFactory.GetFactory();
            bool      result  = factory.Add(model);

            if (result)
            {
                OperateLogServices.AddOperateLog <ParkArea>(model, OperateType.Add);
            }
            return(result);
        }
Exemplo n.º 9
0
        public static bool UpdateCarbitNum(string recordId, int carNum)
        {
            if (string.IsNullOrWhiteSpace(recordId))
            {
                throw new ArgumentNullException("recordId");
            }

            IParkArea factory = ParkAreaFactory.GetFactory();
            bool      result  = factory.UpdateCarbitNum(recordId, carNum);

            if (result)
            {
                OperateLogServices.AddOperateLog(OperateType.Update, string.Format("recordId:{0},CarbitNum:{1}", recordId, carNum));
            }
            return(result);
        }
Exemplo n.º 10
0
        public static bool Add(ParkArea model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            model.AreaID = GuidGenerator.GetGuid().ToString();
            IParkArea factory = ParkAreaFactory.GetFactory();
            bool      result  = factory.Add(model);

            if (result)
            {
                OperateLogServices.AddOperateLog <ParkArea>(model, OperateType.Add);
            }
            return(result);
        }
Exemplo n.º 11
0
        public static bool Delete(string recordId)
        {
            if (string.IsNullOrWhiteSpace(recordId))
            {
                throw new ArgumentNullException("recordId");
            }
            List <ParkBox> boxs = ParkBoxServices.QueryByParkAreaId(recordId);

            if (boxs.Count != 0)
            {
                throw new MyException("请先删除改区域下所有岗亭");
            }

            IParkArea factory = ParkAreaFactory.GetFactory();
            bool      result  = factory.Delete(recordId);

            if (result)
            {
                OperateLogServices.AddOperateLog(OperateType.Delete, string.Format("recordId:{0}", recordId));
            }
            return(result);
        }