Пример #1
0
 public NonmonetaryAsset GetNonmonetaryAssetDomainModel(NonmonetaryAssetViewModel nonmonetaryAssetViewModel)
 {
     var nonmonetaryAsset = new NonmonetaryAsset();
     nonmonetaryAsset.Id = nonmonetaryAssetViewModel.Id;
     nonmonetaryAsset.Name = nonmonetaryAssetViewModel.Name.Trim();
     nonmonetaryAsset.Amount = nonmonetaryAssetViewModel.Amount;
     nonmonetaryAsset.Unit = nonmonetaryAssetViewModel.Unit;
     nonmonetaryAsset.StartBalanceValue = nonmonetaryAssetViewModel.StartBalanceValue;
     nonmonetaryAsset.ResidualBalanceValue = nonmonetaryAssetViewModel.ResidualBalanceValue;
     nonmonetaryAsset.EstimatedValue = nonmonetaryAssetViewModel.EstimatedValue;
     nonmonetaryAsset.Currency = nonmonetaryAssetViewModel.Currency;
     nonmonetaryAsset.Description = nonmonetaryAssetViewModel.Description;
     return nonmonetaryAsset;
 }
Пример #2
0
 public void UpdateNonmonetaryAsset(NonmonetaryAsset nonmonetaryAsset)
 {
     var targetAsset = GetNonmonetaryAsset(nonmonetaryAsset.Id);
     targetAsset.Name = nonmonetaryAsset.Name;
     targetAsset.Amount = nonmonetaryAsset.Amount;
     targetAsset.Unit = nonmonetaryAsset.Unit;
     targetAsset.StartBalanceValue = nonmonetaryAsset.StartBalanceValue;
     targetAsset.ResidualBalanceValue = nonmonetaryAsset.ResidualBalanceValue;
     targetAsset.EstimatedValue = nonmonetaryAsset.EstimatedValue;
     targetAsset.Currency = nonmonetaryAsset.Currency;
     targetAsset.Description = nonmonetaryAsset.Description;
     context.SaveChanges();
 }
