private TransactionBancaire(double montant, TypeTransaction typeTransaction, DateTime date, double balance)
 {
     _montant         = montant;
     _typeTransaction = typeTransaction;
     _date            = date;
     Balance          = balance;
 }
示例#2
0
        public void InitierTransaction(TypeCompte typeCompte, TypeTransaction typeTransaction, Epargne epargne, CompteClient compteClientEmetteur,
                                       CompteClient compteClientDestinataire, Employe employe, double montant, int nombreJourAttente)
        {
            operationBLO = new OperationBLO();
            transactionBLO.Add(new Transaction(CodeTransaction(typeTransaction), typeCompte, typeTransaction, epargne, DateTime.Now, compteClientEmetteur,
                                               compteClientDestinataire, employe, new Employe("Indefini"),
                                               montant, StatutTransaction.En_cours_de_validité, nombreJourAttente));

            if (typeTransaction == TypeTransaction.Dépot)
            {
                operationBLO.AjouterOperation(TypeOperation.Dépot, employe, compteClientEmetteur.Client, compteClientEmetteur, montant, "toto tata");
            }

            else if (typeTransaction == TypeTransaction.Retrait)
            {
                operationBLO.AjouterOperation(TypeOperation.Retrait, employe, compteClientEmetteur.Client, compteClientEmetteur, montant, "toto tata");
            }

            else
            {
                operationBLO.AjouterOperation(TypeOperation.Transfert_inter_compte, employe, compteClientEmetteur.Client, compteClientEmetteur, montant, "toto tata");
            }

            new IdentifiantBLO().AddIdTransaction();
        }
 private void DisplayData(TypeTransaction typeTransaction)
 {
     EnableAppBarStatus(true);
     // Navigate to the appropriate destination page, configuring the new page
     // by passing required information as a navigation parameter
     frmTypeTransactionDetail.Navigate(typeof(TypeTransactionDetailFrame), typeTransaction);
 }
示例#4
0
 public InsideBar(double highInsideBar, double lowInsideBar, double highMotherInsideBar, double lowMotherInsideBar, TypeTransaction side)
 {
     HighInsideBar       = highInsideBar;
     LowInsideBar        = lowInsideBar;
     HighMotherInsideBar = highMotherInsideBar;
     LowMotherInsideBar  = lowMotherInsideBar;
     Side = side;
 }
        private TypeTransaction NewTypeTransaction()
        {
            currTypeTransaction = new TypeTransaction();

            currTypeTransaction.PropertyChanged += new PropertyChangedEventHandler(currTypeTransaction_PropertyChanged);

            return currTypeTransaction;
        }
 public LastResult(int amount, TimeSpan tempoResult, double ram, TypeTransaction typeTransaction, OperationType operationType, double totalRam)
 {
     Amount          = amount;
     TempoResult     = tempoResult;
     Ram             = ram;
     TypeTransaction = typeTransaction;
     OperationType   = operationType;
     TotalRam        = totalRam;
 }
示例#7
0
 public Transaction(Guid accountFromId, TypeTransaction typeTransaction, string description, double amount, DateTime dateAndTime, Guid accountToId = default)
 {
     AccountFromId   = accountFromId;
     AccountToId     = accountToId;
     TypeTransaction = typeTransaction;
     Description     = description;
     Amount          = amount;
     DateAndTime     = dateAndTime;
 }
        public async Task <string> GetTempoChart(int[] interactions, TypeTransaction typeTransaction, OperationType operationType)
        {
            var result = await _netcoreContext.Results
                         .Where(_ => _.OperationType == operationType && _.TypeTransaction == typeTransaction && interactions.Contains(_.Amount))
                         .OrderBy(_ => _.Amount)
                         .Select(_ => _.TempoMin.TotalMilliseconds)
                         .ToArrayAsync();

            return(JsonConvert.SerializeObject(result));
        }
 public void Transac(Portefeuille autre, decimal valeur, TypeTransaction type)
 {
     if (type == TypeTransaction.credit)
     {
         TransacCredit(autre, valeur);
     }
     if (type == TypeTransaction.debit)
     {
         TransacDebit(autre, valeur);
     }
 }
