Пример #1
0
        /// <summary>
        ///     Handles the OnNavigationComplete event of the _rsReservations control.
        /// </summary>
        /// <param name = "sender">The source of the event.</param>
        /// <param name = "e">The <see cref = "Telerik.Web.UI.SchedulerNavigationCompleteEventArgs" /> instance containing the event data.</param>
        protected void _rsReservations_OnNavigationComplete(object sender, SchedulerNavigationCompleteEventArgs e)
        {
            var db           = new UrbanDataContext();
            var selectedDate = _rsReservations.SelectedDate;

            switch (Type)
            {
            case 1:
            {
                Appointments = AppointmentUtilities.GetAppointmentObjectsByDateRangeAndRoomId(ref db, new DateTime(selectedDate.Year, selectedDate.Month, 1), new DateTime(selectedDate.Year, selectedDate.Month, 1).AddMonths(1).AddDays(-1), Utilities.GetQueryStringInt("roomId"));
                break;
            }

            case 2:
            {
                Appointments = AppointmentUtilities.GetAllReservedObjectsByDateRangeAndUserId(ref db, new DateTime(selectedDate.Year, selectedDate.Month, 1), new DateTime(selectedDate.Year, selectedDate.Month, 1).AddMonths(1).AddDays(-1), Cu.Id);
                break;
            }

            case 3:
            {
                Appointments = AppointmentUtilities.GetAllReservedObjectsByReservationId(ref db, Utilities.GetQueryStringInt("RoomReservationID"));
                break;
            }
            }

            _rsReservations.DataSource = Appointments;
            _rsReservations.Rebind();
        }
Пример #2
0
        /// <summary>
        ///     Raises the <see cref = "E:System.Web.UI.Control.Init" /> event to initialize the page.
        /// </summary>
        /// <param name = "e">An <see cref = "T:System.EventArgs" /> that contains the event data.</param>
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            if (!IsPostBack)
            {
                var db = new UrbanDataContext();
                //Gets the first and last day for the month
                switch (Type)
                {
                case 1:
                {
                    ViewState["Appointments"] = AppointmentUtilities.GetAppointmentObjectsByDateRangeAndRoomId(ref db, new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1), new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(1).AddDays(-1), Utilities.GetQueryStringInt("roomId"));
                    Page.Title = "Room Details";
                    break;
                }

                case 2:
                {
                    ViewState["Appointments"] = AppointmentUtilities.GetAllReservedObjectsByDateRangeAndUserId(ref db, new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1), new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(1).AddDays(-1), Cu.Id);
                    Page.Title = "Up Comming Events";
                    break;
                }

                case 3:
                {
                    ViewState["Appointments"] = AppointmentUtilities.GetAllReservedObjectsByReservationId(ref db, Utilities.GetQueryStringInt("RoomReservationID"));
                    Page.Title = "Reservation";
                    break;
                }
                }
            }
            _rsReservations.DataSource = Appointments;
        }
        public async Task <ActionResult> Appointment(int id)
        {
            ViewBag.Message   = "Patient Appointments";
            ViewBag.PatiendId = id;
            IEnumerable <AppointmentViewModel> appointmentsViewModel = new List <AppointmentViewModel>();

            using (var httpClient = new HttpClient())
            {
                var uri = string.Format(uriFormat, apiUri, @"appointments/patient/" + id.ToString());

                var appointmentsResponse = await httpClient.GetAsync(uri);

                IEnumerable <IAppointment> appointments = await appointmentsResponse.Content.ReadAsAsync <List <Appointment> >();

                uri = string.Format(uriFormat, apiUri, @"appointmentTypes");

                var appointmentTypeResponse = await httpClient.GetAsync(uri);

                IEnumerable <IAppointmentType> appointmentTypes = await appointmentTypeResponse.Content.ReadAsAsync <List <AppointmentType> >();

                appointmentsViewModel = AppointmentUtilities.CreateAppointmentsViewModel(appointments, appointmentTypes);
            }

            return(View(appointmentsViewModel));
        }
Пример #4
0
        /// <summary>
        ///     Handles the OnNavigationComplete event of the _rsReservations control.
        /// </summary>
        /// <param name = "sender">The source of the event.</param>
        /// <param name = "e">The <see cref = "Telerik.Web.UI.SchedulerNavigationCompleteEventArgs" /> instance containing the event data.</param>
        protected void _rsReservations_OnNavigationComplete(object sender, SchedulerNavigationCompleteEventArgs e)
        {
            var db           = new UrbanDataContext();
            var selectedDate = _rsReservations.SelectedDate;

            Appointments = AppointmentUtilities.GetAppointmentObjectsByDateRangeAndRoomId(ref db, new DateTime(selectedDate.Year, selectedDate.Month, 1), new DateTime(selectedDate.Year, selectedDate.Month, 1).AddMonths(1).AddDays(-1), Utilities.GetQueryStringInt("roomId")).ToList();
            _rsReservations.DataSource = Appointments;
            _rsReservations.Rebind();
        }
Пример #5
0
        /// <summary>
        ///     Handles the OnNavigationComplete event of the _rsReservations control.
        /// </summary>
        /// <param name = "sender">The source of the event.</param>
        /// <param name = "e">The <see cref = "Telerik.Web.UI.SchedulerNavigationCompleteEventArgs" /> instance containing the event data.</param>
        protected void _rsReservations_OnNavigationComplete(object sender, SchedulerNavigationCompleteEventArgs e)
        {
            var db           = new UrbanDataContext();
            var selectedDate = _rsReservations.SelectedDate;

            ViewState["Appointments"]  = AppointmentUtilities.GetAllReservedObjectsByReservationId(ref db, RoomReservationId);
            _rsReservations.DataSource = Appointments;
            _rsReservations.Rebind();
        }
Пример #6
0
 /// <summary>
 ///     Raises the <see cref = "E:System.Web.UI.Control.Init" /> event to initialize the page.
 /// </summary>
 /// <param name = "e">An <see cref = "T:System.EventArgs" /> that contains the event data.</param>
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     if (!IsPostBack)
     {
         var db = new UrbanDataContext();
         ViewState["Appointments"] = AppointmentUtilities.GetAllReservedObjectsByReservationId(ref db, Utilities.GetQueryStringInt("RoomReservationID"));
     }
     _rsReservations.DataSource = Appointments;
 }
Пример #7
0
 /// <summary>
 ///     Raises the <see cref = "E:System.Web.UI.Control.Init" /> event to initialize the page.
 /// </summary>
 /// <param name = "e">An <see cref = "T:System.EventArgs" /> that contains the event data.</param>
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     if (!IsPostBack)
     {
         var db = new UrbanDataContext();
         ViewState["Appointments"] = AppointmentUtilities.GetAppointmentObjectsByDateRangeAndRoomId(ref db, new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1), new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(1).AddDays(-1), Utilities.GetQueryStringInt("roomId"));
     }
     _rsReservations.DataSource = Appointments;
 }
Пример #8
0
        protected void _btnRun_Click(object sender, EventArgs e)
        {
            var db        = new Urban.Data.UrbanDataContext();
            var startDate = _rdpStart.SelectedDate;
            var endDate   = _rdpEnd.SelectedDate;

            if (startDate != null)
            {
                startDate = ((DateTime)startDate).AddHours(0);
            }

            if (endDate != null)
            {
                endDate = ((DateTime)endDate).AddHours(23);
            }

            apptList = AppointmentUtilities.GetAppointmentObjectsByDateRangeAndRoomId(ref db, (DateTime)startDate, (DateTime)endDate, 1).ToList();
            RadGrid1.Rebind();
        }