public static void ConfigureServices(IServiceCollection services, IConfiguration configuration)
        {
            services.AddScoped(typeof(IUnitOfWork), typeof(UnitOfWork));
            //services
            services.AddTransient(typeof(AddressService));
            services.AddTransient(typeof(BrandService));
            services.AddTransient(typeof(CategoryService));
            services.AddTransient(typeof(CharacteristicService));
            services.AddTransient(typeof(IDeliveryService), typeof(DeliveryService));
            services.AddTransient(typeof(ProductCharacteristicService));
            services.AddTransient(typeof(ImageService));
            services.AddTransient(typeof(OrderService));
            services.AddTransient(typeof(OrderDetailsService));
            services.AddTransient(typeof(PackageService));
            services.AddTransient(typeof(ProductService));
            services.AddTransient(typeof(ImportExportService));
            services.AddTransient(typeof(CommentService));
            services.AddTransient(typeof(UserService));
            services.AddTransient(typeof(LikeService));
            services.AddTransient(typeof(NewsSenderService));
            //services.AddTransient(typeof(NewsSaveService));
            services.AddTransient <ImageFileService>(service => new ImageFileService($"{ Directory.GetCurrentDirectory()}\\wwwroot\\Content\\Images\\"));



            DataAccessConfiguration.ConfigureServices(services, configuration);
        }
Beispiel #2
0
 public Tester(DataAccessConfiguration config)
 {
     _artistDataAccess   = new ArtistDataAccess(config);
     _albumArtDataAccess = new AlbumArtDataAccess(config);
     _albumDataAccess    = new AlbumDataAccess(config);
     _trackDataAccess    = new AlbumTrackDataAccess(config);
 }
    public static void RegisterConfiguration(IMutableDependencyResolver services, IReadonlyDependencyResolver resolver,
                                             DataAccessConfiguration dataAccessConfig)
    {
        var configuration = BuildConfiguration();

        RegisterAboutDialogConfiguration(services, configuration);
        RegisterDatabaseConfiguration(services, resolver, configuration, dataAccessConfig);
        RegisterFileSystemWatcherConfiguration(services, configuration);
        RegisterImagePreviewConfiguration(services, configuration);
        RegisterTabConfiguration(services, configuration);
        RegisterTabsListConfiguration(services, configuration);
        RegisterSearchViewModelConfiguration(services, configuration);
        RegisterDriveServiceConfiguration(services, configuration);
        RegisterUnmountedDrivesConfiguration(services, configuration);
        RegisterLoggingConfiguration(services, configuration);
        RegisterArchiveTypeMapperConfiguration(services, configuration);
        RegisterArchiveTypeViewModelFactoryConfiguration(services, configuration);
        RegisterOperationsStatesConfiguration(services, configuration);
        RegisterOpenWithDialogConfiguration(services, configuration);
        RegisterUtiToExtensionsMappingConfiguration(services, configuration);
        RegisterDefaultThemeConfiguration(services, configuration);
        RegisterThemesNamesConfiguration(services, configuration);
        RegisterLanguagesConfiguration(services, configuration);
        RegisterSuggestionsConfiguration(services, configuration);
        RegisterFileTypeMapperConfiguration(services, configuration);
    }
Beispiel #4
0
        public static void ConfigureServices(IServiceCollection services, IConfiguration configuration)
        {
            services.AddTransient(typeof(MapperConfig));
            services.AddTransient(typeof(CatService));
            services.AddTransient(typeof(DogService));

            DataAccessConfiguration.ConfigureServices(services, configuration);
        }
Beispiel #5
0
        public void DataAccessConfiguration_ConstructorParametersNotNullReturnsDataAccessConfiguration(string fakeFileName)
        {
            var fakeUnityContainer = NSubstitute.Substitute.For <IUnityContainer>();

            var dataAccessConfiguration = new DataAccessConfiguration(fakeUnityContainer, fakeFileName);

            Assert.NotNull(dataAccessConfiguration);
        }
