예제 #1
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;
 }
예제 #2
0
파일: ClientIM.cs 프로젝트: pawlo601/Bazy
        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));
        }
예제 #3
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;
 }
예제 #4
0
파일: ClientIM.cs 프로젝트: pawlo601/Bazy
 public Client FindNIP(NIP nip)
 {
     foreach (var a in clients)
     {
         if (nip == a.Nip)
         {
             return(a);
         }
     }
     return(null);
 }
예제 #5
0
파일: ClientTest.cs 프로젝트: pawlo601/Bazy
 public void NipThrowExceptionWrongNIP()
 {
     try
     {
         NIP np = new NIP("1234567890");
         Assert.IsTrue(false);
     }
     catch (Exception e)
     {
         Assert.IsTrue(e.Message.Equals("Błąd w NIP-ie. Niepoprawne znaczenie.\n"));
     }
 }
예제 #6
0
파일: ClientTest.cs 프로젝트: pawlo601/Bazy
 public void NipThrowExceptionWrongNumber()
 {
     try
     {
         NIP np = new NIP("123456789A");
         Assert.IsTrue(false);
     }
     catch (Exception e)
     {
         Assert.IsTrue(e.Message.Equals("Błąd w NIP-ie.Niewłaściwe znaki.\n"));
     }
 }
예제 #7
0
파일: ClientTest.cs 프로젝트: pawlo601/Bazy
 public void NipThrowExceptionToLongNip()
 {
     try
     {
         NIP np = new NIP("1123456789012");
         Assert.IsTrue(false);
     }
     catch (Exception e)
     {
         Assert.IsTrue(e.Message.Equals("Błąd w NIP-ie. Zła długość.\n"));
     }
 }
예제 #8
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);
        }
예제 #9
0
 public Client FindNIP(NIP nip)
 {
     throw new NotImplementedException();
 }