Exemple #1
0
        public DeleteAppointmentType(IAppointmentTypeManager appointmentTypeManager = null)
        {
            _appointmentTypeManager = appointmentTypeManager;
            if (_appointmentTypeManager == null)
            {
                _appointmentTypeManager = new AppointmentTypeManager();
            }
            InitializeComponent();
            try
            {
                if (cboAppointmentType.Items.Count == 0)
                {
                    var appointmentTypeID = _appointmentTypeManager.RetrieveAllAppointmentTypes();
                    foreach (var item in appointmentTypeID)
                    {
                        cboAppointmentType.Items.Add(item);
                    }
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + Environment.NewLine + ex.StackTrace);
            }
        }
 public void TestSetup()
 {
     accessor            = new AppointmentTypeAccessorMock();
     appointmenttManager = new AppointmentTypeManager(accessor);
     appointmentTypes    = new List <AppointmentType>();
     appointmentTypes    = appointmenttManager.RetrieveAllAppointmentTypes("all");
 }
        public void TestRetrieveAllAppointmentTypes()
        {
            // arrange
            List <AppointmentType> testpets = null;

            // act
            testpets = appointmenttManager.RetrieveAllAppointmentTypes("all");
            // assert
            CollectionAssert.Equals(testpets, appointmentTypes);
        }
        // BrowseAppointmentType(IAppointmentTypeManager appointmentTypeManager = null)
        /// <summary>
        /// Method for retrieving all appointment types.
        /// </summary>
        /// <param name="PetType newPetType">The BrowseAppointmentType calls the RetrieveAllAppointmentTypes.</param>
        /// <returns>dgAppointmentTypes.ItemsSource</returns>
        public BrowseAppointmentType(IAppointmentTypeManager appointmentTypeManager = null)
        {
            _appointmentTypeManager = appointmentTypeManager;
            if (_appointmentTypeManager == null)
            {
                _appointmentTypeManager = new AppointmentTypeManager();
            }

            InitializeComponent();
            try
            {
                _appointmentType = _appointmentTypeManager.RetrieveAllAppointmentTypes("All");
                if (_currentAppointmentType == null)
                {
                    _currentAppointmentType = _appointmentType;
                }
                dgAppointmentTypes.ItemsSource = _currentAppointmentType;
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + Environment.NewLine + ex.StackTrace);
            }
        }
Exemple #5
0
 /// <summary>
 /// Eduardo Colon
 /// Created: 2019/04/23
 ///
 /// constructor  to create walkinappointment with three parameters.
 /// </summary>
 public WalkInAppointmentDetail(IGuestManager guestManager = null, IAppointmentManager appointmentManager = null, IAppointmentTypeManager appointmentTypeManager = null)
 {
     InitializeComponent();
     _appointmentManager     = appointmentManager;
     _appointmentTypeManager = appointmentTypeManager;
     _guestManager           = guestManager;
     if (_appointmentManager == null)
     {
         _appointmentManager = new AppointmentManager();
     }
     if (_appointmentTypeManager == null)
     {
         _appointmentTypeManager = new AppointmentTypeManager();
     }
     if (_guestManager == null)
     {
         _guestManager = new GuestManager();
     }
     try
     {
         _guests = _guestManager.ReadAllGuests();
         cboAppointmentTypes.ItemsSource = _appointmentTypeManager.RetrieveAllAppointmentTypes();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + Environment.NewLine + ex.StackTrace);
     }
     cboEmail.ItemsSource        = _guests.Select(g => g.Email);
     cboFirstName.ItemsSource    = _guests.Select(g => g.FirstName);
     cboLastName.ItemsSource     = _guests.Select(g => g.LastName);
     dtpikStart.SelectedDate     = DateTime.Now;
     dtpikStart.DisplayDateStart = DateTime.Now;
     dtpikStart.DisplayDateEnd   = DateTime.Now.AddDays(14);
     dtpikEnd.DisplayDateStart   = DateTime.Now;
     dtpikEnd.DisplayDateEnd     = DateTime.Now.AddDays(28);
 }
        // GET: Amenities
        public ActionResult Index()
        {
            List <AppointmentType> appointments = apptTypeManager.RetrieveAllAppointmentTypes("all");

            return(View(appointments));
        }