Beispiel #6
0
        public static void Configure(IServiceCollection services)
        {
            DataAccessConfiguration.Configure(services);

            services.AddTransient <IStoreBusinessLogic, StoreBusinessLogic>();
            services.AddTransient <IDomainBusinessLogic, DomainBusinessLogic>();
            services.AddTransient <IServiceBusinessLogic, ServiceBusinessLogic>();
            services.AddTransient <IHitsBusinessLogic, HitsBusinessLogic>();
        }
Beispiel #7
0
        public static void ConfigureServices(IServiceCollection services, string connectionString)
        {
            AutoMapperConfig.ConfigureServices(services);
            DataAccessConfiguration.ConfigureServices(services, connectionString);

            services.AddTransient <IAccountService, AccountService>();
            services.AddTransient <ITransactionService, TransactionService>();
            services.AddTransient <IUtilityService, UtilityService>();
        }
Beispiel #8
0
    public static void RegisterDependencies()
    {
        var config = new DataAccessConfiguration
        {
            UseInMemoryDatabase = true
        };

        Bootstrapper.Register(Locator.CurrentMutable, Locator.Current, config);
    }
        public static void ConfigureServices(IServiceCollection services, IConfiguration configuration)
        {
            //services
            services.AddTransient(typeof(TaskService));
            services.AddTransient(typeof(UserService));
            services.AddTransient(typeof(CommentService));
            services.AddTransient <ITokenService, TokenService>();

            DataAccessConfiguration.ConfigureServices(services, configuration);
        }
Beispiel #10
0
        public AlbumArtDataAccess(DataAccessConfiguration config)
        {
            _connectionString = config.ConnectionString;
            _fileStore        = Path.Combine(config.FileStoreFolderPath.Trim('\\', '/'), "AlbumArt");

            if (!Directory.Exists(_fileStore))
            {
                Directory.CreateDirectory(_fileStore);
            }
        }
Beispiel #11
0
        public static IServiceProvider Configure()
        {
            var serviceCollection = new ServiceCollection();

            // can be added any standard dependencies
            serviceCollection.AddLogging();
            serviceCollection.AddAutoMapper(c => c.AddProfile(typeof(EntityMapper)));
            DataAccessConfiguration.Configure(serviceCollection);
            CheckoutConfiguration.Configure(serviceCollection);

            return(serviceCollection.BuildServiceProvider());
        }
        private void ValidateRequest(DataAccessRequest dataAccessRequest, DataAccessConfiguration dataAccessConfiguration)
        {
            if (null == dataAccessRequest)
            {
                throw new DataAccessRequestException("Data Access Request object is null");
            }

            if (null == dataAccessConfiguration)
            {
                throw new DataAccessConfigurationException("Data Access Configuration object is null");
            }
        }
Beispiel #13
0
 public static void Register(IMutableDependencyResolver services, IReadonlyDependencyResolver resolver,
                             DataAccessConfiguration dataAccessConfig)
 {
     EnvironmentServicesBootstrapper.RegisterEnvironmentServices(services, resolver);
     ConfigurationBootstrapper.RegisterConfiguration(services, resolver, dataAccessConfig);
     LoggingBootstrapper.RegisterLogging(services, resolver);
     AvaloniaServicesBootstrapper.RegisterAvaloniaServices(services);
     FileSystemWatcherServicesBootstrapper.RegisterFileSystemWatcherServices(services, resolver);
     DataAccessBootstrapper.RegisterDataAccess(services, resolver);
     ServicesBootstrapper.RegisterServices(services, resolver);
     ViewModelsBootstrapper.RegisterViewModels(services, resolver);
 }
Beispiel #14
0
        public void MainCode()
        {
            var dataAccessConfiguration          = new DataAccessConfiguration();
            IDataAccessService dataAccessService = DataAccessSQLite.GetService(dataAccessConfiguration);
            IItemRepository    itemRepository    = new ItemRepository(dataAccessService);

            ItemRepository = itemRepository;

            dataAccessService.Init();
            ItemRepository.Init();

            Run();
        }
