Example #1
0
 public static IParkDerate GetFactory()
 {
     if (factory == null)
     {
         Type type = Type.GetType("Common." + SystemDefaultConfig.DatabaseProvider + "Repository.ParkDerateDAL,Common." + SystemDefaultConfig.DatabaseProvider + "Repository", true);
         factory = (IParkDerate)Activator.CreateInstance(type);
     }
     return(factory);
 }
Example #2
0
        public static List <ParkDerate> QueryBySellerID(string sellerId)
        {
            if (sellerId.IsEmpty())
            {
                throw new ArgumentNullException("sellerId");
            }

            IParkDerate factory = ParkDerateFactory.GetFactory();

            return(factory.QueryBySellerID(sellerId));
        }
Example #3
0
        public static List <ParkDerateIntervar> QueryParkDerateIntervar(string derateId)
        {
            if (derateId.IsEmpty())
            {
                throw new ArgumentNullException("derateId");
            }

            IParkDerate factory = ParkDerateFactory.GetFactory();

            return(factory.QueryParkDerateIntervar(derateId));
        }
Example #4
0
        public static bool DeleteBySellerID(string sellerId)
        {
            if (sellerId.IsEmpty())
            {
                throw new ArgumentNullException("sellerId");
            }

            IParkDerate factory = ParkDerateFactory.GetFactory();
            bool        result  = factory.DeleteBySellerID(sellerId);

            if (result)
            {
                OperateLogServices.AddOperateLog(OperateType.Delete, string.Format("sellerId:{0}", sellerId));
            }
            return(result);
        }
Example #5
0
        public static bool Update(ParkDerate model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            if (model.DerateIntervar != null && model.DerateIntervar.Count > 0)
            {
                model.DerateIntervar.ForEach(p => { p.DerateIntervarID = GuidGenerator.GetGuidString(); p.DerateID = model.DerateID; });
            }
            IParkDerate factory = ParkDerateFactory.GetFactory();
            bool        result  = factory.Update(model);

            if (result)
            {
                OperateLogServices.AddOperateLog <ParkDerate>(model, OperateType.Update);
            }
            return(result);
        }