public SpecialityDto(ISpeciality speciality) { Code = speciality.Code; Name = speciality.Name; AdditionalFactor = speciality.AdditionalFactor; CountOfStatePlaces = speciality.CountOfStatePlaces; }
public static bool CheckForNeededMana(IHero hero, ISpeciality speciality) { if (hero.Mana < speciality.RequiredMana) { return(false); } return(true); }
public static bool CheckForNeededLevel(IHero hero, ISpeciality speciality) { if (hero.Level < speciality.RequiredLevel) { return(false); } return(true); }
// 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); }
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); }
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()); }
public void SetSpeciality(ISpeciality speciality) { Info.Speciality = speciality; Info.Doctor = null; }
public ClinicSpec(IClinic clinic, ISpeciality spec) { Clinic = clinic; Spec = spec; }
public IList <IDoctor> GetDoctors(IClinic clinic, ISpeciality speciality) { var key = new ClinicSpec(clinic, speciality); return(loadDoctors(key)); }