Beispiel #15
0
        public void DataAccessConfiguration_ConfigureBadFileNamesNotAddParsersToContainer(string fakeFileName)
        {
            var fakeUnityContainer = new UnityContainer();

            var dataAccessConfiguration = new DataAccessConfiguration(fakeUnityContainer, fakeFileName);

            dataAccessConfiguration.Configure();

            var numberOfRegistration = fakeUnityContainer.Registrations.Where(x => x.RegisteredType == typeof(IDateParser)).Count();

            var expectedNumberOfRegistrations = 0;

            Assert.Equal(expectedNumberOfRegistrations, numberOfRegistration);
        }
Beispiel #16
0
        public void DataAccessConfiguration_ConfigureRightFileNamesAddDataAccessToContainer(string fakeFileName)
        {
            var fakeUnityContainer = new UnityContainer();

            var dataAccessConfiguration = new DataAccessConfiguration(fakeUnityContainer, fakeFileName);

            dataAccessConfiguration.Configure();

            var numberOfRegistration = fakeUnityContainer.Registrations.Where(x => x.RegisteredType == typeof(ICommonDataAccess)).Count();

            var expectedNumberOfRegistrations = 1;

            Assert.Equal(expectedNumberOfRegistrations, numberOfRegistration);
        }
Beispiel #17
0
        public static void ConfigureServices(IServiceCollection services, IConfiguration configuration)
        {
            DataAccessConfiguration.ConfigureServices(services, configuration);
            RazorConfiguration.ConfigureServices(services, configuration);

            services.AddTransient <IUserService, UserService>();
            services.AddTransient <IRequestService, RequestService>();
            services.AddScoped <IStatisticService, StatisticService>();
            services.AddMediatR(Assembly.GetExecutingAssembly());
            services.AddTransient <IReviewService, ReviewService>();
            services.AddSingleton <IEmailService, EmailService>();
            services.Configure <SmtpSettings>(opt => configuration.GetSection("SmtpSettings").Bind(opt));
            services.AddTransient <IRazorViewToStringRenderer, RazorViewToStringRenderer>();
            services.Configure <UrlConfig>(opt => configuration.GetSection("UIConfig").Bind(opt));
        }
Beispiel #18
0
        public async Task TestCRUD()
        {
            var config = new DataAccessConfiguration {
                ConnectionString = "DataSource=temp.db; Version=3;"
            };
            ISQLiteClient client = new SQLiteClient(config);

            await TestInsert(client);
            await TestGet(client);
            await TestGet(client, 1);
            await TestGet(client, 2);
            await TestUpdate(client);

            File.Delete("temp.db");
        }
Beispiel #19
0
 /// <summary>
 /// 根据配置获取数据访问
 /// </summary>
 /// <param name="config"></param>
 /// <returns></returns>
 public static DataAccessBroker Instance(DataAccessConfiguration config)
 {
     DataAccessBroker _broker = null;
     if (string.Compare(config.DBType, DBTYPE_SQLSERVER, false) == 0)
     {
         _broker = new SQLDataAccessBroker();
         _broker.Configuration = config;
     }
     else
     {
         _broker = new OracelDataAccessBroker();
         _broker.Configuration = config;
     }
     _broker.Create();//创建并打开数据库连接
     return _broker;
 }
        public static void ConfigureServices(IServiceCollection services, IConfiguration configuration)
        {
            services.AddScoped(typeof(IUnitOfWork), typeof(UnitOfWork));
            //services
            services.AddTransient(typeof(OrderService));
            services.AddTransient(typeof(CommentService));
            services.AddTransient(typeof(UserService));
            services.AddTransient(typeof(BookService));
            services.AddTransient(typeof(GenreService));
            services.AddTransient(typeof(OrderDetailService));
            services.AddTransient(typeof(TagService));



            DataAccessConfiguration.ConfigureServices(services, configuration);
        }
