예제 #1
0
        public ActionResult ViewAppointment()
        {
            var appointments         = _context.Appointment.ToList();
            var appointmensViewModel = new AppointmentViewModel();

            appointmensViewModel.UpcomingAppointments = new Collection <AppointmentForm>();


            foreach (var appointment in appointments)
            {
                var customer = _context.Customers.Single(c => c.CustomerId == appointment.CustomerId);

                var appointmentForm = new AppointmentForm
                {
                    FirstName   = customer.FirstName,
                    LastName    = customer.LastName,
                    PhoneNumber = customer.PhoneNumber,
                    Date        = appointment.AppointmentDate.Month.ToString() + "/" + appointment.AppointmentDate.Day.ToString() + "/" + appointment.AppointmentDate.Year.ToString(),
                    Time        = appointment.AppointmentDate.TimeOfDay.ToString(),
                    Type        = appointment.Type,
                    Note        = appointment.Note
                };

                appointmensViewModel.UpcomingAppointments.Add(appointmentForm);
            }

            //var viewModel = new AppointmentViewModel()
            // {
            //     UpcomingAppointments = appointment
            // };
            return(View("Appointment", appointmensViewModel));
        }
예제 #2
0
        private void ShowDialogForm(MyAppointment label)
        {
            AppointmentForm frm = new AppointmentForm(label);

            frm.CheckSecurityForView();
            frm.ShowDialog();
        }
예제 #3
0
 public ActionResult Index(AppointmentForm form)
 {
     form.Appointment = form.Appointment ?? new Appointment {
         Patient = new Patient()
     };
     return(View(form));
 }
예제 #4
0
        /// <summary>
        /// The get appointment form.
        /// </summary>
        /// <param name="frm">
        /// The frm.
        /// </param>
        /// <param name="status">
        /// The status.
        /// </param>
        /// <returns>
        /// The <see cref="IAppointmentForm"/>.
        /// </returns>
        private IAppointmentForm GetAppointmentForm(FormCollection frm, ApptFormStatusType status, IAdminUnitOfWork adminUow)
        {
            var apptFormId = Convert.ToInt32(frm["AppointmentFormId"]);
            var apptForm   = new AppointmentForm
            {
                FormId        = Convert.ToInt32(frm["FormId"]),
                AppointmentId = Convert.ToInt32(frm["AppointmentId"]),
                CreatedBy     = User.Identity.Name,
                CreatedOn     = DateTime.UtcNow,
                IsActive      = true
            };

            if (apptFormId > 0)
            {
                //var adminUow = DependencyResolver.Current.GetService<IAdminUnitOfWork>();

                apptForm = adminUow.AppointmentRepository.GetAppointmentForm(apptFormId) as AppointmentForm;
            }

            if (apptForm != null)
            {
                apptForm.Notes            = frm["Notes"];
                apptForm.Status           = (int)EntityStatusType.Current;
                apptForm.FormStatusTypeId = (int)status;
                apptForm.UpdatedBy        = this.User.Identity.Name;
                apptForm.UpdatedOn        = DateTime.UtcNow;
            }

            return(apptForm);
        }
예제 #5
0
        private void appointmentButton_Click(object sender, EventArgs e)
        {
            AppointmentForm appointmentForm = new AppointmentForm(operation);

            appointmentForm.Show();
            this.Hide();
        }
        public ActionResult AppointmentFormPost(AppointmentForm appointmentForm)
        {
            AppointmentForm sendFormEmail = new AppointmentForm();

            sendFormEmail.SendEmail(appointmentForm);

            return(RedirectToAction("Index", "Home"));
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     DataHelper.SetupCustomEventsMappings(ASPxScheduler1);
     DataHelper.ProvideRowInsertion(ASPxScheduler1, dataSource.AppointmentDataSource);
     dataSource.AttachTo(ASPxScheduler1);
     if (!IsPostBack)
     {
         AppointmentForm.DataBind();
     }
 }
예제 #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     // Data binding should be performed manually
     DataHelper.SetupDefaultMappings(ASPxScheduler1);
     DataHelper.ProvideRowInsertion(ASPxScheduler1, objectDataSource.AppointmentDataSource);
     objectDataSource.AttachTo(ASPxScheduler1);
     if (!IsPostBack)
     {
         AppointmentForm.DataBind();
     }
 }
예제 #9
0
        private void Goto(MyAppointment label)
        {
            //Hashtable h = new Hashtable();
            //h.Add("Id", label.Id);
            //h.Add("Appointment", label);
            //NavigateTo("Appointments", h);
            AppointmentForm frm = new AppointmentForm(label);

            frm.CheckSecurityForView();
            frm.ShowDialog();
        }
예제 #10
0
 public ActionResult IndexSubmit(AppointmentForm form)
 {
     if (ModelState.IsValid)
     {
         Patient formPatient = form.Appointment.Patient;
         if (Get <IAuthorizationService>().QuickLogin(formPatient.FirstName, formPatient.LastName,
                                                      formPatient.Birthday, formPatient.Policy))
         {
             return(RedirectTo <AppointmentController>(a => a.Doctors(form)));
         }
         ModelState.AddModelError("LoginFalied", "Данный пользователь не зарегистрирован в системе");
     }
     return(RedirectTo <AppointmentController>(a => a.Index(form)));
 }
