Пример #1
0
        public AppoinmentModel GetAppoinmentData(string doctorId, string patientUserName)
        {
            AspNetUser      user          = _dbContext.AspNetUsers.SingleOrDefault(x => x.UserName == patientUserName);
            PatientMaster   patientMaster = _dbContext.PatientMasters.SingleOrDefault(x => x.UserLoginDetailsId == user.Id);
            DoctorMaster    doctorMaster  = _dbContext.DoctorMasters.SingleOrDefault(x => x.Id == Convert.ToInt32(doctorId));
            AppoinmentModel data          = new AppoinmentModel
            {
                drname      = doctorMaster.FirstName + " " + doctorMaster.LastName,
                patientname = patientMaster.FirstName + " " + patientMaster.LastName,
                drid        = doctorMaster.Id.ToString(),
                patientid   = patientMaster.Id.ToString(),
                speciality  = doctorMaster.Speciality
            };

            return(data);
        }
Пример #2
0
        public ResultModel SaveAppoinmentData(AppoinmentModel model)
        {
            ResultModel rs          = new ResultModel();
            Appointment appointment = new Appointment
            {
                Description      = model.description,
                DoctorId         = Convert.ToInt32(model.drid),
                MeetingStartTime = Convert.ToDateTime(model.date + " " + model.fromtime),
                MeetingEndTime   = Convert.ToDateTime(model.date + " " + model.totime),
                PatientId        = Convert.ToInt32(model.patientid),
                CreatedOn        = DateTime.Now,
                ModifiedOn       = DateTime.Now
            };

            _dbContext.Appointments.Add(appointment);
            _dbContext.SaveChanges();
            SetNotification(Convert.ToInt32(model.drid), model.patientname);
            rs.Code = 1;
            return(rs);
        }