示例#10
0
 private decimal GetVolumen(TypeTransaction typeTransaction)
 {
     if (typeTransaction.Equals(TypeTransaction.Buy))
     {
         return(Instrument.ComputeVolumeToBuyByMaxPrice(MaxPriceOneTransaction, Instrument.Valuation.AskPrice));
     }
     if (typeTransaction.Equals(TypeTransaction.Sell))
     {
         return(Instrument.ComputeVolumeToBuyByMaxPrice(MaxPriceOneTransaction, Instrument.Valuation.BidPrice));
     }
     return(0);
 }
        protected override void LoadState(object navigationParameter, Dictionary<string, object> pageState)
        {
            App.Instance.Share = null;

            currTypeTransaction = navigationParameter as TypeTransaction;

            DefaultViewModel["TypeTransaction"] = currTypeTransaction;

            this.IsEnabled = false;// currTypeTransaction != null;

            this.UpdateLayout();
        }
        public async Task <ResultDetailsCell> GetTempo(int amount, TypeTransaction typeTransaction, OperationType operationType)
        {
            var result = await _netcoreContext.Results.FirstOrDefaultAsync(_ =>
                                                                           _.OperationType == operationType && _.TypeTransaction == typeTransaction && _.Amount == amount);

            return(new ResultDetailsCell
            {
                IdResult = result?.Id,
                TempoMin = FormatTempo(result?.TempoMin),
                TempoMax = FormatTempo(result?.TempoMax),
                Ram = result?.RamMax
            });
        }
示例#13
0
 public Transaction(string codeTransaction, TypeCompte typeCompte, TypeTransaction typeTransaction, Epargne epargne,
                    DateTime dateTransaction, CompteClient compteClientEmetteur, CompteClient compteClientDestinataire, Employe employeEmetteur,
                    Employe employeValideur, double montant, StatutTransaction statutTransaction, int nombreJourAttente) : this(codeTransaction)
 {
     TypeCompte               = typeCompte;
     TypeTransaction          = typeTransaction;
     Epargne                  = epargne;
     DateTransaction          = dateTransaction;
     CompteClientEmetteur     = compteClientEmetteur;
     CompteClientDestinataire = compteClientDestinataire;
     EmployeEmetteur          = employeEmetteur;
     EmployeValideur          = employeValideur;
     Montant                  = montant;
     StatutTransaction        = statutTransaction;
     NombreJourAttente        = nombreJourAttente;
 }
示例#14
0
        public Transaction(TypeTransaction p_typeTransaction, decimal p_montant, string p_description)
        {
            if (p_montant < 0)
            {
                throw new ArgumentOutOfRangeException("Le montant doit être positif", nameof(p_montant));
            }

            if (string.IsNullOrWhiteSpace(p_description))
            {
                throw new ArgumentException("La transaction doit avoir une description", nameof(p_description));
            }

            this.Montant     = p_montant;
            this.Type        = p_typeTransaction;
            this.Description = p_description;
        }
示例#15
0
        public static Transaction GetTransaction(TypeTransaction _type, string _message)
        {
            Transaction transaction = new Transaction()
            {
                type = _type
            };

            if (_message.Contains("ORA-"))
            {
                transaction.message = _message.Replace(Char.ConvertFromUtf32(34), "").Replace(Char.ConvertFromUtf32(10), "\\n").Replace(Char.ConvertFromUtf32(13), "\\n");
            }
            else
            {
                transaction.message = _message;
            }
            return(transaction);
        }
示例#16
0
        public bool DepositOrWithdraw(double value, TypeTransaction typeTransaction)
        {
            switch (typeTransaction)
            {
            case TypeTransaction.Deposit:
                Balance += value;
                return(true);

            case TypeTransaction.Withdraw:
                if ((Balance - value) > 0)
                {
                    Balance -= value;
                    return(true);
                }
                return(true);

            default:
                return(false);
            }
        }
