Ejemplo n.º 1
0
        public ContentResult Save(int?id, FormCollection actionValues)
        {
            var action = new DataAction(actionValues);

            try
            {
                AppointmentViewModelFull appointmentViewModel = (AppointmentViewModelFull)DHXEventsHelper.Bind(typeof(AppointmentViewModelFull), actionValues);

                switch (action.Type)
                {
                case DataActionTypes.Insert:
                    int patientID = int.Parse(sessionStateManger.getSecyrtaryActivePatinet(User.Identity.GetUserId()));
                    appointmentViewModel.ClinicID  = sessionStateManger.getClinecIDForCurrentSecurtary(User.Identity.GetUserId());
                    appointmentViewModel.PatientID = patientID;
                    appointmentViewModel.Status    = appointmentViewModel.Status;
                    appointmentViewModel.text      = "DR:" + doctorRepository.getDoctorNameByID(appointmentViewModel.DoctorID) + " Patient:" + patientRepository.getPatientNameByID(patientID);
                    action.TargetId = appointmentRepository.AddNewAppointment(appointmentViewModel);
                    break;

                case DataActionTypes.Delete:
                    appointmentRepository.deleteAppointment(appointmentViewModel.id);
                    break;

                default:
                    appointmentRepository.alterAppointment(appointmentViewModel);
                    break;
                }
            }
            catch
            {
                action.Type = DataActionTypes.Error;
            }

            return(Content(new AjaxSaveResponse(action), "text/xml"));
        }
Ejemplo n.º 2
0
        // /SecretaryDashboard/PatientSearch/getCurrentPatientID
        // [NonAction]
        public int getCurrentPatientID()
        {
            string CurrentUserID = User.Identity.GetUserId();
            string patientID;

            patientID = sessionStateManger.getSecyrtaryActivePatinet(CurrentUserID);

            if (patientID == null)
            {
                return(0);
            }

            return(int.Parse(patientID));
        }
Ejemplo n.º 3
0
 public int getCurrentPatientID()
 {
     return(int.Parse(sessionStateManger.getSecyrtaryActivePatinet(User.Identity.GetUserId())));
 }