Exemplo n.º 1
0
        public RegisterView()
        {
            InitializeComponent();
            Login.InputText.Text    = "login";
            Password.InputText.Text = "password";
            Email.InputText.Text    = "e-mail";
            Name.InputText.Text     = "name";
            Surname.InputText.Text  = "surname";
            Age.InputText.Text      = "age";
            City.InputText.Text     = "city";
            Street.InputText.Text   = "street";
            Code.InputText.Text     = "postal code";
            Pesel.InputText.Text    = "PESEL";
            Nip.InputText.Text      = "NIP";
            Regon.InputText.Text    = "REGON";

            Login.SetDefaultText();
            Password.SetDefaultText();
            Email.SetDefaultText();
            Name.SetDefaultText();
            Surname.SetDefaultText();
            Age.SetDefaultText();
            City.SetDefaultText();
            Street.SetDefaultText();
            Code.SetDefaultText();
            Pesel.SetDefaultText();
            Nip.SetDefaultText();
            Regon.SetDefaultText();
        }
Exemplo n.º 2
0
 public static Client CreateClientCompanyWithoutDiscount()
 {
     PersonalData per = new PersonalData("Firma");
     Address addr = new Address();
     Regon reg = new Regon();
     NIP nip = new NIP();
     Client a = new Client(per, addr, reg, nip);
     return a;
 }
Exemplo n.º 3
0
        public ClientIM()
        {
            PersonalData per1 = new PersonalData("A", "B");
            Address      ad1  = new Address("S1", "12", "Wrocław", "12-456", "Poland");
            Regon        a1   = new Regon("2346789");
            NIP          a2   = new NIP("123123");

            clients.Add(new Client(per1, ad1, a1, a2));
        }
Exemplo n.º 4
0
 public static Client CreateClientCompanyWithDiscountZnizka()
 {
     PersonalData per = new PersonalData("Firma");
     Address addr = new Address();
     Regon reg = new Regon();
     NIP nip = new NIP();
     Client a = new Client(per, addr, reg, nip);
     Discount dis = new Discount(1, Bonus.Zniżka, 0.1f);
     a.AddDiscount(dis);
     return a;
 }
Exemplo n.º 5
0
 public Client FindREGON(Regon regon)
 {
     foreach (var a in clients)
     {
         if (regon == a.Regon)
         {
             return(a);
         }
     }
     return(null);
 }
Exemplo n.º 6
0
 private void ClearAllToDefault()
 {
     Login.Refresh();
     Password.Refresh();
     Email.Refresh();
     Name.Refresh();
     Surname.Refresh();
     Age.Refresh();
     City.Refresh();
     Street.Refresh();
     Code.Refresh();
     Pesel.Refresh();
     Nip.Refresh();
     Regon.Refresh();
 }
Exemplo n.º 7
0
        public InvoiceIM()
        {
            PersonalData per1 = new PersonalData("A", "B");
            Address      ad1  = new Address("S1", "12", "Wrocław", "12-456", "Poland");
            Regon        a1   = new Regon("2346789");
            NIP          a2   = new NIP("123123");
            Client       b    = new Client(per1, ad1, a1, a2);
            Price        c3   = new Price(10, Waluta.PLN, 19.0f);
            Product      a3   = new Product("Pierwsza rzecz", TypProduktu.Usługa, c3);
            Money        a4   = new Money(123, Waluta.PLN);
            Item         e    = new Item(a3, 12);
            List <Item>  d    = new List <Item>();

            d.Add(e);
            Invoice a = new Invoice("Faktura", b);

            invoices.Add(a);
        }
Exemplo n.º 8
0
        private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
        {
            bool correct = true;

            //Login
            if (!Regex.IsMatch(Login.GetText(), "^[a-z]{1,}"))
            {
                Login.InputText.Foreground = Brushes.Red;
                correct = false;
            }
            //Password
            //if (!Regex.IsMatch(Login.GetText(), "^[A-Z]{1}[a-z]{2,}"))
            //{
            //    Login.InputText.Foreground = Brushes.Red;
            //    correct = false;
            //}
            //Email
            if (!Regex.IsMatch(Email.GetText(), "^[a-z]{1}\\w+[@]{1}\\w{2,}[.]{1}\\w{2,3}"))
            {
                Email.InputText.Foreground = Brushes.Red;
                correct = false;
            }
            //Name
            if (!Regex.IsMatch(Name.GetText(), "^[A-Z]{1}[a-z]{2,}"))
            {
                Name.InputText.Foreground = Brushes.Red;
                correct = false;
            }
            //Surname
            if (!Regex.IsMatch(Surname.GetText(), "^[A-Z]{1}[a-z]{2,}"))
            {
                Surname.InputText.Foreground = Brushes.Red;
                correct = false;
            }
            //Age
            if (!Regex.IsMatch(Age.GetText(), "^\\d{2}$"))
            {
                Age.InputText.Foreground = Brushes.Red;
                correct = false;
            }
            //City
            if (!Regex.IsMatch(City.GetText(), "^[A-Z]{1}[a-z]+(\\s[A-Z]{1}[a-z]+){0,1}$"))
            {
                City.InputText.Foreground = Brushes.Red;
                correct = false;
            }
            //Street
            if (!Regex.IsMatch(Street.GetText(), "^[A-Z]{1}[a-z]+(\\s[A-Z]{1}[a-z]+){0,1}$"))
            {
                Street.InputText.Foreground = Brushes.Red;
                correct = false;
            }
            //Code
            if (!Regex.IsMatch(Code.GetText(), "^\\d{2}[-]{1}\\d{3}"))
            {
                Code.InputText.Foreground = Brushes.Red;
                correct = false;
            }
            //PESEL
            if (!Regex.IsMatch(Pesel.GetText(), "^\\d{11}$"))
            {
                Pesel.InputText.Foreground = Brushes.Red;
                correct = false;
            }
            //NIP
            if (!Regex.IsMatch(Nip.GetText(), "^\\d{10}$"))
            {
                Nip.InputText.Foreground = Brushes.Red;
                correct = false;
            }
            //REGON
            if (!Regex.IsMatch(Regon.GetText(), "^\\d{9}$"))
            {
                Regon.InputText.Foreground = Brushes.Red;
                correct = false;
            }


            if (correct)
            {
                User user = new User(0, Login.GetText(), Password.GetText(), Email.GetText(),
                                     Name.GetText(), Surname.GetText(), Convert.ToInt32(Age.GetText()), 1, City.GetText(),
                                     Street.GetText(), Code.GetText(), Pesel.GetText(), Nip.GetText(), Regon.GetText(), "0");

                User.Insert(user);
                ClearAllToDefault();
            }
            else
            {
                MessageBox.Show("Niepoprawne dane!");
            }
        }
Exemplo n.º 9
0
 public Client FindREGON(Regon regon)
 {
     throw new NotImplementedException();
 }