示例#17
0
        public int PerformOperation(double count, TypeTransaction type)
        {
            if (type == TypeTransaction.Deposit)
            {
                Balance += count;
            }
            else if (type == TypeTransaction.Withdraw)
            {
                if (Balance >= count)
                {
                    Balance -= count;
                }
                else
                {
                    return(-1);
                }
            }

            return(0);
        }
        public void SaveSelect(int amount, TimeSpan tempoResult, double initMemory, TypeTransaction typeTransaction, OperationType operationType)
        {
            var stopMemory   = GetMemory();
            var ramDiference = stopMemory - initMemory;

            _messageService.SetLastResult(amount, tempoResult, ramDiference, typeTransaction, operationType, stopMemory);

            IQueryable <Result> resultsTracked = _netcoreContext.Results.Where(_ =>
                                                                               _.Amount == amount && _.OperationType == operationType && _.TypeTransaction == typeTransaction);

            ManageResult(resultsTracked);

            var resultTracked = resultsTracked.FirstOrDefault();

            if (resultTracked == null)
            {
                var resultSave = new Result
                {
                    Id              = Guid.NewGuid(),
                    Amount          = amount,
                    OperationType   = operationType,
                    TypeTransaction = typeTransaction,
                    RamMax          = ramDiference,
                    RamMin          = ramDiference,
                    TempoMax        = tempoResult,
                    TempoMin        = tempoResult
                };

                _netcoreContext.Add(resultSave);
                _netcoreContext.SaveChanges();
            }
            else
            {
                SaveChangementResult(resultTracked, tempoResult, ramDiference);
            }
        }
示例#19
0
        private void ControlesUsuarios(TypeTransaction tipo)
        {
            switch (tipo)
            {
                case TypeTransaction.Clear:

                    txtUserDescription.Text = string.Empty;
                    txtUserName.Text = string.Empty;
                    cboProfile.SelectedIndex = -1;

                    break;

                case TypeTransaction.New:

                    txtUserDescription.Text = string.Empty;
                    txtUserName.Text = string.Empty;
                    cboProfile.SelectedIndex = -1;
                    _userId = 0;

                    break;

                case TypeTransaction.Save:

                    if (_userId == 0)
                    {
                        InsertUser();
                    }
                    else
                    {
                        UpdateUser();
                    }

                    break;
            }
        }
示例#20
0
        private void ControlesPerfil(TypeTransaction tipo)
        {
            switch (tipo)
            {
                case TypeTransaction.Clear:

                    txtProfile.Text = string.Empty;
                    treeModulos.Nodes.Clear();

                    break;

                case TypeTransaction.New:

                    txtProfile.Text = string.Empty;
                    _profileId = 0;
                    treeModulos.Nodes.Clear();

                    break;

                case TypeTransaction.Save:

                    if (_profileId == 0)
                    {
                        InsertProfile();
                    }
                    else
                    {
                        UpdateProfile();
                    }

                    break;
            }
        }