Пример #3
0
        public void InitializeStorage()
        {
            Bank firstFakeBank = new Bank("ПервыйФэйкБанк");
            BankAccount firstFakeAccount = new BankAccount(firstFakeBank);
            BankAccount secondFakeAccount = new BankAccount(firstFakeBank);
            Bank secondFakeBank = new Bank("ВторойФэйкБанк");
            BankAccount thirdFakeAccount = new BankAccount(secondFakeBank);
            Bank thirdFakeBank = new Bank("ТретийФэйкБанк");
            BankAccount fourthFakeAccount = new BankAccount(thirdFakeBank);
            BankAccount fifthFakeAccount = new BankAccount(thirdFakeBank);
            BankAccount sixthFakeAccount = new BankAccount(thirdFakeBank);
            BankAccount seventhFakeAccount = new BankAccount(thirdFakeBank);

            Banks.Add(firstFakeBank);
            Banks.Add(secondFakeBank);
            Banks.Add(thirdFakeBank);

            CashAsset firstCashAsset = new CashAsset { Name = "Денежные средства", Cost = 103400, Currency = "рубль" };
            CashAsset secondCashAsset = new CashAsset { Name = "Обогащенный уран", Amount = 130, Unit = "тонна", Cost = 15000, Currency = "евро" };
            CashAsset thirdCashAsset = new CashAsset { Name = "Красные мороженки", Amount = 6575, Unit = "штука", Cost = 150, Currency = "рубль" };
            CashAsset fourthCashAsset = new CashAsset { Name = "Денежные средства", Cost = 100400, Currency = "доллар" };
            CashAsset fifthCashAsset = new CashAsset { Name = "Хрюши", Amount = 57234, Unit = "штука", Cost = 345, Currency = "рубль" };
            CashAsset sixthCashAsset = new CashAsset { Name = "Пиратский алкоголь", Amount = 48345, Unit = "литр", Cost = 456367, Currency = "евро" };
            CashAsset seventhCashAsset = new CashAsset { Name = "Денежные средства", Cost = 10101, Currency = "юань" };
            CashAsset eightCashAsset = new CashAsset { Name = "Денежные средства", Cost = 1000, Currency = "рубль" };
            CashAsset ninthCashAsset = new CashAsset { Name = "Хлам", Amount = 3467, Unit = "килограмм", Cost = 1000, Currency = "евро" };
            CashAsset tenthCashAsset = new CashAsset { Name = "Влажные салфетки", Amount = 5678, Unit = "штука", Cost = 1000, Currency = "юань" };

            CashAssets.Add(firstCashAsset);
            CashAssets.Add(secondCashAsset);
            CashAssets.Add(thirdCashAsset);
            CashAssets.Add(fourthCashAsset);
            CashAssets.Add(fifthCashAsset);
            CashAssets.Add(sixthCashAsset);
            CashAssets.Add(seventhCashAsset);
            CashAssets.Add(eightCashAsset);
            CashAssets.Add(ninthCashAsset);
            CashAssets.Add(tenthCashAsset);

            firstCashAsset.SetBankAccount(firstFakeAccount);
            seventhCashAsset.SetBankAccount(secondFakeAccount);
            eightCashAsset.SetBankAccount(secondFakeAccount);
            tenthCashAsset.SetBankAccount(thirdFakeAccount);
            sixthCashAsset.SetBankAccount(thirdFakeAccount);
            ninthCashAsset.SetBankAccount(secondFakeAccount);
            tenthCashAsset.SetBankAccount(seventhFakeAccount);

            NonmonetaryAsset firstNonmonetaryAsset = new NonmonetaryAsset { Name = "Торговое здание", StartBalanceValue = 30000, ResidualBalanceValue = 5000, EstimatedValue = 10000000, Currency = "рубль", Description = "Здание по адресу улица 101010, дом 10100" };
            NonmonetaryAsset secondNonmonetaryAsset = new NonmonetaryAsset { Name = "Катышки", Amount = 345, Unit = "килограмм", StartBalanceValue = 300, ResidualBalanceValue = 50, EstimatedValue = 1000, Currency = "евро", Description = "Обычные катышки с одежды" };
            NonmonetaryAsset thirdNonmonetaryAsset = new NonmonetaryAsset { Name = "Гвозди", Amount = 111, Unit = "Тонна",  StartBalanceValue = 780, ResidualBalanceValue = 123, EstimatedValue = 10345, Currency = "рубль", Description = "Гвозди гвозди гвозди" };
            NonmonetaryAsset fourthNonmonetaryAsset = new NonmonetaryAsset { Name = "Воздух", StartBalanceValue = 30000, ResidualBalanceValue = 5000, EstimatedValue = 10000000, Currency = "рубль", Description = "Чистый воздух" };
            NonmonetaryAsset fifthNonmonetaryAsset = new NonmonetaryAsset { Name = "Торговое здание", StartBalanceValue = 56000, ResidualBalanceValue = 5345, EstimatedValue = 1685733, Currency = "доллар", Description = "Здание по адресу улица бла бла, дом бла" };

            NonmonetaryAssets.Add(firstNonmonetaryAsset);
            NonmonetaryAssets.Add(secondNonmonetaryAsset);
            NonmonetaryAssets.Add(thirdNonmonetaryAsset);
            NonmonetaryAssets.Add(fourthNonmonetaryAsset);
            NonmonetaryAssets.Add(fifthNonmonetaryAsset);

            SaveChanges();
        }
Пример #4
0
 public void CreateNonmonetaryAsset(NonmonetaryAsset nonmonetaryAsset)
 {
     context.NonmonetaryAssets.Add(nonmonetaryAsset);
     context.SaveChanges();
 }