Exemplo n.º 1
0
        public void setCollectionView()
        {
            bancaEntities.Dispose();
            bancaEntities = new BancaEntities();

            List<LoanRequestDisplayable> offers = new List<LoanRequestDisplayable>();
            var query = (from oferta in bancaEntities.Credite_Oferta
                         join moneda in bancaEntities.Monedes
                         on oferta.CodMoneda equals moneda.CodMoneda
                         select new
                         {
                             oferta.CodOferta,
                             oferta.Suma,
                             oferta.RataLunara,
                             oferta.Dobanda,
                             Moneda = moneda.Nume
                         }).ToList();

            foreach(var item in query)
            {
                offers.Add(new LoanRequestDisplayable()
                {
                    CodOferta = item.CodOferta,
                    Suma = item.Suma,
                    RataLunara = item.RataLunara,
                    Dobanda = item.Dobanda,
                    Moneda = item.Moneda
                });
            }

            _loansView = CollectionViewSource.GetDefaultView(offers);
        }
Exemplo n.º 2
0
        public void setCollectionView()
        {
            bancaEntities.Dispose();
            bancaEntities = new BancaEntities();
            var Deposits = bancaEntities.Depozits.Where(u => u.CodClient == _clientID);

            _depositsView = CollectionViewSource.GetDefaultView(Deposits.ToList());
        }
Exemplo n.º 3
0
        public void OnPayButton(object obj)
        {
            var query = (from loan in bancaEntities.Credites
                         join monede in bancaEntities.Monedes
                         on loan.CodMoneda equals monede.CodMoneda
                         where loan.CodClient == _clientID
                         select new
            {
                loan.Suma,
                loan.RataLunara,
                loan.Penalizari,
                loan.Dobanda,
                loan.DataInceperii,
                loan.DataFinalizarii,
                Moneda = monede.Nume,
                loan.SumaPlatita
            }).ToList();

            var Client = bancaEntities.Clientis.Where(u => u.CodClient == _clientID).FirstOrDefault();

            if (SelectedItem == null)
            {
                MessageBox.Show("Nu ati selectat un imprumut", "Stockdock", MessageBoxButton.OK, MessageBoxImage.Warning, MessageBoxResult.OK);
                return;
            }

            foreach (var item in query)
            {
                if ((item.DataInceperii == SelectedItem.DataInceperii) && (item.DataFinalizarii == SelectedItem.DataFinalizarii))
                {
                    var Cont   = bancaEntities.Conturis.Where(u => u.Client == _clientID).FirstOrDefault();
                    var Credit = bancaEntities.Credites.Where(u => (u.DataInceperii == SelectedItem.DataInceperii) && (u.DataFinalizarii == SelectedItem.DataFinalizarii)).FirstOrDefault();
                    var suma   = Credit.RataLunara + Credit.Penalizari + ((Credit.Dobanda / 100) * Credit.Suma);
                    Cont.Sold          -= suma;
                    Credit.SumaPlatita += suma;
                    if (suma < Credit.Suma)
                    {
                        bancaEntities.SaveChanges();
                        MessageBox.Show("Din contul dumneavoastra a fost retrasa rata lunara + dobanda + penalizarile", "Stockdock", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
                        bancaEntities.Dispose();
                        bancaEntities = new BancaEntities();
                    }
                }
            }
        }
Exemplo n.º 4
0
        public void setCollectionView()
        {
            bancaEntities.Dispose();
            bancaEntities = new BancaEntities();
            var Cont  = bancaEntities.Conturis.Where(c => c.Client == _clientID).FirstOrDefault();
            var Plati = bancaEntities.Platis.Where(u => u.CodCard == Cont.CodCard);

            _paymentsView = CollectionViewSource.GetDefaultView(Plati.ToList());
        }
Exemplo n.º 5
0
        public void setCollectionView()
        {
            bancaEntities.Dispose();
            bancaEntities = new BancaEntities();
            var Cont         = bancaEntities.Conturis.Where(u => u.Client == _clientID).FirstOrDefault();
            var Data         = bancaEntities.Tranzactiis.Where(u => (u.CodContDestinatie == Cont.CodCont) || (u.CodContSursa == Cont.CodCont)).ToList();
            var Transactions = bancaEntities.Tranzactiis.ToList();

            //var Query = from tranzactie in bancaEntities.Tranzactiis
            //            join cont in bancaEntities.Conturis
            //            on tranzactie.CodContDestinatie equals cont.CodCont
            //            where tranzactie.CodContDestinatie == Cont.CodCont
            //            join cont2 in bancaEntities.Conturis
            //            on tranzactie.CodContSursa equals cont2.CodCont
            //            where cont2.CodCont == Cont.CodCont
            //            join client in bancaEntities.Clientis
            //            on cont.Client equals client.CodClient
            //            join client2 in bancaEntities.Clientis
            //            on cont2.Client equals client2.CodClient
            //            select new { Sursa = client.Nume + client.Prenume, Destinatie = client2.Nume + client2.Prenume, Suma = tranzactie.Suma, Data = tranzactie.Data };

            _transactionsView = CollectionViewSource.GetDefaultView(Data.ToList());
        }
Exemplo n.º 6
0
 public void setCollectionView()
 {
     bancaEntities.Dispose();
     bancaEntities = new BancaEntities();
     LoadInfo();
 }