185522x

Untitled

Jul 2nd, 2019
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.93 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 class variables accessible only within this class
  12.     private string _CustName;
  13.     private string _NRIC;
  14.     private string _Hp;
  15.     private string _Email;
  16.     private string _Gender;
  17.     private string _Notifications;
  18.     private string _BirthdayMonth;
  19.  
  20.     //Empty or Default class constructor
  21.     public Customer()
  22.     {
  23.         this.CustName = null;
  24.         this.NRIC = null;
  25.         this.Hp = null;
  26.         this.Email = null;
  27.     }
  28.     //overloaded class constructor with 4 parameters
  29.     public Customer(string p_CustName, string p_NRIC, string p_Hp, string p_Email,string p_Gender, string p_Notifications, string p_BirthdayMonth)
  30.     {
  31.         this.CustName = p_CustName;
  32.         this.NRIC = p_NRIC;
  33.         this.Hp = p_Hp;
  34.         this.Email = p_Email;
  35.         this.Gender = p_Gender;
  36.         this.Notifications = p_Notifications;
  37.         this.BirthdayMonth = p_BirthdayMonth;
  38.     }
  39.  
  40.     //public class properties, accessing from outside the class is possible
  41.     public string CustName
  42.     {
  43.         get { return _CustName; }
  44.         set { _CustName = value; }
  45.     }
  46.     public string NRIC
  47.     {
  48.         get { return _NRIC; }
  49.         set { _NRIC = value; }
  50.     }
  51.     public string Hp
  52.     {
  53.         get { return _Hp; }
  54.         set { _Hp = value; }
  55.     }
  56.     public string Email
  57.     {
  58.         get { return _Email; }
  59.         set { _Email = value; }
  60.     }
  61.     public string Gender
  62.     {
  63.         get { return _Gender; }
  64.         set { _Gender = value; }
  65.     }
  66.     public string Notifications
  67.     {
  68.         get { return _Notifications; }
  69.         set { _Notifications = value; }
  70.     }
  71.     public string BirthdayMonth
  72.     {
  73.         get { return _BirthdayMonth; }
  74.         set { _BirthdayMonth = value; }
  75.     }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment