当前位置: 首页>>代码示例>>C#>>正文


C# IOptionService.SetFirstTimeOption方法代码示例

本文整理汇总了C#中IOptionService.SetFirstTimeOption方法的典型用法代码示例。如果您正苦于以下问题:C# IOptionService.SetFirstTimeOption方法的具体用法?C# IOptionService.SetFirstTimeOption怎么用?C# IOptionService.SetFirstTimeOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IOptionService的用法示例。


在下文中一共展示了IOptionService.SetFirstTimeOption方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ProcessDatasOnDB


//.........这里部分代码省略.........
            na2.Name = "Mon compte courant";

            var na3 = new Account();
            na3.Balance = 7.0;
            na3.BankName = "HSBC";
            na3.Name = "Mon compte epargne HSBC";

            #endregion

            #region DB Cleaner

            var Categories = CategoryService.GetAllCategories(true);

            var Accounts = AccountService.GetAllAccounts(true);

            if (Categories.Value.Count > 0)
            {
                foreach (var entity in Categories.Value)
                {
                    CategoryService.DeleteCategorieById(entity.ID);
                }
            }

            if (Accounts.Value.Count > 0)
            {
                foreach (var entity in Accounts.Value)
                {
                    AccountService.DeleteAccountById(entity.ID);

                }
            }

            var transactions =

            #endregion

            #region Ajout Données

             na1 = AccountService.CreateAccount(new CreateAccountCommand() { BankName = na1.BankName, Name = na1.Name }).Value;
            na2 = AccountService.CreateAccount(new CreateAccountCommand() { BankName = na2.BankName, Name = na2.Name }).Value;
            na3 = AccountService.CreateAccount(new CreateAccountCommand() { BankName = na3.BankName, Name = na3.Name }).Value;

            c1 = CategoryService.CreateCategory(new CreateCategoryCommand() { Name = c1.Name, Color = c1.Color }).Value;
            c2 = CategoryService.CreateCategory(new CreateCategoryCommand() { Name = c2.Name, Color = c2.Color }).Value;

            #endregion

            #region Ajout 26 transactions

            var listDeTransaction = new List<Transaction>();

            listDeTransaction.Add(new Transaction() { Name = "redevance tv", Account = na1, Amount = -100, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "les courses", Account = na1, Amount = -80, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "restau", Account = na2, Category = c2, Amount = -40, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "piscine", Account = na1, Amount = -10, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "ciné", Account = na1, Amount = -5, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "bar", Account = na1, Category = c1, Amount = -10.5, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "club", Account = na1, Category = c1, Amount = -15.5, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "lotto", Account = na1, Amount = 7, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "la biere", Account = na1, Amount = -10, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "bouquet de fleur", Account = na1, Amount = -20, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "medicaments", Account = na1, Amount = -5, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "pizza tv", Account = na1, Amount = -10, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "moulin de la forge tv", Account = na1, Category = c1, Amount = -150, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "licence MS", Account = na2, Category = c2, Amount = -35, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "James", Account = na2, Category = c2, Amount = 500, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "Ian", Account = na2, Category = c2, Amount = 1000, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "Villa", Account = na2, Category = c1, Amount = -200, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "Telephone", Account = na2, Category = c2, Amount = -30, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "park d'actraction", Account = na2, Amount = -20, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "enfants", Account = na2, Amount = 46.7, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "nouvelle maison", Account = na3, Amount = -33.6, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "epargne taux fixe", Account = na3, Amount = 10, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "epargne sur montpellier", Account = na3, Amount = 60, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "epargne de Paris", Account = na3, Amount = -20, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "investissement", Account = na3, Amount = 250, Description = "test de la description" });
            listDeTransaction.Add(new Transaction() { Name = "import maman", Account = na1, Amount = 700, Description = "test de la description" });

            #endregion

            listDeTransaction.ForEach(transac =>
                {
                    var newtransaction = new CreateTransactionCommand()
                    {
                        Name = transac.Name,
                        accountId = transac.Account.ID,
                        Amount = transac.Amount,
                        Description = transac.Description
                    };

                    if (transac.Category != null)
                    {
                        newtransaction.categoryId = transac.Category.ID;
                    }

                    TransactionService.CreateTransaction(newtransaction);
                });

            OptionService.SetFirstTimeOption();
        }
开发者ID:streathamAdministrators,项目名称:AKWP7,代码行数:101,代码来源:DumpMyDBSQLCE.cs


注:本文中的IOptionService.SetFirstTimeOption方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。