public ScheduleModel() { _scheduleService = new ScheduleService(); _chamberService = new ChamberService(); ChamberCollection = _chamberService.GetAllByDoctorId(AuthenticatedDoctorUserModel.GetDoctorUserFromIdentity().Id); }
public DoctorModel(int id) : this() { var existingDoctor = _doctorService.GetByUserId(AuthenticatedDoctorUserModel.GetUserFromIdentity().Id); if (existingDoctor != null) { this.Id = existingDoctor.Id; this.User = existingDoctor.User; this.UserId = existingDoctor.UserId; this.FathersName = existingDoctor.FathersName; this.MothersName = existingDoctor.MothersName; this.PresentAddress = existingDoctor.PresentAddress; this.PermanentAddress = existingDoctor.PermanentAddress; this.Awards = existingDoctor.Awards; this.BloodGroupId = existingDoctor.BloodGroupId; this.BloodGroup = existingDoctor.BloodGroup; this.DateOfBirth = existingDoctor.DateOfBirth; this.Description = existingDoctor.Description; this.Designation = existingDoctor.Designation; this.Phone = existingDoctor.Phone; this.Status = existingDoctor.Status; this.UpdatedAt = existingDoctor.UpdatedAt; this.Experience = existingDoctor.Experience; this.GenderId = existingDoctor.GenderId; this.Gender = existingDoctor.Gender; this.ImageUrl = existingDoctor.ImageUrl; this.DoctorChamberRelations = existingDoctor.DoctorChamberRelations; this.DoctorDegreeRelations = existingDoctor.DoctorDegreeRelations; this.DoctorSpecialtyRelations = existingDoctor.DoctorSpecialtyRelations; this.ChamberSelectedIds = existingDoctor.DoctorChamberRelations.Select(x => x.ChamberId); this.SpecialtySelectedIds = existingDoctor.DoctorSpecialtyRelations.Select(x => x.SpecialtyId); this.DegreeSelectedIds = existingDoctor.DoctorDegreeRelations.Select(x => x.DegreeId); } }
public bool Add() { this.ScheduleCollection.ForEach(x => { x.ChamberId = this.ChamberId; x.DoctorId = AuthenticatedDoctorUserModel.GetDoctorUserFromIdentity().Id; }); return(_scheduleService.AddRange(this.ScheduleCollection)); }
public bool Update() { try { this.DoctorChamberRelations = this.ChamberSelectedIdsToDoctorChamberRelations().ToList(); this.DoctorSpecialtyRelations = this.SpecialtySelectedIdsToDoctorSpecialtyRelations().ToList(); this.DoctorDegreeRelations = this.DegreeSelectedIdsToDoctorDegreeRelations().ToList(); this.ImageUrl = CustomFile.SaveImageFile(this.ImageFileBase, AuthenticatedDoctorUserModel.GetUserFromIdentity().Name, AuthenticatedDoctorUserModel.GetUserFromIdentity().Id, "Doctor"); } catch (Exception ex) { Console.WriteLine(ex.Message); return(false); } return(_doctorService.Update(this)); }
public IEnumerable <Schedule> GetAllSchedules() { return(_scheduleService.GetAllByDoctorId(AuthenticatedDoctorUserModel.GetDoctorUserFromIdentity().Id)); }
public IEnumerable <Appointment> GetAllPendingAppointmentByDoctorId(int?lastDays) { return(_appointmentService.GetAllByDoctorId( AuthenticatedDoctorUserModel.GetDoctorUserFromIdentity().Id, (int)CustomEnum.AppointmentStatus.Requested, lastDays)); }
public IEnumerable <Appointment> GetAllByDoctorId(int?status, int?lastDays) { return(_appointmentService.GetAllByDoctorId(AuthenticatedDoctorUserModel.GetDoctorUserFromIdentity().Id, status, lastDays)); }
public bool IsExist() { return(AuthenticatedDoctorUserModel.GetDoctorUserFromIdentity() != null); }