Beispiel #21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (DataObject != null)
     {
         ratingConfig = DataAccessConfiguration.GetRatingConfig(RatingType.Standard);
         for (int i = ratingConfig.MinPoint; i <= ratingConfig.MaxPoint; i++)
         {
             Rr.Items.Add(new RadRatingItem()
             {
                 Value = i, ToolTip = string.Format(language.GetString("ToottipRatingValue"), i)
             });
         }
         Rr.Value = DataObject.RatedAverage;
         DrawRating();
     }
 }
Beispiel #22
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure <CookiePolicyOptions>(options =>
            {
                options.CheckConsentNeeded    = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });

            services.AddControllersWithViews(config =>
            {
                var policy = new AuthorizationPolicyBuilder()
                             .RequireAuthenticatedUser()
                             .Build();
                config.Filters.Add(new AuthorizeFilter(policy));
            });

            services.AddHsts(options =>
            {
                options.Preload           = true;
                options.IncludeSubDomains = true;
                options.MaxAge            = TimeSpan.FromDays(365);
            });

            services.AddHttpsRedirection(options =>
            {
                options.RedirectStatusCode = StatusCodes.Status308PermanentRedirect;
                options.HttpsPort          = _configuration.GetValue <int>("HttpsPort");
            });

            services.AddApplicationInsightsTelemetry();

            var authenticationConfig = new AuthenticationConfiguration(services, _configuration, _environment);

            authenticationConfig.Configure();

            var databaseConfig = new DatabaseConfiguration(services, _configuration, _environment);

            databaseConfig.Configure();

            var dataAccessConfiguration = new DataAccessConfiguration(services, _configuration, _environment);

            dataAccessConfiguration.Configure();

            var businessLogicConfiguration = new BusinessLogicConfiguration(services, _configuration, _environment);

            businessLogicConfiguration.Configure();
        }
        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="parameters"></param>
        /// <param name="node"></param>
        public override void Initialize(Hashtable parameters, XmlNode node)
        {
            // 先调基类函数
            base.Initialize(parameters, node);


            // 源连接
            XmlNode nodeSourceConnection = node.SelectSingleNode("SourceConnection");

            if (nodeSourceConnection != null)
            {
                this.SourceConnEntity = new ConnectionEntity(nodeSourceConnection);
                if (this.SourceConnEntity.Type == DDPConst.Conn_TYPE_ORACLE)
                {
                    this.SourceDataAccessCfg        = new DataAccessConfiguration();
                    this.SourceDataAccessCfg.DBType = DataAccessFactory.DBTYPE_ORACLE;
                    this.SourceDataAccessCfg.Parameters["server"] = this.SourceConnEntity.Server;
                    this.SourceDataAccessCfg.Parameters["user"]   = this.SourceConnEntity.UserID;
                    this.SourceDataAccessCfg.Parameters["pwd"]    = this.SourceConnEntity.Password;
                }
                else if (this.SourceConnEntity.Type == DDPConst.Conn_TYPE_SQLSERVER)
                {
                    this.SourceDataAccessCfg        = new DataAccessConfiguration();
                    this.SourceDataAccessCfg.DBType = "SQLSERVER"; //DataAccessFactory.DBTYPE_SQL;
                    this.SourceDataAccessCfg.Parameters["server"]   = this.SourceConnEntity.Server;
                    this.SourceDataAccessCfg.Parameters["user"]     = this.SourceConnEntity.UserID;
                    this.SourceDataAccessCfg.Parameters["pwd"]      = this.SourceConnEntity.Password;
                    this.SourceDataAccessCfg.Parameters["database"] = this.SourceConnEntity.Database;
                }
            }

            // 目标连接
            XmlNode nodeTargetConnection = node.SelectSingleNode("TargetConnection");

            if (nodeTargetConnection != null)
            {
                this.TargetConnEntity = new ConnectionEntity(nodeTargetConnection);
            }

            // 表映射关系
            XmlNode tableMapNode = node.SelectSingleNode("TableMap");

            this._tableMap = new TableMap(tableMapNode);
        }
