示例#1
0
 public SpecialityDto(ISpeciality speciality)
 {
     Code               = speciality.Code;
     Name               = speciality.Name;
     AdditionalFactor   = speciality.AdditionalFactor;
     CountOfStatePlaces = speciality.CountOfStatePlaces;
 }
示例#2
0
 public static bool CheckForNeededMana(IHero hero, ISpeciality speciality)
 {
     if (hero.Mana < speciality.RequiredMana)
     {
         return(false);
     }
     return(true);
 }
示例#3
0
 public static bool CheckForNeededLevel(IHero hero, ISpeciality speciality)
 {
     if (hero.Level < speciality.RequiredLevel)
     {
         return(false);
     }
     return(true);
 }
示例#4
0
        //   public HomeController() { }

        /* public HomeController(AssesmentsRepositories assRepos,CoursesRepositories courRepos, SpecialtiesRepositories specRepos,  StudentsRepositories studRepos, SubjectsRepositories subRepos)
         * {
         *   _assRepos = assRepos;
         *   _courRepos = courRepos;
         *   _specRepos = specRepos;
         *   _studRepos = studRepos;
         *   _subRepos = subRepos;
         * }*/
        public HomeController() : base()
        {
            _assRepos  = new AssesmentsRepositories(db);
            _courRepos = new CoursesRepositories(db);
            _specRepos = new SpecialityRepositories(db);
            _studRepos = new StudentsRepositories(db);
            _subRepos  = new SubjectsRepositories(db);
        }
示例#5
0
        private void doSelectDoctor(ChatInfo chatInfo, CommandInfo commandInfo)
        {
            IClinic clinic = chatInfo.Info.Clinic;

            if (clinic == null)
            {
                return;
            }

            ISpeciality speciality = chatInfo.Info.Speciality;

            if (speciality == null)
            {
                return;
            }

            IDoctor doctor;

            switch (commandInfo.Command)
            {
            case Commands.Back:
                commandInfo.Command = Commands.RefreshByCommand;
                chatInfo.ChatLevel  = Level.SelectClinic;
                doStep(chatInfo, commandInfo);
                return;

            case Commands.Refresh:
                commandInfo.Command = Commands.RefreshByCommand;
                chatInfo.ChatLevel  = Level.SelectSpec;
                doStep(chatInfo, commandInfo);
                return;

            case Commands.RefreshByCommand:
                doctor = chatInfo.Info.Doctor;
                break;

            case Commands.SelectItem:
            {
                var doctors = _repository.GetDoctors(clinic, speciality);
                if (commandInfo.Index > doctors.Count || commandInfo.Index <= 0)
                {
                    sendErrorCommand(chatInfo.ChatId, commandInfo.OriginalCommand);
                    return;
                }
                doctor = doctors[commandInfo.Index - 1];
                break;
            }

            default:
                sendErrorCommand(chatInfo.ChatId, commandInfo.OriginalCommand);
                return;
            }

            _botClient.SendChatActionAsync(chatInfo.ChatId, Telegram.Bot.Types.Enums.ChatAction.Typing);
            _botClient.SendTextMessageAsync(chatInfo.ChatId, getTicketsMessage(clinic, doctor));
            chatInfo.ChatLevel = Level.SelectTicket;
            chatInfo.SetDoctor(doctor);
        }
示例#6
0
        private string getDoctorsMessage(IClinic clinic, ISpeciality speciality)
        {
            var stringBuilder = new StringBuilder();
            var doctors       = _repository.GetDoctors(clinic, speciality);

            for (int i = 0; i < doctors.Count; ++i)
            {
                stringBuilder.AppendLine($"{i + 1}. {doctors[i].DoctorName} номерков {doctors[i].FreeTickets}");
            }

            stringBuilder.AppendLine(string.Empty);
            stringBuilder.AppendLine("0. Вернуться назад");
            stringBuilder.AppendLine("00. Обновить");
            stringBuilder.AppendLine("Наберите номер доктора");
            return(stringBuilder.ToString());
        }
示例#7
0
 public void SetSpeciality(ISpeciality speciality)
 {
     Info.Speciality = speciality;
     Info.Doctor     = null;
 }
示例#8
0
 public ClinicSpec(IClinic clinic, ISpeciality spec)
 {
     Clinic = clinic;
     Spec   = spec;
 }
示例#9
0
        public IList <IDoctor> GetDoctors(IClinic clinic, ISpeciality speciality)
        {
            var key = new ClinicSpec(clinic, speciality);

            return(loadDoctors(key));
        }