Beispiel #1
0
        public PrincipalForm()
        {
            InitializeComponent();
            this.SecundaryPanel.Visible = false;
            this.PrincipalPanel.Visible = true;
            lblAnswer.Visible           = false;
            Repository = new ParkingRepository();
            CountryHandler initialCountry = Repository.GetACountry("Uruguay");

            Settings = new Settings(PrincipalPanel, Repository, initialCountry);
        }
Beispiel #2
0
 public void TestInit()
 {
     Repository = new ParkingRepository();
     Repository.GetAccounts().Clear();
     Repository.GetEnrollments().Clear();
     Repository.GetPurchases().Clear();
     Account         = new Account();
     Account.Mobile  = "099344951";
     Account.Balance = 0;
     Enrollment      = new Enrollment("sbn", 4849);
     Account.Country = Repository.GetACountry("Uruguay");
 }
Beispiel #3
0
 private void UpdateData()
 {
     if (!cboCountry.Text.Equals(""))
     {
         Country = ParkingRepository.GetACountry(cboCountry.Text);
     }
     if (Country.ValidateIsNumericByCountry(txtCostForMinutes.Text))
     {
         int NewCostOfMinutes = int.Parse(txtCostForMinutes.Text);
         Country.CostForMinutes = NewCostOfMinutes;
         ParkingRepository.UpdateCostForMinutes(Country);
     }
 }
Beispiel #4
0
        public void AddValidAccountWhitZeroAndWithoutZero()
        {
            Account validAccount = new Account(25, "099366931", Repository.GetACountry("Uruguay"));

            Repository.AddAccount(validAccount);
            Account invalidAccount = new Account(25, "99366931", Repository.GetACountry("Uruguay"));

            Repository.AddAccount(invalidAccount);
            Assert.AreEqual(false, Repository.GetAccounts().Contains(invalidAccount));
            using (var MyContext = new MyContext())
            {
                MyContext.Accounts.Attach(Account);
            }
        }
Beispiel #5
0
        private void ArePurchasesOnThatDate(DateTime InitialDateOfPurchase, DateTime FinalDateOfPurchase)
        {
            List <Purchase> PurchasesOnThatDate = Repository.InsertPurchaseOnThatDate(InitialDateOfPurchase, FinalDateOfPurchase);

            if (!cboCountry.Text.Equals(""))
            {
                PurchasesOnThatDate = Repository.EliminatePurchasesFromAnoterCountry(PurchasesOnThatDate, Repository.GetACountry(cboCountry.Text));
            }
            dgvReports.DataSource = PurchasesOnThatDate;
        }