示例#21
0
 public Transaction(TypeTransaction myT, string mnt, DateTime today)
 {
     Amount        = mnt;
     DateOperation = today;
     TypeT         = myT;
 }
        public async Task SaveSelect(int amount, TimeSpan tempoResult, double initMemory, TypeTransaction typeTransaction, OperationType operationType)
        {
            var stopMemory   = GetMemory();
            var ramDiference = stopMemory - initMemory;

            _messageService.SetLastResult(amount, tempoResult, ramDiference, typeTransaction, operationType, stopMemory);

            var resultsTracked = _netcoreContext.Results.Where(_ =>
                                                               _.Amount == amount && _.OperationType == operationType && _.TypeTransaction == typeTransaction);

            ManageResult(resultsTracked);

            var resultTracked = await resultsTracked.FirstOrDefaultAsync();

            if (resultTracked == null)
            {
                var resultSave = new Result
                {
                    Id              = Guid.NewGuid(),
                    Amount          = amount,
                    OperationType   = operationType,
                    TypeTransaction = typeTransaction,
                    RamMax          = ramDiference,
                    RamMin          = ramDiference,
                    TempoMax        = tempoResult,
                    TempoMin        = tempoResult
                };

                await _netcoreContext.AddAsync(resultSave);

                await _netcoreContext.SaveChangesAsync();
            }
            else
            {
                if (typeTransaction == TypeTransaction.EfCoreAsNoTracking || typeTransaction == TypeTransaction.EfCoreAsNoTrackingSqlHard)
                {
                    _netcoreContext.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.TrackAll;
                }

                await SaveChangementResult(await _netcoreContext.Results.FirstOrDefaultAsync(_ =>
                                                                                             _.Amount == amount && _.OperationType == operationType &&
                                                                                             _.TypeTransaction == typeTransaction), tempoResult, ramDiference);
            }
        }
        private async void ItemGridView_ItemClick(object sender, ItemClickEventArgs e)
        {
            MessageDialog dialog = null;
            if (currTypeTransaction != null && currTypeTransaction.HasChanges)
            {
                dialog = new MessageDialog("The are changes. Please save the first.");
                //await dialog.ShowAsync();
                //return;
            }
            currTypeTransaction = e.ClickedItem as TypeTransaction;
            currTypeTransaction.PropertyChanged += new PropertyChangedEventHandler(currTypeTransaction_PropertyChanged);

            DisplayData();
        }
示例#24
0
 public string CodeTransaction(TypeTransaction typeTransaction) =>
 ((typeTransaction == TypeTransaction.Transfert_inter_compte) ? "tra-" : (typeTransaction == TypeTransaction.Dépot) ? "dep-" : "ret-") +
 new IdentifiantBLO().IdTransaction.ToString().PadLeft(8, '0');
 public void SetLastResult(int amount, TimeSpan tempoResult, double ram, TypeTransaction typeTransaction, OperationType operationType, double totalRam) =>
 LastResult = new LastResult(amount, tempoResult, ram, typeTransaction, operationType, totalRam);
示例#26
0
 public Builder WithTypeTransaction(TypeTransaction typeTransaction)
 {
     _transaction.TypeTransaction = typeTransaction;
     _transaction.Description     = _transaction.TypeTransaction.ToString();
     return(this);
 }
示例#27
0
 public Transaction(double montant, TypeTransaction type)
 {
     Montant = montant;
     Type = type;
     Date = DateTime.Now;
 }
