Beispiel #1
0
        private static bool IsEmploeeExists(Employee emploerToAdd, ManhattanInfo manhattanInfo)
        {
            var result = emploerToAdd.IsTrener
             ? manhattanInfo.Treners.Exists(x => x.Name.Equals(emploerToAdd.Name))
             : manhattanInfo.Admins.Exists(x => x.Name.Equals(emploerToAdd.Name));

            return(result);
        }
Beispiel #2
0
        /// <summary>
        ///     Возвращает номер телефона работника из Базы Manhattan. Автоматически смотрит кто это, тренер или админ
        /// </summary>
        private static string GetPhoneFromBase(Employee emploerToAdd, ManhattanInfo manhattanInfo)
        {
            var result = emploerToAdd.IsTrener
             ? manhattanInfo.Treners.Find(x => x.Name.Equals(emploerToAdd.Name)).Phone
             : manhattanInfo.Admins.Find(x => x.Name.Equals(emploerToAdd.Name)).Phone;

            return(result);
        }
Beispiel #3
0
 private static void AddEmploee(Employee emploerToAdd, ManhattanInfo manhattanInfo)
 {
     if (emploerToAdd.IsTrener)
     {
         manhattanInfo.Treners.Add(new Trener(emploerToAdd.Name, emploerToAdd.Phone));
     }
     else
     {
         manhattanInfo.Admins.Add(new Administrator(emploerToAdd.Name, emploerToAdd.Phone));
     }
 }
Beispiel #4
0
        private static Administrator FindAdminInBase(Employee emploerToAdd, ManhattanInfo manhattanInfo)
        {
            Administrator result;

            try
            {
                result = manhattanInfo.Admins.Find(x => x.Name.Equals(emploerToAdd.Name));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }

            return(result);
        }
Beispiel #5
0
        private static Trener FindTrenerInBase(Employee emploerToAdd, ManhattanInfo manhattanInfo)
        {
            Trener result;

            try
            {
                result = manhattanInfo.Treners.Find(x => x.Name.Equals(emploerToAdd.Name));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }

            return(result);
        }
Beispiel #6
0
 public BossForm()
 {
     InitializeComponent();
     _manhattanInfo = DataBaseLevel.GetManhattanInfo();
 }
Beispiel #7
0
 private static bool IsSchedExists(string time, string nameWorkout, ManhattanInfo manhattanInfo)
 {
     return(manhattanInfo.Schedule.Exists(x =>
                                          x.Time.HourMinuteTime.Equals(time) && x.WorkoutsName.Equals(nameWorkout)));
 }