Пример #1
0
 private void RaiseEvent(ClinicEventArgs e)
 {
     if (AdminAction != null)
     {
         AdminAction(this, e);
         AdminAction = null;
     }
     if (ReceptionAction != null)
     {
         ReceptionAction(this, e);
         ReceptionAction = null;
     }
 }
Пример #2
0
        public void Initialize(int actionNumber, string role)
        {
            ClinicEventArgs e = null;

            switch (role)
            {
            case "Admin":
                switch (actionNumber)
                {
                case 1:
                    e = new ClinicEventArgs(commonAction.ShowAllDoctors);
                    break;

                case 2:
                    e = new ClinicEventArgs(admin.AddDoctor);
                    break;

                case 3:
                    e = new ClinicEventArgs(admin.AddSpeciality);
                    break;

                case 4:
                    e = new ClinicEventArgs(commonAction.GetDoctorVisits);
                    break;

                case 5:
                    e = new ClinicEventArgs(commonAction.GetPatientVisits);
                    break;

                case 0:
                    e = new ClinicEventArgs(authorization.LogOut);
                    break;
                }
                AdminAction += new Handler().DoAction;
                break;

            case "Reseption":
                switch (actionNumber)
                {
                case 1:
                    e = new ClinicEventArgs(commonAction.ShowAllDoctors);
                    break;

                case 2:
                    e = new ClinicEventArgs(reseption.DoActionWithTickets);
                    break;

                case 3:
                    e = new ClinicEventArgs(commonAction.GetDoctorVisits);
                    break;

                case 4:
                    e = new ClinicEventArgs(commonAction.GetPatientVisits);
                    break;

                case 0:
                    e = new ClinicEventArgs(authorization.LogOut);
                    break;
                }
                ReceptionAction += new Handler().DoAction;
                break;
            }

            RaiseEvent(e);
        }
Пример #3
0
        public void DoAction(object sender, ClinicEventArgs e)
        {
            var action = e.Action;

            action();
        }