예제 #1
0
        public static string GetConfigValue(string companyId, ConfigType type)
        {
            IWXOtherConfig factory = WXOtherConfigFactory.GetFactory();
            WX_OtherConfig config  = factory.QueryByConfigType(companyId, type);

            if (config == null || string.IsNullOrWhiteSpace(config.ConfigValue))
            {
                return(string.Empty);
            }

            return(config.ConfigValue);
        }
예제 #2
0
        public static int GetTempParkingWeiXinPayTimeOut(string companyId)
        {
            IWXOtherConfig factory = WXOtherConfigFactory.GetFactory();
            WX_OtherConfig config  = factory.QueryByConfigType(companyId, ConfigType.TempParkingWeiXinPayTimeOut);

            if (config == null || string.IsNullOrWhiteSpace(config.ConfigValue))
            {
                return(int.Parse(ConfigType.TempParkingWeiXinPayTimeOut.GetEnumDefaultValue()));
            }
            int time;

            if (int.TryParse(config.ConfigValue, out time))
            {
                return(time);
            }
            return(int.Parse(ConfigType.TempParkingWeiXinPayTimeOut.GetEnumDefaultValue()));
        }
예제 #3
0
        public static bool AddOrUpdate(WX_OtherConfig model)
        {
            IWXOtherConfig factory  = WXOtherConfigFactory.GetFactory();
            WX_OtherConfig dbConfig = factory.QueryByConfigType(model.CompanyID, model.ConfigType);

            if (dbConfig != null)
            {
                bool result = factory.Update(model);
                if (result)
                {
                    OperateLogServices.AddOperateLog <WX_OtherConfig>(model, OperateType.Update);
                }
                return(result);
            }
            bool addResult = factory.Create(model);

            if (addResult)
            {
                OperateLogServices.AddOperateLog <WX_OtherConfig>(model, OperateType.Add);
            }
            return(addResult);
        }
예제 #4
0
        public static List <WX_OtherConfig> QueryAll(string companyId)
        {
            IWXOtherConfig factory = WXOtherConfigFactory.GetFactory();

            return(factory.QueryAll(companyId));
        }
예제 #5
0
        public static WX_OtherConfig QueryByConfigType(string companyId, ConfigType type)
        {
            IWXOtherConfig factory = WXOtherConfigFactory.GetFactory();

            return(factory.QueryByConfigType(companyId, type));
        }