示例#28
0
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            #region Create data
            Icon entertaiment = new Icon("fas fa-glass-cheers", 1);
            Icon healt        = new Icon("fas fa-hospital", 2);
            Icon salary       = new Icon("fas fa-wallet", 3);
            Icon car          = new Icon("fas fa-car", 4);
            Icon house        = new Icon("fas fa-house-user", 5);
            Icon food         = new Icon("fas fa-utensils", 6);
            Icon sales        = new Icon("fas fa-chart-bar", 41);
            Icon business     = new Icon("fas fa-chart-pie", 42);
            Icon investment   = new Icon("fas fa-chart-line", 43);

            List <Icon> lstIcons = new List <Icon>()
            {
                new Icon("fab fa-airbnb", 7),
                new Icon("fab fa-amazon", 8),
                new Icon("fab fa-apple", 9),
                new Icon("fas fa-baby", 10),
                new Icon("fas fa-bone", 11),
                new Icon("fas fa-ambulance", 12),
                new Icon("fas fa-bus-alt", 13),
                new Icon("fas fa-gas-pump", 14),
                new Icon("fas fa-taxi", 15),
                new Icon("fas fa-coffee", 16),
                new Icon("fas fa-cocktail", 17),
                new Icon("fas fa-birthday-cake", 18),
                new Icon("fas fa-tshirt", 19),
                new Icon("fas fa-wifi", 20),
                new Icon("fas fa-tv", 21),
                new Icon("fas fa-laptop", 22),
                new Icon("fas fa-money-bill-wave", 23),
                new Icon("fas fa-dollar-sign", 24),
                new Icon("fas fa-graduation-cap", 25),
                new Icon("fas fa-credit-card", 26),
                new Icon("fas fa-heartbeat", 27),
                new Icon("fas fa-bone", 28),
                new Icon("fas fa-pizza-slice", 29),
                new Icon("fas fa-dice", 30),
                new Icon("fab fa-playstation", 31),
                new Icon("fab fa-steam", 32),
                new Icon("fab fa-xbox", 33),
                new Icon("fas fa-hand-holding-usd", 34),
                new Icon("fas fa-ambulance", 35),
                new Icon("far fa-hospital", 36),
                new Icon("fas fa-gift", 37),
                new Icon("fas fa-dumbbell", 38),
                new Icon("fas fa-house-user", 39),
                new Icon("fas fa-headphones", 40)
            };

            lstIcons.Add(entertaiment);
            lstIcons.Add(healt);
            lstIcons.Add(salary);
            lstIcons.Add(car);
            lstIcons.Add(house);
            lstIcons.Add(food);
            lstIcons.Add(sales);
            lstIcons.Add(business);
            lstIcons.Add(investment);

            TypeTransaction outlay = new TypeTransaction();
            outlay.TypeTransactionID = 1;
            outlay.Name = "Gasto";

            TypeTransaction deposit = new TypeTransaction();
            deposit.TypeTransactionID = 2;
            deposit.Name = "Ingreso";

            List <TypeTransaction> lstTypeTransaction = new List <TypeTransaction>();
            lstTypeTransaction.Add(outlay);
            lstTypeTransaction.Add(deposit);

            Category category1 = new Category();
            category1.CategoryID        = 1;
            category1.Name              = "Entretenimiento";
            category1.RegisterDate      = DateTime.Now;
            category1.IconID            = entertaiment.IconID;
            category1.Active            = true;
            category1.TypeTransactionID = outlay.TypeTransactionID;

            Category category2 = new Category();
            category2.CategoryID        = 2;
            category2.Name              = "Salud";
            category2.RegisterDate      = DateTime.Now;
            category2.IconID            = healt.IconID;
            category2.Active            = true;
            category2.TypeTransactionID = outlay.TypeTransactionID;

            Category category3 = new Category();
            category3.CategoryID        = 3;
            category3.Name              = "Salario";
            category3.RegisterDate      = DateTime.Now;
            category3.IconID            = salary.IconID;
            category3.Active            = true;
            category3.TypeTransactionID = deposit.TypeTransactionID;

            Category category4 = new Category();
            category4.CategoryID        = 4;
            category4.Name              = "Automóvil";
            category4.RegisterDate      = DateTime.Now;
            category4.IconID            = car.IconID;
            category4.Active            = true;
            category4.TypeTransactionID = outlay.TypeTransactionID;

            Category category5 = new Category();
            category5.CategoryID        = 5;
            category5.Name              = "Casa";
            category5.RegisterDate      = DateTime.Now;
            category5.IconID            = house.IconID;
            category5.Active            = true;
            category5.TypeTransactionID = outlay.TypeTransactionID;

            Category category6 = new Category();
            category6.CategoryID        = 6;
            category6.Name              = "Comida";
            category6.RegisterDate      = DateTime.Now;
            category6.IconID            = food.IconID;
            category6.Active            = true;
            category6.TypeTransactionID = outlay.TypeTransactionID;

            Category category7 = new Category();
            category7.CategoryID        = 7;
            category7.Name              = "Amazon";
            category7.RegisterDate      = DateTime.Now;
            category7.IconID            = 8;
            category7.Active            = true;
            category7.TypeTransactionID = outlay.TypeTransactionID;

            Category category8 = new Category();
            category8.CategoryID        = 8;
            category8.Name              = "Bebé";
            category8.RegisterDate      = DateTime.Now;
            category8.IconID            = 10;
            category8.Active            = true;
            category8.TypeTransactionID = outlay.TypeTransactionID;

            Category category9 = new Category();
            category9.CategoryID        = 9;
            category9.Name              = "Emergencia";
            category9.RegisterDate      = DateTime.Now;
            category9.IconID            = 12;
            category9.Active            = true;
            category9.TypeTransactionID = outlay.TypeTransactionID;

            Category category10 = new Category();
            category10.CategoryID        = 10;
            category10.Name              = "Transporte";
            category10.RegisterDate      = DateTime.Now;
            category10.IconID            = 13;
            category10.Active            = true;
            category10.TypeTransactionID = outlay.TypeTransactionID;


            Category category11 = new Category();
            category11.CategoryID        = 11;
            category11.Name              = "Gasolina";
            category11.RegisterDate      = DateTime.Now;
            category11.IconID            = 14;
            category11.Active            = true;
            category11.TypeTransactionID = outlay.TypeTransactionID;

            Category category12 = new Category();
            category12.CategoryID        = 12;
            category12.Name              = "Taxi";
            category12.RegisterDate      = DateTime.Now;
            category12.IconID            = 15;
            category12.Active            = true;
            category12.TypeTransactionID = outlay.TypeTransactionID;

            Category category13 = new Category();
            category13.CategoryID        = 13;
            category13.Name              = "Café";
            category13.RegisterDate      = DateTime.Now;
            category13.IconID            = 16;
            category13.Active            = true;
            category13.TypeTransactionID = outlay.TypeTransactionID;

            Category category14 = new Category();
            category14.CategoryID        = 14;
            category14.Name              = "Alcohol";
            category14.RegisterDate      = DateTime.Now;
            category14.IconID            = 17;
            category14.Active            = true;
            category14.TypeTransactionID = outlay.TypeTransactionID;

            Category category15 = new Category();
            category15.CategoryID        = 15;
            category15.Name              = "Cumpleaños";
            category15.RegisterDate      = DateTime.Now;
            category15.IconID            = 18;
            category15.Active            = true;
            category15.TypeTransactionID = outlay.TypeTransactionID;

            Category category16 = new Category();
            category16.CategoryID        = 16;
            category16.Name              = "Ropa";
            category16.RegisterDate      = DateTime.Now;
            category16.IconID            = 19;
            category16.Active            = true;
            category16.TypeTransactionID = outlay.TypeTransactionID;

            Category category17 = new Category();
            category17.CategoryID        = 17;
            category17.Name              = "Wifi";
            category17.RegisterDate      = DateTime.Now;
            category17.IconID            = 20;
            category17.Active            = true;
            category17.TypeTransactionID = outlay.TypeTransactionID;

            Category category18 = new Category();
            category18.CategoryID        = 18;
            category18.Name              = "Tv";
            category18.RegisterDate      = DateTime.Now;
            category18.IconID            = 21;
            category18.Active            = true;
            category18.TypeTransactionID = outlay.TypeTransactionID;

            Category category19 = new Category();
            category19.CategoryID        = 19;
            category19.Name              = "Computación";
            category19.RegisterDate      = DateTime.Now;
            category19.IconID            = 22;
            category19.Active            = true;
            category19.TypeTransactionID = outlay.TypeTransactionID;

            Category category20 = new Category();
            category20.CategoryID        = 20;
            category20.Name              = "Honorarios";
            category20.RegisterDate      = DateTime.Now;
            category20.IconID            = 23;
            category20.Active            = true;
            category20.TypeTransactionID = deposit.TypeTransactionID;

            Category category21 = new Category();
            category21.CategoryID        = 21;
            category21.Name              = "TDC";
            category21.RegisterDate      = DateTime.Now;
            category21.IconID            = 26;
            category21.Active            = true;
            category21.TypeTransactionID = outlay.TypeTransactionID;

            Category category22 = new Category();
            category22.CategoryID        = 22;
            category22.Name              = "Préstamo";
            category22.RegisterDate      = DateTime.Now;
            category22.IconID            = 34;
            category22.Active            = true;
            category22.TypeTransactionID = deposit.TypeTransactionID;

            Category category23 = new Category();
            category23.CategoryID        = 23;
            category23.Name              = "Gimnasio";
            category23.RegisterDate      = DateTime.Now;
            category23.IconID            = 38;
            category23.Active            = true;
            category23.TypeTransactionID = outlay.TypeTransactionID;

            Category category24 = new Category();
            category24.CategoryID        = 24;
            category24.Name              = "Accesorios";
            category24.RegisterDate      = DateTime.Now;
            category24.IconID            = 40;
            category24.Active            = true;
            category24.TypeTransactionID = outlay.TypeTransactionID;

            Category category25 = new Category();
            category25.CategoryID        = 25;
            category25.Name              = "Ventas";
            category25.RegisterDate      = DateTime.Now;
            category25.IconID            = sales.IconID;
            category25.Active            = true;
            category25.TypeTransactionID = deposit.TypeTransactionID;

            Category category26 = new Category();
            category26.CategoryID        = 26;
            category26.Name              = "Rendimientos";
            category26.RegisterDate      = DateTime.Now;
            category26.IconID            = business.IconID;
            category26.Active            = true;
            category26.TypeTransactionID = deposit.TypeTransactionID;

            Category category27 = new Category();
            category27.CategoryID        = 27;
            category27.Name              = "Inversión";
            category27.RegisterDate      = DateTime.Now;
            category27.IconID            = investment.IconID;
            category27.Active            = true;
            category27.TypeTransactionID = deposit.TypeTransactionID;


            List <Category> lstCategories = new List <Category>();
            lstCategories.Add(category1);
            lstCategories.Add(category2);
            lstCategories.Add(category3);
            lstCategories.Add(category4);
            lstCategories.Add(category5);
            lstCategories.Add(category6);
            lstCategories.Add(category7);
            lstCategories.Add(category8);
            lstCategories.Add(category9);
            lstCategories.Add(category10);
            lstCategories.Add(category11);
            lstCategories.Add(category12);
            lstCategories.Add(category13);
            lstCategories.Add(category14);
            lstCategories.Add(category15);
            lstCategories.Add(category16);
            lstCategories.Add(category17);
            lstCategories.Add(category18);
            lstCategories.Add(category19);
            lstCategories.Add(category20);
            lstCategories.Add(category21);
            lstCategories.Add(category22);
            lstCategories.Add(category23);
            lstCategories.Add(category24);
            lstCategories.Add(category25);
            lstCategories.Add(category26);
            lstCategories.Add(category27);
            #endregion

            #region extra configurations
            modelBuilder.Entity <Transaction>().HasOne(t => t.TypeTransaction).WithMany(x => x.Transactions).OnDelete(DeleteBehavior.NoAction);
            modelBuilder.Entity <Transaction>().Property(t => t.Value).HasColumnType("decimal(18,2)");

            modelBuilder.Entity <Icon>().Property(i => i.RegisterDate).HasDefaultValueSql("GETDATE()");
            modelBuilder.Entity <Icon>().Property(i => i.Active).HasDefaultValue(true);
            modelBuilder.Entity <Icon>().Property(i => i.IconID).ValueGeneratedOnAdd();

            modelBuilder.Entity <Category>().Property(c => c.Active).HasDefaultValue(true);
            modelBuilder.Entity <Category>().Property(c => c.RegisterDate).HasDefaultValueSql("GETDATE()");
            #endregion

            #region set the tables
            modelBuilder.Entity <Icon>().HasData(lstIcons);
            modelBuilder.Entity <TypeTransaction>().HasData(lstTypeTransaction);
            modelBuilder.Entity <Category>().HasData(lstCategories);
            #endregion
        }
        private void Add_AppBarButtonClick(object sender, RoutedEventArgs e)
        {
            currTypeTransaction = NewTypeTransaction();
            ((ObservableCollection<TypeTransaction>)DataContext).Add(currTypeTransaction);

            DisplayData();

            EnableAppBarStatus(true);
        }
示例#30
0
 public Transaction(double montant, TypeTransaction type)
 {
     Montant = montant;
     Type    = type;
     Date    = DateTime.Now;
 }
示例#31
0
 public TransactionCurrent(decimal amount, TypeTransaction typeTransaction)
 {
     this.Amount          = amount;
     this.TypeTransaction = typeTransaction;
     this.DateTime        = DateTime.Now;
 }