Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Business.cs
- class Business
- {
- //ONDERNEMINGSNUMMER
- public bool CheckONDNR(string pOND)
- {
- bool resultaat = false;
- if (pOND.Length == 11)
- {
- // CODE LLK:
- // char[] cijfers = new char[9]
- // int i = 0;
- // for(int teller = 0; teller<9; teller++)
- //{
- // if (pOND[teller] != '.')
- // {
- // cijfers[i] = nummer[teller]
- // i ++;
- // }
- //}
- // string cijfers1 = new string (cijfers); // string maken van char-array
- // Alle karakters na elkaar zetten
- // int cijfers2=Convert.Toint32(cijfers1); // Omzetten naar getal met 7 cijfers
- // cijfers = new char[2]
- // cijfers[0] = pOND[nummer.Length-2]
- //cijfers [1] = pOND[Oef6_Ondernemingsnummer.Lentgh - 1]
- // int cijfers3 = Convert.ToInt32(new string(cijfers)); // string maken van karakters
- // Alle karakters na elkaar zetten
- // Omzetten naar 2 cijfers
- // int check;
- // check = 97-(cijfers2%97); // Controlegtal
- // if check == cijfers3
- //{resultaat = true}
- pOND = pOND.Replace(".", "");
- double getal1 = Convert.ToDouble(pOND.Substring(0, 7));
- double getal2 = (97 - (getal1 % 97));
- double getal3 = Convert.ToDouble(pOND.Substring(7, 2));
- if (getal2 == getal3)
- {
- resultaat = true;
- }
- }
- return resultaat;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment