Ejemplo n.º 1
0
        /// <summary>
        /// 编辑三方码信息
        /// </summary>
        /// <param name="config"></param>
        /// <returns></returns>
        public Tuple <bool, string> UpsertCodeSourceConfig(ServiceCodeSourceConfig config)
        {
            var result = false;
            var msg    = string.Empty;

            try
            {
                dbScopeManager.CreateTransaction(conn =>
                {
                    if (config.PKID > 0)
                    {
                        result = DALThirdParty.UpdateServiceCodeSourceConfig(conn, config);
                    }
                    else
                    {
                        var allSourceConfigs = DALThirdParty.GetServiceCodeSourceConfigBySource(conn, config.Source);
                        if (allSourceConfigs != null && allSourceConfigs.Any())
                        {
                            msg = "服务码来源重复";
                        }
                        else
                        {
                            result = DALThirdParty.InsertServiceCodeSourceConfig(conn, config);
                        }
                    }
                });
            }
            catch (Exception ex)
            {
                msg = "服务异常";
                Logger.Error(ex);
            }
            return(Tuple.Create(result, msg));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取三方码配置信息
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public List <ServiceCodeSourceConfig> GetServiceCodeSourceConfig(int pageIndex, int pageSize)
        {
            List <ServiceCodeSourceConfig> result = null;

            try
            {
                result = dbScopeReadManager.Execute(conn => DALThirdParty.GetServiceCodeSourceConfig(conn, pageIndex, pageSize));
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
            return(result);
        }