Beispiel #24
0
        static void Main(string[] args)
        {
            string connectionString        = "Server=(local);Database=AlbumTracker;User Id=albumTracker;Password=nicetry;";
            DataAccessConfiguration config = new DataAccessConfiguration {
                ConnectionString = connectionString
            };
            DatabaseInitializer dbInit = new DatabaseInitializer(connectionString);

            dbInit.Initialize();

            var tester = new Tester(config);

            for (int i = 0; i < 3000; i++)
            {
                tester.PopulateDatabase();
            }

            //tester.GetStuff();
        }
Beispiel #25
0
        public DataAccessResponse Exceute(DataAccessRequest DataAccessRequest)
        {
            DataAccessResponse Response = null;

            try
            {
                DataTable SecurityDataTable;
                DataTable ParameterDataTable;

                DataAccessConfiguration DataAccessConfig = (DataAccessConfiguration)ConfigurationManager.GetSection("DataAccessConfiguration");
                using (DataAccessManager Manager = new DataAccessManager(DataAccessRequest, DataAccessConfig))
                {
                    SecurityDataTable  = Manager.BuildSecurityDataTable();
                    ParameterDataTable = Manager.BuildParameterDataTable();
                    Response           = Manager.BuildResponse(ParameterDataTable);
                }
            }
            catch (DataAccessException Exception)
            { }
            return(Response);
        }
Beispiel #26
0
    public static void Main(string[] args)
    {
        var parserResult = Parser
                           .Default
                           .ParseArguments <CommandLineOptions>(args);

        var shouldExit = parserResult.Tag == ParserResultType.NotParsed;

        if (shouldExit)
        {
            return;
        }

        var parsed           = (Parsed <CommandLineOptions>)parserResult;
        var dataAccessConfig = new DataAccessConfiguration
        {
            UseInMemoryDatabase = parsed.Value.IsIncognitoModeEnabled
        };

        var mutex = new Mutex(false, typeof(Program).FullName);

        try
        {
            if (!mutex.WaitOne(TimeSpan.FromSeconds(TimeoutSeconds), true))
            {
                return;
            }

            SubscribeToDomainUnhandledEvents();
            RegisterDependencies(dataAccessConfig);
            RunBackgroundTasks();

            BuildAvaloniaApp()
            .StartWithClassicDesktopLifetime(args, ShutdownMode.OnMainWindowClose);
        }
        finally
        {
            mutex.ReleaseMutex();
        }
    }
Beispiel #27
0
 public DataAccessService(DataAccessConfiguration config)
 {
     _config = config;
 }
Beispiel #28
0
 private static void InitConfigutation()
 {
     DataAccessConfiguration.Init();
 }
 public AlbumTrackDataAccess(DataAccessConfiguration config)
 {
     _connectionString = config.ConnectionString;
 }
    private static void RegisterDatabaseConfiguration(IMutableDependencyResolver services,
                                                      IReadonlyDependencyResolver resolver, IConfiguration configuration, DataAccessConfiguration dataAccessConfig)
    {
        var config = new DatabaseConfiguration
        {
            ConnectionString    = GetDatabaseConnectionString(configuration, resolver),
            UseInMemoryDatabase = dataAccessConfig.UseInMemoryDatabase
        };

        services.RegisterConstant(config);
    }
