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); }
public static List <ParkDerate> QueryBySellerID(string sellerId) { if (sellerId.IsEmpty()) { throw new ArgumentNullException("sellerId"); } IParkDerate factory = ParkDerateFactory.GetFactory(); return(factory.QueryBySellerID(sellerId)); }
public static List <ParkDerateIntervar> QueryParkDerateIntervar(string derateId) { if (derateId.IsEmpty()) { throw new ArgumentNullException("derateId"); } IParkDerate factory = ParkDerateFactory.GetFactory(); return(factory.QueryParkDerateIntervar(derateId)); }
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); }
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); }