Odense

Record

Mar 3rd, 2021
629
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Program
  2.     {
  3.         static void Main(string[] args)
  4.         {
  5.             String RecordType = "Vacancy";
  6.  
  7.             Record softwareEngineerVacancy = new Record("SoftwareEngineer0001", RecordType);
  8.             Record frontEndEngineerVacancy = new Record("FrontEndEngineer0020", RecordType);
  9.  
  10.             NotifyManager.Notify += DisplayMessage;
  11.             NotifyManager.SubmitForApproval(softwareEngineerVacancy.Id);
  12.             NotifyManager.Approve(softwareEngineerVacancy.Id);
  13.             NotifyManager.SubmitForApproval(frontEndEngineerVacancy.Id);
  14.             NotifyManager.Reject(frontEndEngineerVacancy.Id);
  15.         }
  16.  
  17.         private static void DisplayMessage(string message)
  18.         {
  19.             Console.WriteLine(message);
  20.         }
  21.  
  22.         public class NotifyManager {
  23.             public delegate void NotifyManagerHandler(string message);
  24.             public static event NotifyManagerHandler Notify;
  25.  
  26.             public static void SubmitForApproval(string id)
  27.             {
  28.                 Notify?.Invoke($"Submitted for approval Vacancy: {id}");
  29.             }
  30.  
  31.             public static void Approve(string id)
  32.             {
  33.                 Notify?.Invoke($"Approved Record: {id}");
  34.             }
  35.  
  36.             public static void Reject(string id)
  37.             {
  38.                 Notify?.Invoke($"Reject Record: {id}");
  39.             }
  40.  
  41.         }
  42.  
  43.         public class Record
  44.         {
  45.             public String Id { get; private set; }
  46.             public String Type { get; private set; }
  47.  
  48.             public Record(String Id, String Type)
  49.             {
  50.                 this.Id = Id;
  51.                 this.Type = Type;
  52.             }
  53.         }
  54.     }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×