예제 #11
0
 private void CreateAppointment()
 {
     try
     {
         AppointmentForm frm = new AppointmentForm();
         frm.ShowDialog();
         frm.Dispose();
         MemoryHelper.ReduceMemory();
     }
     catch (Exception ex)
     {
         ErrorHandler.Show(ex);
     }
 }
 //Metoda dodająca nowy element do bazy
 private void AddNewButtonClick(object sender, RoutedEventArgs e)
 {
     if (TabsComboBox.SelectedIndex == 1)
     {
         PatientForm PatientWindow = new PatientForm();
         PatientWindow.DataChanged += PatientWindow_DataChanged;
         PatientWindow.Show();
     }
     else if (TabsComboBox.SelectedIndex == 0)
     {
         AppointmentForm AppointmentTab = new AppointmentForm();
         AppointmentTab.DataChanged += AppoinmentWindow_DataChanged;
         AppointmentTab.Show();
         TodayAppointmentsButton.Content = "Dzisiejsze wizyty";
     }
 }
예제 #13
0
        public ActionResult CreateAppointmentForm(AppointmentForm vm)
        {
            var db = new DatabaseContext();

            var doctor = db.Doctors
                         .FirstOrDefault(dr => dr.Id == vm.DoctorId);

            if (doctor == null)
            {
                return(NotFound());
            }
            else
            {
                var report = new AppointmentForm
                {
                    AppointmentDate = vm.AppointmentDate,
                    Discription     = vm.Discription,
                    PhoneNumber     = vm.PhoneNumber,
                    FirstNanme      = vm.FirstNanme,
                    LastNanme       = vm.LastNanme,
                    Email           = vm.Email,
                    DoctorId        = vm.DoctorId
                };
                db.AppointmentForms.Add(report);
                db.SaveChanges();
                var rv = new AppointmentForm
                {
                    Id = report.Id,
                    AppointmentDate = report.AppointmentDate,
                    Discription     = report.Discription,
                    FirstNanme      = report.FirstNanme,
                    LastNanme       = report.LastNanme,
                    PhoneNumber     = report.PhoneNumber,
                    Email           = report.Email,
                    DoctorId        = report.DoctorId,
                };
                return(Ok(rv));
            }
        }
예제 #14
0
        public ActionResult MakeAppointment(AppointmentForm form)
        {
            Customer customer = new Customer();

            customer.FirstName   = form.FirstName;
            customer.LastName    = form.LastName;
            customer.PhoneNumber = form.PhoneNumber;

            Appointment appointment = new Appointment();

            appointment.AppointmentDate = form.DateTime;
            appointment.Type            = form.Type;
            appointment.Note            = form.Note;

            customer.Appointments = new System.Collections.ObjectModel.Collection <Appointment>();
            customer.Appointments.Add(appointment);

            _context.Customers.Add(customer);
            _context.SaveChanges();

            return(RedirectToAction("Confirmation", "Home"));
        }
예제 #15
0
 private void commandBar1_NewCommandPressed(object sender, EventArgs e)
 {
     //try
     //{
     //    Hashtable h = new Hashtable();
     //    h.Add("Id", _current.Id);
     //    h.Add("Customer", _current);
     //    base.NavigateTo("Appointments", h);
     //}
     //catch (AccessDeniedException)
     //{
     //    XtraMessageBox.Show("Impossibile accedere alla funzionalità richiesta. Accesso negato", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
     //}
     //catch (Exception ex)
     //{
     //    ErrorHandler.Show(ex);
     //}
     try
     {
         AppointmentForm frm = new AppointmentForm(_current);
         if (frm.ShowDialog() == DialogResult.OK)
         {
             if (frm.Appointment != null)
             {
                 IBindingList g = gridView1.DataSource as IBindingList;
                 g.Add(frm.Appointment);
             }
         }
     }
     catch (AccessDeniedException)
     {
         XtraMessageBox.Show("Impossibile accedere alla funzionalità richiesta. Accesso negato", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     catch (Exception ex)
     {
         ErrorHandler.Show(ex);
     }
 }
예제 #16
0
 private void simpleButton2_Click(object sender, EventArgs e)
 {
     try
     {
         AppointmentForm frm = new AppointmentForm();
         if (frm.ShowDialog() == DialogResult.OK)
         {
             if (frm.Appointment != null)
             {
                 IBindingList g = gridView1.DataSource as IBindingList;
                 g.Add(frm.Appointment);
             }
         }
     }
     catch (AccessDeniedException)
     {
         XtraMessageBox.Show("Impossibile accedere alla funzionalità richiesta. Accesso negato", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     catch (Exception ex)
     {
         ErrorHandler.Show(ex);
     }
 }
예제 #17
0
 public ActionResult Confirm(AppointmentForm form)
 {
     return(View(form));
 }
예제 #18
0
 public ActionResult Doctors(AppointmentForm form)
 {
     ViewBag.Doctors = Get <IDoctorRepository>().GetAll();
     return(View(form));
 }
예제 #19
0
        private void schedulerControl1_RecurrenceFormShowing(object sender, RecurrenceFormEventArgs e)
        {
            AppointmentForm appointmentForm = e.ParentForm as AppointmentForm;

            e.Form = new CustomRecurrenceForm(appointmentForm.Controller);
        }
        private void tsbAppointment_Click(object sender, EventArgs e)
        {
            Patient obj = this.GetSelected();

            AppointmentForm.ShowForm(obj);
        }
예제 #21
0
        private void AppointmentButton_Click(object sender, RoutedEventArgs e)
        {
            AppointmentForm ap = new AppointmentForm();

            ap.ShowDialog();
        }