Beispiel #31
0
        protected void Page_Load(object sender, EventArgs e)
        {
            featuredValues = DataAccessConfiguration.LoadObjectFeaturedValues();

            Img.ImageUrl = _4screen.CSB.Common.SiteConfig.MediaDomainName + DataObject.GetImage(PictureVersion.S);
            Img.ID       = null;

            LnkDet1.NavigateUrl = Helper.GetDetailLink(DataObject.ObjectType, DataObject.ObjectID.ToString());
            LnkDet1.ID          = null;

            LnkDet2.NavigateUrl = LnkDet1.NavigateUrl;
            LnkDet2.Text        = DataObject.Title.StripHTMLTags();
            LnkDet2.ID          = null;

            LnkAuthor.NavigateUrl = Helper.GetDetailLink(Helper.GetObjectTypeNumericID("User"), DataObject.Nickname);
            LnkAuthor.Text        = DataObject.Nickname;
            LnkAuthor.ID          = null;

            DataObject profileOrCommunity = DataObject.Load <DataObject>(DataObject.CommunityID.Value);
            string     communityCssClass  = string.Empty;
            string     communityTooltip   = string.Empty;

            if (profileOrCommunity.State != ObjectState.Added)
            {
                string communityName = string.Empty;
                string communityUrl  = string.Empty;
                if (profileOrCommunity.ObjectType == Helper.GetObjectTypeNumericID("Community"))
                {
                    DataObjectCommunity community = DataObject.Load <DataObjectCommunity>(DataObject.CommunityID.Value);
                    communityName = profileOrCommunity.Title.CropString(14);
                    communityUrl  = string.Format("{0}", Helper.GetDetailLink(Helper.GetObjectTypeNumericID("Community"), community.VirtualURL));
                    if (!community.Managed)
                    {
                        communityCssClass = "cty";
                        communityTooltip  = languageSiteObjects.GetString("Community");
                    }
                    else
                    {
                        communityCssClass = "mcty";
                        communityTooltip  = language.GetString("TooltipManagedCommunity");
                    }
                }
                else if (profileOrCommunity.ObjectType == Helper.GetObjectTypeNumericID("ProfileCommunity"))
                {
                    communityName     = profileOrCommunity.Nickname.CropString(14);
                    communityUrl      = string.Format("{0}", Helper.GetDetailLink(Helper.GetObjectTypeNumericID("User"), profileOrCommunity.Nickname));
                    communityCssClass = "prof";
                    communityTooltip  = languageSiteObjects.GetString("ProfileCommunity");
                }
                else
                {
                    communityName     = profileOrCommunity.Title.CropString(14);
                    communityUrl      = string.Format("{0}", Helper.GetDetailLink(profileOrCommunity.ObjectType, profileOrCommunity.ObjectID.ToString()));
                    communityCssClass = "cty";
                    communityTooltip  = Helper.GetObjectName(profileOrCommunity.ObjectType, true);
                }
                LnkCty.NavigateUrl = communityUrl;
                LnkCty.Text        = communityName;
                LnkCty.ID          = null;
            }
            else
            {
                communityCssClass = "errcty";
                communityTooltip  = language.GetString("TooltipCommunityError");
            }
            PnlLoc.CssClass = communityCssClass;
            PnlLoc.ID       = null;
            PnlLoc.ToolTip  = communityTooltip;

            // Info icons
            PhInfo.Controls.Add(new LiteralControl(string.Format("<span class=\"icon {0}\" title=\"{1}\"></span>", DataObject.Status.ToString().ToLower(), language.GetString(string.Format("LableCommunity{0}", DataObject.Status)))));

            if (CustomizationSection.CachedInstance.MyContent.FeaturedEditEnabled)
            {
                PhInfo.Controls.Add(new LiteralControl(string.Format("<span class=\"icon featured\" title=\"{0}\">{1}</span>", featuredValues[DataObject.Featured], DataObject.Featured)));
            }

            switch (DataObject.ShowState)
            {
            case ObjectShowState.Published:
                PhInfo.Controls.Add(new LiteralControl(string.Format("<span class=\"icon published\" title=\"{0}\"></span>", languageShared.GetString("TextShowStatePublished"))));
                break;

            case ObjectShowState.Draft:
                PhInfo.Controls.Add(new LiteralControl(string.Format("<span class=\"icon draft\" title=\"{0}\"></span>", languageShared.GetString("TextShowStateDraft"))));
                break;

            case ObjectShowState.InProgress:
                PhInfo.Controls.Add(new LiteralControl(string.Format("<span class=\"icon working\" title=\"{0}\"></span>", languageShared.GetString("TextShowStateInProgress"))));
                break;

            case ObjectShowState.ConversionFailed:
                PhInfo.Controls.Add(new LiteralControl(string.Format("<span class=\"icon failed\" title=\"{0}\"></span>", languageShared.GetString("TextShowStateConversionFailed"))));
                break;
            }

            if (DataObject.Geo_Lat != double.MinValue)
            {
                PhInfo.Controls.Add(new LiteralControl(string.Format("<span class=\"icon geo\" title=\"{0} {1}\"></span>", Helper.GetObjectName(DataObject.ObjectType, true), language.GetString("TextObjectHasGEO"))));
            }

            // Function icons

            // Funktioniert nicht richtig (ist sprach abhängig) PT fragen
            //functions.Controls.Add(GetInfoTooltip(DataObject));
            //LiteralControl infoLink = new LiteralControl();
            //infoLink.Text = string.Format("<a id=\"ITTT_{0}\" class=\"icon popup\" href=\"javascript:void(0)\"></a>", DataObject.ObjectID);
            //functions.Controls.Add(infoLink);

            if (CustomizationSection.CachedInstance.MyContent.FeaturedEditEnabled && SecuritySection.CachedInstance.CurrentUserHasAccess("DataObjectFeaturedEdit"))
            {
                PhFunc.Controls.Add(GetEditTooltip(DataObject));
                LiteralControl editLink = new LiteralControl();
                editLink.Text = string.Format("<a id=\"ETTT_{0}\" class=\"icon popup2\" href=\"javascript:void(0)\"></a>", DataObject.ObjectID);
                PhFunc.Controls.Add(editLink);
            }

            PhFunc.Controls.Add(new LiteralControl(string.Format("<a class=\"icon edit\" href=\"{0}\" title=\"{1} {2}\"></a>", GetEditUrl(DataObject), Helper.GetObjectName(DataObject.ObjectType, true), language.GetString("TextObjectEdit"))));

            if (DataObject.ShowState == ObjectShowState.Draft || DataObject.ShowState == ObjectShowState.Published)
            {
                bool isOwner  = false;
                bool isMember = false;
                if (UserProfile.Current.UserId != Guid.Empty)
                {
                    isOwner = Community.GetIsUserOwner(UserProfile.Current.UserId, DataObject.CommunityID.Value, out isMember);
                }

                if (DataObject.ShowState == ObjectShowState.Draft && (isOwner || SecuritySection.CachedInstance.CurrentUserHasAccess("DataObjectShowStateEdit")))
                {
                    LinkButton publishButton = new LinkButton();
                    publishButton.CssClass        = "icon publish";
                    publishButton.ToolTip         = language.GetString("TooltipShowStateDraftToPublish");
                    publishButton.CommandArgument = DataObject.ObjectID.ToString();
                    publishButton.Click          += new EventHandler(OnPublishButtonClick);
                    PhFunc.Controls.Add(publishButton);
                }
                else if (DataObject.ShowState == ObjectShowState.Published && (isOwner || SecuritySection.CachedInstance.CurrentUserHasAccess("DataObjectShowStateEdit") || DataObject.UserID == UserProfile.Current.UserId))
                {
                    LinkButton withdrawButton = new LinkButton();
                    withdrawButton.CssClass        = "icon withdraw";
                    withdrawButton.ToolTip         = language.GetString("TooltipShowStatePublishToDraft");
                    withdrawButton.CommandArgument = DataObject.ObjectID.ToString();
                    withdrawButton.Click          += new EventHandler(OnWithdrawButtonClick);
                    PhFunc.Controls.Add(withdrawButton);
                }
            }

            if (DataObject.ObjectType == Helper.GetObjectTypeNumericID("Community"))
            {
                PhFunc.Controls.Add(new LiteralControl(string.Format("<a class=\"icon members\" href=\"Javascript:radWinOpen('/Pages/popups/CommunityMemberOwner.aspx?CN={0}', '{1}', 450, 440, false, null)\" title=\"{2}\"></a>", DataObject.CommunityID, language.GetString("TitleMemberEdit").StripForScript(), language.GetString("TitleMemberEdit"))));
                PhFunc.Controls.Add(new LiteralControl(string.Format("<a class=\"icon msg\" href=\"Javascript:radWinOpen('/Pages/popups/MessageSend.aspx?MsgType=msg&RecType=member&ObjType=Community&ObjId={0}', '{1}', 510, 430, false, null)\" title=\"{2}\"></a>", DataObject.CommunityID, language.GetString("TitleMessageToAllMembers").StripForScript(), language.GetString("TitleMessageToAllMembers"))));
            }

            PhFunc.Controls.Add(new LiteralControl(string.Format("<a class=\"icon delete\" onclick=\"{0}\" href=\"javascript:void(0)\" title=\"{1} {2}\"></a>", GetDeleteUrl(DataObject), Helper.GetObjectName(DataObject.ObjectType, true), language.GetString("TextObjectDelete"))));
        }
        /// <summary>
        /// 根据配置名获取配置信息
        /// </summary>
        /// <param name="configName"></param>
        /// <returns></returns>
        public static DataAccessConfiguration GetDataAccessConfiguration(string configName)
		{
            if (!_cachedConfig.ContainsKey(configName))
            {
                string factConfigName = configName;
                XmlDocument doc = new XmlDocument();
                doc.Load(ConfigFile);

                XmlNode objNode = doc.SelectSingleNode("configuration/instances");
                if (factConfigName.Length == 0)//如果传入参数为空则查找默认配置
                {
                    factConfigName = objNode.Attributes["defaultInstance"].Value.ToString();
                }

                XmlNodeList objNodeList = objNode.SelectNodes("instance");
                int iCount = objNodeList.Count;

                XmlNode objDefaultNode = null;
                for (int i = 0; i < iCount; i++)//根据配置名称遍历instance下所有节点
                {
                    if (String.Compare(objNodeList[i].Attributes["name"].Value.ToString(), factConfigName, false) == 0)
                    {
                        objDefaultNode = objNodeList[i];
                        break;
                    }
                }
                if (null == objDefaultNode)
                {
                    throw new Exception("Can't find the instance configure information.");
                }
                string strConnName = objDefaultNode.Attributes["connectionString"].Value.ToString();//获取连接名称


                XmlNode objConnNode = null;
                objNodeList = doc.SelectNodes("configuration/connectionStrings/connectionString");
                iCount = objNodeList.Count;
                for (int i = 0; i < iCount; i++)//根据连接名称遍历connectionStrings下所有节点
                {
                    if (String.Compare(objNodeList[i].Attributes["name"].Value.ToString(), strConnName, false) == 0)
                    {
                        objConnNode = objNodeList[i];
                        break;
                    }
                }
                if (null == objConnNode)
                {
                    throw new Exception("Can't find the instance configure information.");
                }

                DataAccessConfiguration config = new DataAccessConfiguration();
                config.ConfigName = factConfigName;
                config.DBType = objDefaultNode.Attributes["type"].Value.ToString();

                objNodeList = objConnNode.SelectNodes("parameters/parameter");
                iCount = objNodeList.Count;
                for (int i = 0; i < iCount; i++)
                {
                    config.Parameters[objNodeList[i].Attributes["name"].Value.Trim()] = objNodeList[i].Attributes["value"].Value.Trim();
                }
                _cachedConfig[configName] = config;
            }
            return _cachedConfig[configName];
		}