Guest User

Untitled

a guest
Nov 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5.  
  6. /// <summary>
  7. /// Summary description for Customer
  8. /// </summary>
  9. public class Customer
  10. {
  11. private int customerId; //attribut
  12.  
  13. public int CustomerId {
  14. get {return customerId;}
  15. }
  16.  
  17. private string firstname;
  18.  
  19. public string Firstname {
  20. get {return firstname;}
  21. }
  22.  
  23.  
  24. private string lastname;
  25.  
  26. public string Lastname {
  27. get {return lastname;}
  28. }
  29.  
  30.  
  31. private string address;
  32.  
  33. public string Address
  34. {
  35. get { return address; }
  36. }
  37.  
  38.  
  39. private string zipcode;
  40.  
  41. public string Zipcode
  42. {
  43. get { return zipcode; }
  44. }
  45.  
  46.  
  47. private string city;
  48. public string City
  49. {
  50. get { return city; }
  51. }
  52.  
  53. private string email;
  54. public string Email
  55. {
  56. get { return email; }
  57.  
  58. }
  59.  
  60. private string phone; //phone er string for at man kan skrive eks +45
  61. public string Phone{
  62. set {
  63. if (phone.Length <8 || phone.Length >50)
  64. {
  65. throw new Exception("Illigal phone number");
  66. }
  67. else
  68. {
  69. phone = value;
  70. }
  71. }
  72. get { return phone; }
  73. }
Add Comment
Please, Sign In to add comment