/// <summary>
 /// Adds an Invoice to the Repository.
 /// </summary>
 /// <param name="entity">The Invoice to add to the Repository.</param>
 public void Add(Invoice entity)
 {
     Session.Save(entity);
 }
        /// <summary>
        /// Check in a patient
        /// </summary>
        /// <returns></returns>
        public JsonResult AddCheckIn()
        {
            try
            {
                //Get patient object
                int patientID = int.Parse(Request.Form["patientID"]);
                PatientRepository patientRepo = new PatientRepository();
                var patient = patientRepo.Get(patientID);

                //Get Staff Object
                int staffId = int.Parse(Request.Form["staffID"]);
                UserRepository userRepo = new UserRepository();
                var staff = userRepo.Get(staffId);

                //Get Location Object
                int locationId = int.Parse(Request.Form["locationID"]);
                LocationRepository locationRepo = new LocationRepository();
                var location = locationRepo.Get(locationId);

                //Build Check In Object
                PatientCheckIn checkin = new PatientCheckIn();
                checkin.Patient = patient;
                checkin.CheckInTime = DateTime.Now;
                checkin.PatientType = (PatientCheckinType)Enum.Parse(typeof(PatientCheckinType), Request.Form["patientType"]);
                checkin.AttendingStaff = staff;
                checkin.Location = location;
                checkin.IsActive = true;

                //Build Invoice Object
                Invoice invoice = new Invoice();
                invoice.PatientCheckIn = checkin;
                checkin.Invoice = invoice;

                patient.PatientCheckIns.Add(checkin);
                new InvoiceRepository().Add(invoice);

                return Json(new
                {
                    error = "false"
                });
            }
            catch (Exception e)
            {
                return Json(new
                {
                    error = "true",
                    status = e.Message
                });
            }
        }
 /// <summary>
 /// Removes an invoice from the Repository.
 /// </summary>
 /// <param name="entity">The Invoice to remove from the Repository.</param>
 public void Remove(Invoice entity)
 {
     Session.Delete(entity);
 }