Exemple #1
0
 public Patient(int patient_id, int person_id, DateTime patient_date_added, bool is_clinic_patient, bool is_gp_patient,
     bool is_deleted, bool is_deceased,
     string flashing_text, int flashing_text_added_by, DateTime flashing_text_last_modified_date,
     string private_health_fund, string concession_card_number, DateTime concession_card_expiry_date,
     bool is_diabetic, bool is_member_diabetes_australia, DateTime diabetic_assessment_review_date, int ac_inv_offering_id, int ac_pat_offering_id,
     string login, string pwd,
     bool is_company, string abn,
     string next_of_kin_name, string next_of_kin_relation, string next_of_kin_contact_info)
 {
     this.patient_id                       = patient_id;
     this.person                           = new Person(person_id);
     this.patient_date_added               = patient_date_added;
     this.is_clinic_patient                = is_clinic_patient;
     this.is_gp_patient                    = is_gp_patient;
     this.is_deleted                       = is_deleted;
     this.is_deceased                      = is_deceased;
     this.flashing_text                    = flashing_text;
     this.flashing_text_added_by           = flashing_text_added_by == -1 ? null : new Staff(flashing_text_added_by);
     this.flashing_text_last_modified_date = flashing_text_last_modified_date;
     this.private_health_fund              = private_health_fund;
     this.concession_card_number           = concession_card_number;
     this.concession_card_expiry_date      = concession_card_expiry_date;
     this.is_diabetic                      = is_diabetic;
     this.is_member_diabetes_australia     = is_member_diabetes_australia;
     this.diabetic_assessment_review_date  = diabetic_assessment_review_date;
     this.ac_inv_offering                  = ac_inv_offering_id == -1 ? null : new Offering(ac_inv_offering_id);
     this.ac_pat_offering                  = ac_pat_offering_id == -1 ? null : new Offering(ac_pat_offering_id);
     this.login                            = login;
     this.pwd                              = pwd;
     this.is_company                       = is_company;
     this.abn                              = abn;
     this.next_of_kin_name                 = next_of_kin_name;
     this.next_of_kin_relation             = next_of_kin_relation;
     this.next_of_kin_contact_info         = next_of_kin_contact_info;
 }
 private static OfferingDTO GetOfferingDTO(Offering offering)
 {
     return(new OfferingDTO
     {
         Offering = offering,
         Courses = offering.CourseOfferings
                   .Select(co => new CourseDTO
         {
             CourseId = co.Course.Id,
             CourseNumber = co.Course.CourseNumber,
             DepartmentId = co.Course.DepartmentId,
             DepartmentAcronym = co.Course.Department.Acronym
         }).ToList(),
         Term = offering.Term,
         InstructorIds = offering.OfferingUsers
                         .Where(uo => uo.IdentityRole.Name == Globals.ROLE_INSTRUCTOR)
                         .Select(uo => new ApplicationUser
         {
             Id = uo.ApplicationUser.Id,
             Email = uo.ApplicationUser.Email,
             FirstName = uo.ApplicationUser.FirstName,
             LastName = uo.ApplicationUser.LastName
         }).ToList()
     });
 }
Exemple #3
0
        private async Task <ServiceResult> UpdateOfferingAsync(Offering offering)
        {
            var offeringExist = await _uow.Offerings.AsQueryable()
                                .AnyAsync(o => o.Id == offering.Id);

            if (!offeringExist)
            {
                return(new ServiceResult($"Offering with id: {offering.Id} - not found."));
            }

            var offeringNameOccupied = await _uow.Offerings.AsQueryable()
                                       .AnyAsync(o => o.Name == offering.Name &&
                                                 o.FamilyId == offering.FamilyId &&
                                                 o.Id != offering.Id);

            if (offeringNameOccupied)
            {
                return(new ServiceResult($"Offering with name: {offering.Name} - already exist."));
            }

            await _uow.Offerings.Update(offering);

            await _uow.CommitAsync();

            return(new ServiceResult());
        }
Exemple #4
0
        /// <summary>
        /// Jared Greenfield
        /// Created: 2018/02/09
        ///
        /// Updates an Offering with a new Offering.
        /// </summary>
        ///
        /// <param name="oldOffering">The old Offering.</param>
        /// <param name="newOffering">The updated Offering.</param>
        /// <exception cref="SQLException">Insert Fails (example of exception tag)</exception>
        /// <returns>Rows affected.</returns>
        public int UpdateOffering(Offering oldOffering, Offering newOffering)
        {
            int        result  = 0;
            string     cmdText = @"sp_update_offering";
            var        conn    = DBConnection.GetDbConnection();
            SqlCommand cmd1    = new SqlCommand(cmdText, conn);

            cmd1.CommandType = CommandType.StoredProcedure;
            cmd1.Parameters.AddWithValue("@OfferingID", oldOffering.OfferingID);

            cmd1.Parameters.AddWithValue("@OldOfferingTypeID", oldOffering.OfferingTypeID);
            cmd1.Parameters.AddWithValue("@OldEmployeeID", oldOffering.EmployeeID);
            cmd1.Parameters.AddWithValue("@OldDescription", oldOffering.Description);
            cmd1.Parameters.AddWithValue("@OldPrice", oldOffering.Price);
            cmd1.Parameters.AddWithValue("@OldActive", oldOffering.Active);

            cmd1.Parameters.AddWithValue("@NewOfferingTypeID", newOffering.OfferingTypeID);
            cmd1.Parameters.AddWithValue("@NewEmployeeID", newOffering.EmployeeID);
            cmd1.Parameters.AddWithValue("@NewDescription", newOffering.Description);
            cmd1.Parameters.AddWithValue("@NewPrice", newOffering.Price);
            cmd1.Parameters.AddWithValue("@NewActive", newOffering.Active);
            try
            {
                conn.Open();
                var temp = cmd1.ExecuteNonQuery();
                result = Convert.ToInt32(temp);
            }
            catch (Exception)
            {
                throw;
            }
            return(result);
        }
Exemple #5
0
 /// <summary>
 /// Author: Jared Greenfield
 /// Created On: 03/28/2019
 /// Construtcts the window to do it's crud function
 /// </summary>
 public frmOffering(DataObjects.CrudFunction type, Offering offering, Employee employee)
 {
     InitializeComponent();
     _offering        = offering;
     _offeringManager = new OfferingManager();
     _employee        = employee;
     _eventManager    = new LogicLayer.EventManager();
     try
     {
         List <string> types = _offeringManager.RetrieveAllOfferingTypes();
         cboOfferingType.Items.Clear();
         foreach (var item in types)
         {
             cboOfferingType.Items.Add(item);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Unable to load Offering Types.");
     }
     if (type == CrudFunction.Retrieve)
     {
         setupReadOnly();
     }
 }
Exemple #6
0
        private async Task <ServiceResult> CreateOfferingAsync(Offering offering)
        {
            var familyExist = await _uow.Families.AsQueryable()
                              .AnyAsync(f => f.Id == offering.FamilyId);

            if (!familyExist)
            {
                return(new ServiceResult($"Family with id: {offering.FamilyId} - not found."));
            }

            var offeringExist = await _uow.Offerings.AsQueryable()
                                .AnyAsync(o => o.Name == offering.Name &&
                                          o.FamilyId == offering.FamilyId);

            if (offeringExist)
            {
                return(new ServiceResult($"Offering with name: {offering.Name} - already exist."));
            }

            await _uow.Offerings.Create(offering);

            await _uow.CommitAsync();

            return(new ServiceResult());
        }
Exemple #7
0
    private void FillEditViewForm(bool isEditMode)
    {
        Offering offering = OfferingDB.GetByID(GetFormID());

        if (offering == null)
        {
            HideTableAndSetErrorMessage("Invalid Offering ID");
            return;
        }

        lblId.Text           = offering.OfferingID.ToString();
        lblOffering.Text     = offering.Name;
        txtPopupMessage.Text = offering.PopupMessage;

        if (isEditMode)
        {
        }
        else
        {
        }



        if (isEditMode)
        {
            btnSubmit.Text = "Update";
        }
        else // is view mode
        {
            btnSubmit.Visible = false;
            btnCancel.Text    = "Close";
        }
    }
Exemple #8
0
        public List <Booking> GetAllRequestedBooking(Database.Database pool, Offering poller)
        {
            List <Booking> pollees = pool.Bookings.FindAll(element =>
            {
                if (element.BookingStatus == BookingStatus.BROADCAST && this.IsUnderRoute(poller.CurrentLocation, element.JourneyDetails.Source, poller.JourneyDetails.Destination, element.JourneyDetails.Destination))
                {
                    return(true);
                }
                else
                {
                    if (element.BookingStatus == BookingStatus.PENDING && (element.OffererId.Equals(poller.UserId)))
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
                                                           );

            if (pollees.Count == 0)
            {
                return(null);
            }
            return(pollees);
        }
        public async Task <IActionResult> PutOffering(int id, Offering offering)
        {
            if (id != offering.OfferingId)
            {
                return(BadRequest());
            }

            _context.Entry(offering).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!OfferingExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> CreateOfferingAsync(int courseId, CreateOfferingVM offeringvm)
        {
            var offering = new Offering
            {
                semester = await _context.Semesters.FindAsync(offeringvm.semesterid),
                course   = await _context.Courses.FindAsync(courseId),
                capacity = offeringvm.capacity,
                type     = offeringvm.type
            };

            if (offeringvm.type == "recitation")
            {
                //offeringvm.offeringid is the parent LECTURE offering
                offering.parentcourse = offeringvm.offeringid;
            }
            else
            {
                offering.parentcourse = 0;
            }

            var section = new Section
            {
                room      = offeringvm.room,
                professor = await _context.Professors.FindAsync(offeringvm.professorid),
                offering  = offering
            };

            _context.Offerings.Add(offering);
            _context.Sections.Add(section);
            await _context.SaveChangesAsync();

            return(Redirect("/Admin/Courses/" + courseId + "/Offerings/" + section.Id));
        }
Exemple #11
0
 public void PickUpOffering(Offering offering)
 {
     if (OfferingPickedUp != null)
     {
         OfferingPickedUp(offering);
     }
 }
Exemple #12
0
        public async Task Basic_Post_And_Delete_Offering()
        {
            var departmentId = "0001";
            var courseId     = "001";
            var termId       = "000";

            SetupEntities(departmentId, courseId, termId);

            var offering = new Offering
            {
                SectionName = "A",
                TermId      = termId
            };

            var offeringDTO = new NewOfferingDTO
            {
                Offering = offering,
                CourseId = courseId
            };

            var postResult = await _controller.PostNewOffering(offeringDTO);

            Assert.IsType <CreatedAtActionResult>(postResult.Result);

            var deleteResult = await _controller.DeleteOffering(offering.Id);

            Assert.Equal(offering, deleteResult.Value);

            var getResult = await _controller.GetOffering(offering.Id);

            Assert.Equal(Status.Deleted, getResult.Value.Offering.IsDeletedStatus);
        }
Exemple #13
0
 public void PlaceDownOffering(Offering offering)
 {
     if (OfferingPlacedDown != null)
     {
         OfferingPlacedDown(offering);
     }
 }
Exemple #14
0
 /// <summary>
 /// Author: Jared Greenfield
 /// Created On: 04/10/2019
 /// Update Offering
 /// </summary>
 private void BtnSubmitOffering_Click(object sender, RoutedEventArgs e)
 {
     if (validatePage())
     {
         if (btnSubmitOffering.Content.ToString() == "Submit")
         {
             try
             {
                 Offering newOffering = new Offering(_offering.OfferingID,
                                                     cboOfferingType.SelectedItem.ToString(),
                                                     _employee.EmployeeID,
                                                     txtOfferingDescription.Text,
                                                     Decimal.Parse(txtOfferingPrice.Text, System.Globalization.NumberStyles.Currency),
                                                     (bool)chkOfferingActive.IsChecked);
                 var result = _offeringManager.UpdateOffering(_offering, newOffering);
                 if (result == true)
                 {
                     MessageBox.Show("Update successful");
                     this.DialogResult = true;
                 }
                 else
                 {
                     MessageBox.Show("Update Failed. Try again.");
                 }
             }
             catch (Exception)
             {
                 MessageBox.Show("The Offering could not be updated at this time.");
             }
         }
     }
     else
     {
     }
 }
Exemple #15
0
 public Offering DuplicateOffering(Offering offering)
 {
     return(new Offering
     {
         Id = offering.Id,
         Title = offering.Title,
         Location = offering.Location,
         OfferingDays = offering.OfferingDays,
         Notes = offering.Notes,
         ProfessorId = offering.ProfessorId,
         Professor = offering.Professor,
         CourseId = offering.CourseId,
         Course = offering.Course,
         TermId = offering.TermId,
         Term = new Term
         {
             Id = offering.Term.Id,
             EndDate = offering.Term.EndDate,
             EnrollmentDeadLine = offering.Term.EnrollmentDeadLine,
             EnrollmentDropDeadLine = offering.Term.EnrollmentDropDeadLine,
             IsCurrentTerm = offering.Term.IsCurrentTerm,
             Name = offering.Term.Name,
             Offerings = offering.Term.Offerings,
             PeriodDates = offering.Term.PeriodDates,
             StartDate = offering.Term.StartDate
         },
         Enrollments = offering.Enrollments,
         Schedules = offering.Schedules
     });
 }
        public async Task <ActionResult <Offering> > PostOffering(Offering offering)
        {
            _context.Offerings.Add(offering);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetOffering", new { id = offering.OfferingId }, offering));
        }
Exemple #17
0
        private static Semester bestAchievable(StudyPlan plan)
        {
            int      totalUnits   = plan.Count();
            Offering nextOffering = getNextOffering(totalUnits, currentSemester.offering);

            return(new Semester(currentSemester.year + (totalUnits - 1) / 8, nextOffering));
        }
Exemple #18
0
        /// <summary>
        /// Jared Greenfield
        /// Created: 2018/01/29
        ///
        /// Adds an Offering record to the database.
        /// </summary>
        /// <param name="offering">An Offering object to be added to the database.</param>
        /// <exception cref="SQLException">Insert Fails (example of exception tag)</exception>
        /// <returns>Rows affected.</returns>
        public int InsertOffering(Offering offering)
        {
            int    returnedID = 0;
            var    conn       = DBConnection.GetDbConnection();
            string cmdText    = @"sp_insert_offering";

            try
            {
                SqlCommand cmd1 = new SqlCommand(cmdText, conn);
                cmd1.CommandType = CommandType.StoredProcedure;
                cmd1.Parameters.AddWithValue("@OfferingTypeID", offering.OfferingTypeID);
                cmd1.Parameters.AddWithValue("@EmployeeID", offering.EmployeeID);
                cmd1.Parameters.AddWithValue("@Description", offering.Description);
                cmd1.Parameters.AddWithValue("@Price", offering.Price);
                try
                {
                    conn.Open();
                    var temp = cmd1.ExecuteScalar();
                    returnedID = Convert.ToInt32(temp);
                }
                catch (Exception)
                {
                    throw;
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                conn.Close();
            }
            return(returnedID);
        }
Exemple #19
0
        public void Add_OfferingTermIsNotCurrent_ThrowsArgumentException()
        {
            var term      = FakeOfferingRepository.fall2017;
            var professor = FakeOfferingRepository.peterParker;

            professor.IsDeleted = false;
            var course = FakeOfferingRepository.chess;

            course.IsDeleted = false;

            // Id course 3
            var offering = new Offering
            {
                Title        = "Chess 2018",
                OfferingDays = 2,
                Location     = "Library",
                Course       = course,
                CourseId     = course.Id,
                Professor    = professor,
                ProfessorId  = professor.Id,
                TermId       = term.Id,
                Term         = term
            };

            var ex = Assert.Throws <ArgumentException>(() => _offeringServ.Add(offering));

            Assert.That(ex.Message, Does.Contain("Term").IgnoreCase);
            Assert.That(ex.Message, Does.Contain("current").IgnoreCase);
        }
        public async Task <IActionResult> Edit(int id, [Bind("OfferingId,OfferingDescr,FamilyId")] Offering offering)
        {
            if (id != offering.OfferingId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(offering);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OfferingExists(offering.OfferingId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            ViewData["FamilyId"] = new SelectList(_context.Families, "FamilyId", "FamilyId", offering.FamilyId);
            return(View(offering));
        }
Exemple #21
0
    private void PlaceDownOffering()
    {
        if (_gravesCollider.GravesInCollider.Count > 0)
        {
            List <Gravestone> nearGraves = _gravesCollider.GravesInCollider;

            float      Distance     = Vector2.Distance(playerRB.position, nearGraves[0].transform.position);
            Gravestone closestGrave = nearGraves[0];
            foreach (Gravestone grave in nearGraves)
            {
                if (!grave.currentOffering)
                {
                    if (Vector2.Distance(playerRB.position, grave.transform.position) < Distance)
                    {
                        Distance     = Vector2.Distance(playerRB.position, grave.transform.position);
                        closestGrave = grave;
                    }
                }
            }
            if (!closestGrave.currentOffering)
            {
                Offering offering = collectedOfferings[0];                                 //take the first offering off our list
                offering.gameObject.SetActive(true);                                       //reenable this offering
                offering.transform.position = closestGrave.OfferingPos.transform.position; //and move it our graves offering position
                _placeDownSound.Play();
                closestGrave.RaiseHappiness(offering.HealAmount);                          //heal our grave
                offering.FadeAway(closestGrave);                                           //slowly fade it away
                collectedOfferings.RemoveAt(0);                                            //remove the offering from our list
                Events.current.PlaceDownOffering(offering);

                LevelSceneManager.instance.timeSinceLastMiscPrompt = 0f;
            }
        }
    }
Exemple #22
0
        public void Add_OfferingCourseIsDeleted_ThrowsNonexistingEntityException()
        {
            // Id course 3
            var course = FakeOfferingRepository.chess;

            course.IsDeleted = true;

            var professor = FakeOfferingRepository.peterParker;
            var term      = FakeOfferingRepository.spring2018;

            var offering = new Offering
            {
                Title        = "Chess 2018",
                OfferingDays = 2,
                Location     = "Library",
                Course       = course,
                CourseId     = course.Id,
                Professor    = professor,
                ProfessorId  = professor.Id,
                TermId       = term.Id,
                Term         = term
            };

            var ex = Assert.Throws <ArgumentException>(() => _offeringServ.Add(offering));

            Assert.That(ex.Message, Does.Contain("Course").IgnoreCase);
            Assert.That(ex.Message, Does.Contain("deleted").IgnoreCase);
        }
        /// <summary>
        /// Author: Jared Greenfield
        /// Created : 02/20/2019
        /// This will update the Offering with the new Offering.
        /// </summary>
        /// <param name="oldOffering">The old Offering.</param>
        /// <param name="newOffering">The updated Offering.</param>
        /// <returns>1 if successful, 0 otherwise</returns>
        public int UpdateOffering(Offering oldOffering, Offering newOffering)
        {
            int rowsAffected = 0;

            foreach (var offering in _offerings)
            {
                if (offering.OfferingID == oldOffering.OfferingID &&
                    offering.OfferingTypeID == oldOffering.OfferingTypeID &&
                    offering.Active == oldOffering.Active &&
                    offering.Description == oldOffering.Description &&
                    offering.EmployeeID == oldOffering.EmployeeID &&
                    offering.Price == oldOffering.Price &&
                    oldOffering.OfferingID == newOffering.OfferingID)
                {
                    offering.Active         = newOffering.Active;
                    offering.Description    = newOffering.Description;
                    offering.EmployeeID     = newOffering.EmployeeID;
                    offering.OfferingTypeID = newOffering.OfferingTypeID;
                    offering.Price          = newOffering.Price;
                    rowsAffected            = 1;
                    break;
                }
            }
            return(rowsAffected);
        }
Exemple #24
0
        public void Update(Offering entity)
        {
            var offering = this.SingleOrDefault(o => o.Id == entity.Id);

            offerings.Remove(offering);
            offerings.Add(offering);
        }
Exemple #25
0
    /*Call this when giving this pet a gift to lower their desire. This will give them a new desire.
     *   Does not affect wander.
     * */
    public void AppeaseWithGift(Offering offer)
    {
        if (currentDesire != Desire.Wander)
        {
            if (preferredOffering == offer)
            {
                desireStrength -= 2 * appeaseStrength;
            }
            else
            {
                desireStrength -= appeaseStrength;
            }
        }

        if (preferredOffering == offer)
        {
            Debug.Log("Healing " + petName + "Fully");
            petHealth = 100;
        }
        else
        {
            Debug.Log("Healing " + petName + "25 points");
            petHealth += 25;
            if (petHealth > 100)
            {
                petHealth = 100;
            }
        }
    }
Exemple #26
0
        public async Task <Offering> RequestAsync(OfferingRequest request, IVendorCredentials credentials)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            Offering offering = null;

            var client = _httpClientCreator.Create(credentials);

            var webRequest = new HttpRequestMessage(HttpMethod.Post, _configuration.ServiceUrl)
            {
                Content = new StringContent(_serializer.Serialize(request), Encoding.UTF8, "application/json")
            };

            webRequest.Headers.Add(AuthTokenHeaderKey, _authTokenGenerator.Generate(credentials.Id, credentials.SharedSecret));

            var response = await client.SendAsync(webRequest).ConfigureAwait(false);

            if (response.IsSuccessStatusCode)
            {
                offering = _deserializer.Deserialize <Offering>(response.Content.ReadAsStringAsync().Result);

                offering.Success = true;
            }
            else
            {
                offering = ProcessUnsuccessfulRequest(response);
            }

            return(offering);
        }
    private void PlaceDown(Offering offeringToRemove)
    {
        UIOffering uiOffering = null;

        if (_UIOfferings.Count > 0)
        {
            foreach (UIOffering offering in _UIOfferings.Keys)
            {
                if (offering.CompareTag(offeringToRemove.tag)) //if an offering with this tag already exists, skip it! and add +1 to text
                {
                    uiOffering = offering;
                }
            }
            if (uiOffering)
            {
                if (_UIOfferings[uiOffering] > 1)
                {
                    _UIOfferings[uiOffering] -= 1;
                    uiOffering._text.text     = "x" + _UIOfferings[uiOffering];
                }
                else
                {
                    Destroy(uiOffering.gameObject);
                    _UIOfferings.Remove(uiOffering);
                }
            }
        }
    }
        /// <summary>
        /// Author: Jared Greenfield
        /// Created : 02/20/2019
        /// This will return the Offering with the specified ID.
        /// </summary>
        /// <param name="offeringID">The Id of the Offering we want select.</param>
        /// <returns>Offering object</returns>
        public Offering SelectOfferingByID(int offeringID)
        {
            Offering offering = null;

            offering = _offerings.Find(x => x.OfferingID == offeringID);
            return(offering);
        }
Exemple #29
0
 public Stock(int stock_id, int organisation_id, int offering_id, int qty, int warning_amt)
 {
     this.stock_id     = stock_id;
     this.organisation = new Organisation(organisation_id);
     this.offering     = new Offering(offering_id);
     this.qty          = qty;
     this.warning_amt  = warning_amt;
 }
        public ActionResult DeleteConfirmed(int id)
        {
            Offering offering = db.Offerings.Find(id);

            db.Offerings.Remove(offering);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #31
0
        public void Add(Offering offering)
        {
            SetOfferingProperties(offering);

            ValidateOffering(offering);

            _offeringRepository.Add(offering);
        }
 public OrganisationOfferings(int organisation_offering_id, int organisation_id, int offering_id, decimal price, DateTime date_active)
 {
     this.organisation_offering_id = organisation_offering_id;
     this.organisation = new Organisation(organisation_id);
     this.offering = new Offering(offering_id);
     this.price = price;
     this.date_active = date_active;
 }
Exemple #33
0
 public static IEnumerable <Offering> ActiveFlags(this Offering flag)
 {
     return(Enum.GetValues(typeof(Offering))
            .Cast <Offering>()
            .Where(o =>
                   o != Offering.NONE && o != Offering.ALL &&
                   flag.HasFlag(o)));
 }
    public static Offering[] GetAll(bool isAgedCareResidentTypes, string offering_invoice_type_ids = null, string offering_type_ids = null, bool showDeleted = false, string matchNname = "", bool searchNameOnlyStartsWith = false)
    {
        DataTable tbl = GetDataTable(isAgedCareResidentTypes, offering_invoice_type_ids, offering_type_ids, showDeleted, matchNname, searchNameOnlyStartsWith);

        Offering[] list = new Offering[tbl.Rows.Count];
        for (int i = 0; i < tbl.Rows.Count; i++)
            list[i] = LoadAll(tbl.Rows[i]);

        return list;
    }
 public StaffOfferings(int staff_offering_id, int staff_id, int offering_id, bool is_commission, decimal commission_percent, bool is_fixed_rate, decimal fixed_rate, DateTime date_active)
 {
     this.staff_offering_id = staff_offering_id;
     this.staff = new Staff(staff_id);
     this.offering = new Offering(offering_id);
     this.is_commission = is_commission;
     this.commission_percent = commission_percent;
     this.is_fixed_rate = is_fixed_rate;
     this.fixed_rate = fixed_rate;
     this.date_active = date_active;
 }
    public StockUpdateHistory(int stock_update_history_id, int organisation_id, int offering_id, int qty_added, bool is_created, bool is_deleted, int added_by, DateTime date_added)
    {
        this.stock_update_history_id = stock_update_history_id;
        this.organisation = new Organisation(organisation_id);
        this.offering     = new Offering(offering_id);
        this.qty_added    = qty_added;

        this.is_created = is_created;
        this.is_deleted = is_deleted;

        this.added_by     = added_by == -1 ? null : new Staff(added_by);
        this.date_added   = date_added;
    }
 public InvoiceLine(int invoice_line_id, int invoice_id, int patient_id, int offering_id, decimal quantity, decimal price, decimal tax, string area_treated, string service_reference, int offering_order_id)
 {
     this.invoice_line_id   = invoice_line_id;
     this.invoice_id        = invoice_id;
     this.patient           = new Patient(patient_id);
     this.offering          = offering_id == -1 ? null : new Offering(offering_id);
     this.quantity          = quantity;
     this.price             = price;
     this.tax               = tax;
     this.area_treated      = area_treated;
     this.service_reference = service_reference;
     this.offering_order    = offering_order_id == -1 ? null : new OfferingOrder(offering_order_id);
 }
 public OfferingOrder(int offering_order_id, int offering_id, int organisation_id, int staff_id, int patient_id, int quantity,
             DateTime date_ordered, DateTime date_filled, DateTime date_cancelled, string descr)
 {
     this.offering_order_id = offering_order_id;
     this.offering          = new Offering(offering_id);
     this.organisation      = new Organisation(organisation_id);
     this.staff             = new Staff(staff_id);
     this.patient           = new Patient(patient_id);
     this.quantity          = quantity;
     this.date_ordered      = date_ordered;
     this.date_filled       = date_filled;
     this.date_cancelled    = date_cancelled;
     this.descr             = descr;
 }
 public BookingPatientOffering(int booking_patient_offering_id, int booking_patient_id, int offering_id, int quantity, int added_by, DateTime added_date,
                               bool is_deleted, int deleted_by, DateTime deleted_date, string area_treated)
 {
     this.booking_patient_offering_id = booking_patient_offering_id;
     this.booking_patient             = booking_patient_id == -1 ? null : new BookingPatient(booking_patient_id);
     this.offering                    = offering_id        == -1 ? null : new Offering(offering_id);
     this.quantity                    = quantity;
     this.added_by                    = added_by           == -1 ? null : new Staff(added_by);
     this.added_date                  = added_date;
     this.is_deleted                  = is_deleted;
     this.deleted_by                  = deleted_by         == -1 ? null : new Staff(deleted_by);
     this.deleted_date                = deleted_date;
     this.area_treated                = area_treated;
 }
Exemple #40
0
    public Booking(int booking_id, int entity_id, DateTime date_start, DateTime date_end, int organisation_id, int provider, int patient_id,
                int offering_id, int booking_type_id, int booking_status_id, int booking_unavailability_reason_id, 
                int added_by, DateTime date_created, int booking_confirmed_by_type_id,  int confirmed_by, DateTime date_confirmed, 
                int deleted_by, DateTime date_deleted, int cancelled_by, DateTime date_cancelled, 
                bool is_patient_missed_appt, bool is_provider_missed_appt, bool is_emergency, 
                bool need_to_generate_first_letter, bool need_to_generate_last_letter, bool has_generated_system_letters,
                DateTime arrival_time, string sterilisation_code, int informed_consent_added_by, DateTime informed_consent_date,
                bool is_recurring, DayOfWeek recurring_day_of_week, TimeSpan recurring_start_time, TimeSpan recurring_end_time,
                int note_count, int inv_count)
    {
        this.booking_id                    = booking_id;
        this.entity_id                     = entity_id;
        this.date_start                    = date_start;
        this.date_end                      = date_end;
        this.organisation                  = organisation_id   ==  0 ? null : new Organisation(organisation_id);
        this.provider                      = provider          == -1 ? null : new Staff(provider);
        this.patient                       = patient_id        == -1 ? null : new Patient(patient_id);
        this.offering                      = offering_id       == -1 ? null : new Offering(offering_id);
        this.booking_type_id               = booking_type_id;
        this.booking_status                = booking_status_id == -2 ? null : new IDandDescr(booking_status_id);
        this.booking_unavailability_reason = booking_unavailability_reason_id == -1 ? null : new IDandDescr(booking_unavailability_reason_id);
        this.added_by                      = added_by          == -1 ? null :new Staff(added_by);
        this.date_created                  = date_created;
        this.booking_confirmed_by_type     = booking_confirmed_by_type_id == -1 ? null : new IDandDescr(booking_confirmed_by_type_id);
        this.confirmed_by                  = confirmed_by      == -1 ? null : new Staff(confirmed_by);
        this.date_confirmed                = date_confirmed;
        this.deleted_by                    = deleted_by        == -1 ? null : new Staff(deleted_by);
        this.date_deleted                  = date_deleted;
        this.cancelled_by                  = cancelled_by      == -1 ? null : new Staff(cancelled_by);
        this.date_cancelled                = date_cancelled;
        this.is_patient_missed_appt        = is_patient_missed_appt;
        this.is_provider_missed_appt       = is_provider_missed_appt;
        this.is_emergency                  = is_emergency;
        this.need_to_generate_first_letter = need_to_generate_first_letter;
        this.need_to_generate_last_letter  = need_to_generate_last_letter;
        this.has_generated_system_letters  = has_generated_system_letters;
        this.arrival_time                  = arrival_time;
        this.sterilisation_code            = sterilisation_code;
        this.informed_consent_added_by     = informed_consent_added_by == -1 ? null : new Staff(informed_consent_added_by);
        this.informed_consent_date         = informed_consent_date;
        this.is_recurring                  = is_recurring;
        this.recurring_day_of_week         = recurring_day_of_week;
        this.recurring_start_time          = recurring_start_time;
        this.recurring_end_time            = recurring_end_time;

        this.note_count                    = note_count;
        this.inv_count                     = inv_count;
    }
    public PatientHistory(int patient_history_id, int patient_id, bool is_clinic_patient, bool is_gp_patient, bool is_deleted, bool is_deceased,
                string flashing_text, int flashing_text_added_by, DateTime flashing_text_last_modified_date,
                string private_health_fund, string concession_card_number, DateTime concession_card_expiry_date, bool is_diabetic, bool is_member_diabetes_australia, DateTime diabetic_assessment_review_date, int ac_inv_offering_id, int ac_pat_offering_id,
                string login, string pwd,
                bool is_company, string abn,
                string next_of_kin_name, string next_of_kin_relation, string next_of_kin_contact_info,
                int title_id, string firstname, string middlename, string surname, string nickname, string gender, DateTime dob, int modified_from_this_by, DateTime date_added)
    {
        this.patient_history_id               = patient_history_id;
        this.patient                          = new Patient(patient_id);
        this.is_clinic_patient                = is_clinic_patient;
        this.is_gp_patient                    = is_gp_patient;
        this.is_deleted                       = is_deleted;
        this.is_deceased                      = is_deceased;
        this.flashing_text                    = flashing_text;
        this.flashing_text_added_by           = new Staff(flashing_text_added_by);
        this.flashing_text_last_modified_date = flashing_text_last_modified_date;
        this.private_health_fund              = private_health_fund;
        this.concession_card_number           = concession_card_number;
        this.concession_card_expiry_date      = concession_card_expiry_date;
        this.is_diabetic                      = is_diabetic;
        this.is_member_diabetes_australia     = is_member_diabetes_australia;
        this.diabetic_assessment_review_date  = diabetic_assessment_review_date;
        this.ac_inv_offering                  = ac_inv_offering_id == -1 ? null : new Offering(ac_inv_offering_id);
        this.ac_pat_offering                  = ac_pat_offering_id == -1 ? null : new Offering(ac_pat_offering_id);
        this.login                            = login;
        this.pwd                              = pwd;
        this.is_company                       = is_company;
        this.abn                              = abn;
        this.next_of_kin_name                 = next_of_kin_name;
        this.next_of_kin_relation             = next_of_kin_relation;
        this.next_of_kin_contact_info         = next_of_kin_contact_info;

        this.title                            = new IDandDescr(title_id);
        this.firstname                        = firstname;
        this.middlename                       = middlename;
        this.surname                          = surname;
        this.nickname                         = nickname;
        this.gender                           = gender;
        this.dob                              = dob;
        this.modified_from_this_by            = new Staff(modified_from_this_by);
        this.date_added                       = date_added;
    }
    public BookingPatient(int booking_patient_id, int booking_id, int patient_id, int entity_id, int offering_id, string area_treated, int added_by, DateTime added_date, bool is_deleted, int deleted_by, DateTime deleted_date,
                          bool need_to_generate_first_letter, bool need_to_generate_last_letter, bool has_generated_system_letters, int note_count)
    {
        this.booking_patient_id = booking_patient_id;
        this.booking            = booking_id  == -1 ? null : new Booking(booking_id);
        this.patient            = patient_id  == -1 ? null : new Patient(patient_id);
        this.entity_id          = entity_id;
        this.offering           = offering_id == -1 ? null : new Offering(offering_id);
        this.area_treated       = area_treated;
        this.added_by           = added_by    == -1 ? null : new Staff(added_by);
        this.added_date         = added_date;
        this.is_deleted         = is_deleted;
        this.deleted_by         = deleted_by  == -1 ? null : new Staff(deleted_by);
        this.deleted_date       = deleted_date;

        this.need_to_generate_first_letter = need_to_generate_first_letter;
        this.need_to_generate_last_letter  = need_to_generate_last_letter;
        this.has_generated_system_letters  = has_generated_system_letters;

        this.note_count = note_count;
    }
 public OfferingAlreadyExistsException(Offering offering)
     : base(null, offering)
 {
 }
 protected OfferingException(string message, Offering offering)
     : base(message)
 {
     this.Offering = offering;
 }
Exemple #45
0
 public InvoiceType GetInvoiceType(Offering offering = null, Patient patient = null)
 {
     return GetInvoiceType(
         HealthCardDB.GetActiveByPatientID((patient == null ? this.Patient : patient).PatientID),
         offering == null ? this.Offering : offering,
         patient  == null ? this.Patient  : patient,
         null,
         null,
         -1);
 }
Exemple #46
0
    public InvoiceType GetInvoiceType(HealthCard hc, Offering offering, Patient patient, Hashtable patientsMedicareCountCache, Hashtable epcRemainingCache, int MedicareMaxNbrServicesPerYear)
    {
        if (this.BookingStatus.ID != 0)
            throw new CustomMessageException("Booking already set as : " + BookingDB.GetStatusByID(this.BookingStatus.ID).Descr);

        if (hc != null && hc.Organisation.OrganisationType.OrganisationTypeGroup.ID == 7)
            return InvoiceType.Insurance;

        if (hc == null)
            return InvoiceType.None;

        if (this.provider.Field.ID == 1) // is GP so referreral/EPC is not relevant
        {
            bool isValidMCClaim  = hc.Organisation.OrganisationID == -1 && offering.MedicareCompanyCode.Length > 0;
            bool isValidDVAClaim = hc.Organisation.OrganisationID == -2 && offering.DvaCompanyCode.Length      > 0;
            if (isValidMCClaim || isValidDVAClaim)
                return  (hc.ExpiryDate == DateTime.MinValue || hc.ExpiryDate.Date < DateTime.Today) ? InvoiceType.NoneFromExpired : InvoiceType.Medicare;
        }
        else
        {
            if (!hc.HasEPC(epcRemainingCache))
                return InvoiceType.None;

            bool within1YearOfCard           = this.DateStart.Date >= hc.DateReferralSigned.Date && this.DateStart.Date < hc.DateReferralSigned.Date.AddYears(1); // tested and works!
            bool offeringHasMedicareClaimNbr = offering.MedicareCompanyCode.Length > 0;
            bool offeringHasDVAClaimNbr      = offering.DvaCompanyCode.Length      > 0;

            if (hc.Organisation.OrganisationID == -1 && offeringHasMedicareClaimNbr)
            {
                if (!within1YearOfCard) // in this if block so 'NoneFromExpired' only returned if is medicare/dva card
                    return InvoiceType.NoneFromExpired;

                int maxNbrMedicareServicesPerYear = MedicareMaxNbrServicesPerYear != -1 ? MedicareMaxNbrServicesPerYear : Convert.ToInt32(SystemVariableDB.GetByDescr("MedicareMaxNbrServicesPerYear").Value);
                int nbrMedicareServicesSoFarThisYear = patientsMedicareCountCache == null ?
                    (int)InvoiceDB.GetMedicareCountByPatientAndYear(patient.PatientID, this.DateStart.Year) :
                    (int)patientsMedicareCountCache[patient.PatientID];
                bool belowYearlyMedicareThreshhold = nbrMedicareServicesSoFarThisYear < maxNbrMedicareServicesPerYear;

                bool belowMedicareThisServiceThreshhold = true;
                if (offering.MaxNbrClaimable > 0)
                {
                    //int nbrMedicareThisServiceSoFarThisPeriod = (int)InvoiceDB.GetMedicareCountByPatientAndYear(patient.PatientID, this.DateStart.Year, offering.OfferingID);
                    int nbrMedicareThisServiceSoFarThisPeriod = (int)InvoiceDB.GetMedicareCountByPatientAndDateRange(patient.PatientID, this.DateStart.Date.AddMonths(-1 * offering.MaxNbrClaimableMonths), this.DateStart.Date, offering.OfferingID);
                    belowMedicareThisServiceThreshhold = nbrMedicareThisServiceSoFarThisPeriod < offering.MaxNbrClaimable;
                }

                if (!belowYearlyMedicareThreshhold)
                    return InvoiceType.NoneFromCombinedYearlyThreshholdReached;
                else if (!belowMedicareThisServiceThreshhold)
                    return InvoiceType.NoneFromOfferingYearlyThreshholdReached;
                else // if (belowYearlyMedicareThreshhold && belowMedicareThisServiceThreshhold)
                {

                    HealthCardEPCRemaining[] epcsRemainingForThisType = null;
                    if (epcRemainingCache == null)
                    {
                        epcsRemainingForThisType = HealthCardEPCRemainingDB.GetByHealthCardID(hc.HealthCardID, offering.Field.ID);
                    }
                    else
                    {
                        ArrayList remainingThisField = new ArrayList();
                        HealthCardEPCRemaining[] allRemainingThisHealthCareCard = (HealthCardEPCRemaining[])epcRemainingCache[hc.HealthCardID];
                        if (allRemainingThisHealthCareCard != null)
                            for (int i = 0; i < allRemainingThisHealthCareCard.Length; i++)
                                if (allRemainingThisHealthCareCard[i].Field.ID == offering.Field.ID)
                                    remainingThisField.Add(allRemainingThisHealthCareCard[i]);
                        epcsRemainingForThisType = (HealthCardEPCRemaining[])remainingThisField.ToArray(typeof(HealthCardEPCRemaining));
                    }

                    if (epcsRemainingForThisType.Length > 0 && epcsRemainingForThisType[0].NumServicesRemaining == 0)
                        return InvoiceType.NoneFromExpired;
                    if (epcsRemainingForThisType.Length > 0 && epcsRemainingForThisType[0].NumServicesRemaining > 0)
                        return InvoiceType.Medicare;
                }

            }
            if (hc.Organisation.OrganisationID == -2 && offeringHasDVAClaimNbr)
            {
                if (!within1YearOfCard) // in this if block so 'NoneFromExpired' only returned if is medicare/dva card
                    return InvoiceType.NoneFromExpired;

                bool belowMedicareThisServiceThreshhold = true;
                if (offering.MaxNbrClaimable > 0)
                {
                    //int nbrMedicareThisServiceSoFarThisPeriod = (int)InvoiceDB.GetMedicareCountByPatientAndYear(patient.PatientID, this.DateStart.Year, offering.OfferingID);
                    int nbrMedicareThisServiceSoFarThisPeriod = (int)InvoiceDB.GetMedicareCountByPatientAndDateRange(patient.PatientID, this.DateStart.Date.AddMonths(-1 * offering.MaxNbrClaimableMonths), this.DateStart.Date, offering.OfferingID);
                    belowMedicareThisServiceThreshhold = nbrMedicareThisServiceSoFarThisPeriod < offering.MaxNbrClaimable;
                }

                if (!belowMedicareThisServiceThreshhold)
                    return InvoiceType.NoneFromOfferingYearlyThreshholdReached;
                else // if (belowMedicareThisServiceThreshhold)
                    return InvoiceType.DVA;
            }
        }

        return InvoiceType.None;
    }
Exemple #47
0
    public static Offering[] RemoveByID(Offering[] inList, int offeringIDToRemove)
    {
        System.Collections.ArrayList newList = new System.Collections.ArrayList();
        for (int i = 0; i < inList.Length; i++)
        {
            if (inList[i].OfferingID != offeringIDToRemove)
                newList.Add(inList[i]);
        }

        return (Offering[])newList.ToArray(typeof(Offering));
    }
Exemple #48
0
    public void UpdateMultipliersForOffering(Offering offering)
    {
        hitSplashMultiplier += offering.hitSplashMultiplier;
        hitPhysicalMultiplier += offering.hitPhysicalMultiplier;
        splashRadiusModifier += offering.splashRadiusModifier;

        fireConversionRate += offering.fireConversionRate;
        earthConversionRate += offering.earthConversionRate;
        coldConversionRate += offering.coldConversionRate;

        statusEffectDuration += offering.statuseffectDuration;
        globalStatusChance += offering.statusEffectChance;
    }
 /// <summary>
 /// Adds a Offering to the collection.
 /// </summary>
 /// <param name="offering">The offering to add.</param>
 public void Add(Offering offering)
 {
     //offering.Owner = this;
     List.Add(offering);
 }
Exemple #50
0
    public void SetOffering(Offering offering)
    {
        Debug.Log("Tower get's offering: " + offering.itemName);

        appliedOffering = offering;
        StartOfferingDuration();
    }
 /// <summary>
 /// Removes Offering from the collection.
 /// </summary>
 /// <param name="offering">The offering to remove.</param>
 public void Remove(Offering offering)
 {
     List.Remove(offering);
 }
    protected string[] GetProviderData(Site site, Offering selectedOffering, DateTime fromDate, DateTime endDate, Staff staff, Organisation org, RegisterStaff registerStaff, Booking[] bookings = null, bool incClinic = false)
    {
        int d = 0;

        string[] data = new string[(int)endDate.Subtract(fromDate).TotalDays + 2 + (incClinic ? 1 : 0)];
        if (incClinic)
        {
            data[d] = org.Name;
            d++;
        }
        data[d] = staff.Person.FullnameWithoutMiddlename;
        d++;

        data[d] = staff.Field.Descr;
        d++;

        Organisation[] orgs      = new Organisation[] { org   };
        Staff[]        providers = new Staff[]        { staff };

        if (bookings == null)
            bookings = BookingDB.GetBetween(fromDate, endDate, providers, orgs, null, null);

        // seperate into
        // - individual bookings that can be retrieved by date
        // - recurring  bookings that can be retrieved by day of week
        Hashtable bkRecurringHash = new Hashtable();
        Hashtable bkDateHash      = new Hashtable();
        foreach (Booking curBooking in bookings)
        {
            if (curBooking.Provider != null && curBooking.Provider.StaffID != staff.StaffID)
                continue;
            //if (curBooking.Organisation != null && curBooking.Organisation.OrganisationID != orgs[0].OrganisationID)
            //    continue;

            if (!curBooking.IsRecurring)
            {
                if (bkDateHash[curBooking.DateStart.Date] == null)
                    bkDateHash[curBooking.DateStart.Date] = new ArrayList();
                if (IsWorkingToday(curBooking.DateStart.DayOfWeek, registerStaff))
                    ((ArrayList)bkDateHash[curBooking.DateStart.Date]).Add(curBooking);
            }
            else // curBooking.IsRecurring
            {
                if (bkRecurringHash[curBooking.RecurringDayOfWeek] == null)
                    bkRecurringHash[curBooking.RecurringDayOfWeek] = new ArrayList();
                if (IsWorkingToday(curBooking.RecurringDayOfWeek, registerStaff))
                    ((ArrayList)bkRecurringHash[curBooking.RecurringDayOfWeek]).Add(curBooking);
            }
        }

        for (DateTime curDate = fromDate; curDate < endDate; curDate = curDate.AddDays(1), d++)
        {
            Tuple<DateTime, DateTime> startEndTime = GetStartEndTime(curDate, orgs[0], site);
            Tuple<DateTime, DateTime> orgLunchTime = GetOrgLunchStartTime(curDate, orgs[0]);

            Booking[] todayBookings  = bkDateHash[curDate]                == null ? new Booking[] { } : (Booking[])((ArrayList)bkDateHash[curDate]).ToArray(typeof(Booking));
            Booking[] todayRecurring = bkRecurringHash[curDate.DayOfWeek] == null ? new Booking[] { } : (Booking[])((ArrayList)bkRecurringHash[curDate.DayOfWeek]).ToArray(typeof(Booking));

            if (IsWorkingToday(curDate.DayOfWeek, registerStaff) && IsClinicOpenToday(curDate, orgs[0]))
            {
                //foreach (Booking curBooking in todayBookings)
                //    output1 += "<tr><td></td><td>" + curBooking.BookingID + "</td><td>" + curBooking.BookingTypeID + "</td><td style=\"white-space:nowrap;\">" + (curBooking.Organisation == null ? "" : curBooking.Organisation.Name) + "</td><td style=\"white-space:nowrap;\">" + (curBooking.Provider == null ? "" : curBooking.Provider.Person.FullnameWithoutMiddlename) + "</td><td style=\"white-space:nowrap;\">" + curBooking.DateStart.ToString("dd MMM yyyy") + "</td><td style=\"white-space:nowrap;\">" + "[" + curBooking.DateStart.ToString("HH:mm") + " - " + curBooking.DateEnd.ToString("HH:mm") + "]" + "</td></tr>";
                //
                //foreach (Booking curBooking in todayRecurring)
                //    if (curDate >= curBooking.DateStart.Date && curDate <= curBooking.DateEnd.Date)
                //        output1 += "<tr><td> <b>R</b> </td><td>" + curBooking.BookingID + "</td><td>" + curBooking.BookingTypeID + "</td><td style=\"white-space:nowrap;\">" + (curBooking.Organisation == null ? "" : curBooking.Organisation.Name) + "</td><td style=\"white-space:nowrap;\">" + (curBooking.Provider == null ? "" : curBooking.Provider.Person.FullnameWithoutMiddlename) + "</td><td style=\"white-space:nowrap;\">" + curBooking.DateStart.ToString("dd MMM yyyy") + "</td><td style=\"white-space:nowrap;\">" + "[" + new DateTime(curBooking.RecurringStartTime.Ticks).ToString("HH:mm") + " - " + new DateTime(curBooking.RecurringEndTime.Ticks).ToString("HH:mm") + "]" + "</td></tr>";

                // list of all TAKEN times
                List<Tuple<DateTime, DateTime>> dateRows = new List<Tuple<DateTime, DateTime>>();

                // add lunch breaks
                if (site.LunchStartTime < site.LunchEndTime)
                    AddToDateRows(ref dateRows, startEndTime, curDate.Add(site.LunchStartTime), curDate.Add(site.LunchEndTime));
                if (orgLunchTime.Item1 < orgLunchTime.Item2)
                    AddToDateRows(ref dateRows, startEndTime, orgLunchTime.Item1, orgLunchTime.Item2);

                // add individual bookings/unavailabilities
                foreach (Booking curBooking in todayBookings)
                    AddToDateRows(ref dateRows, startEndTime, curBooking.DateStart, curBooking.DateEnd);

                // add recurring bookings/unavailabilities
                foreach (Booking curBooking in todayRecurring)
                {
                    if ((curBooking.DateStart != DateTime.MinValue && curDate < curBooking.DateStart.Date) || (curBooking.DateEnd != DateTime.MinValue && curDate > curBooking.DateEnd.Date))
                        continue;

                    DateTime bkStart = curDate.Add(curBooking.RecurringStartTime);
                    DateTime bkEnd = curDate.Add(curBooking.RecurringEndTime);
                    AddToDateRows(ref dateRows, startEndTime, bkStart, bkEnd);
                }

                dateRows = SortAndRemoveOverlaps(dateRows);

                // list of all AVAILABLE times
                List<Tuple<DateTime, DateTime>> availableTimeRows = GetAvailableTimes(startEndTime, dateRows);
                //output1 += "<tr><td colspan=\"7\"><u>Available Times:</u><br />" + PrintList(availableTimeRows) + "</td></tr>";

                // remove times when the space available is less than the default minutes set for the offering selected
                for (int i = availableTimeRows.Count - 1; i >= 0; i--)
                    if (availableTimeRows[i].Item2.Subtract(availableTimeRows[i].Item1).TotalMinutes < selectedOffering.ServiceTimeMinutes)
                        availableTimeRows.RemoveAt(i);
                //output1 += "<tr><td colspan=\"7\"><u>Available Times:</u><br />" + PrintList(availableTimeRows) + "</td></tr>";

                if (availableTimeRows.Count > 0)
                {
                    string bookingSheetLink = IsLoggedIn() ?
                        "<a href= \"" + Booking.GetLink(curDate, new int[] { orgs[0].OrganisationID }) + "\"><img src=\"/images/Calendar-icon-24px.png\" alt=\"Go To Booking Sheet\" title=\"Go To Booking Sheet\"></a>" :
                        "<a href= \"/Account/CreateNewPatientV2.aspx?id=" + Request.QueryString["id"] + "&from_url=" + Server.UrlEncode(Booking.GetLink(curDate, new int[] { orgs[0].OrganisationID })) + "\"><img src=\"/images/Calendar-icon-24px.png\" alt=\"Go To Booking Sheet\" title=\"Go To Booking Sheet\"></a>";

                    data[d] = "<td style=\"background:#ffffff !important; border-left:none !important;border-right:none !important;min-width:45px;\"></td><td style=\"background:#ffffff !important; white-space:nowrap;border-left:none !important;border-right:none !important;\"><u>Available Times</u><br />" + PrintList(availableTimeRows, org.OrganisationID, staff.StaffID) + "</td><td style=\"background:#ffffff !important; border-left:none !important;border-right:none !important;min-width:18px;\"></td><td style=\"background:#ffffff !important; border-left:none !important;\">" + bookingSheetLink + "</td>";
                }
                else
                    data[d] = "<td style=\"border-left:none !important;\" colspan=\"4\">Unavailable</td>";
            }
            else
            {
                data[d] = "<td style=\"border-left:none !important;\" colspan=\"4\">Unavailable</td>";
            }

        }

        return data;
    }
Exemple #53
0
 public void SetDropItem(Offering dropItem)
 {
     item = dropItem;
 }
Exemple #54
0
 public static Offering[] GetOfferingsByOrg(string organisation_ids)
 {
     DataTable tbl = GetDataTable_OfferingsByOrg(organisation_ids);
     Offering[] list = new Offering[tbl.Rows.Count];
     for (int i = 0; i < tbl.Rows.Count; i++)
         list[i] = OfferingDB.LoadAll(tbl.Rows[i]);
     return list;
 }
 public static Offering[] GetAllNotInc(Offering[] excList)
 {
     DataTable tbl = GetDataTable_AllNotInc(excList);
     return LoadFull(tbl);
 }
Exemple #56
0
    private void EndOfferingDuration()
    {
        towerRenderer.material.color = Color.gray;

        clipMaxSizeModifier -= appliedOffering.clipSizeModifier;
        clipDelayTimeModifier -= appliedOffering.clipDelayTimeModifier;
        reloadTimeModifier -= appliedOffering.reloadRateModifier;
        numberOfTargetsModifier -= appliedOffering.numberOfTargetsModifier;
        targetRadiusMultiplier -= appliedOffering.targetRadiusMultiplier;

        targetRadiusArea.radius = targetRadiusBase * (targetRadiusMultiplier +1);

        appliedOffering = null;
    }
    public static DataTable GetDataTable_AllNotInc(Offering[] excList)
    {
        string notInList = string.Empty;
        foreach (Offering o in excList)
            notInList += o.OfferingID.ToString() + ",";
        if (notInList.Length > 0)
            notInList = notInList.Substring(0, notInList.Length - 1);

        string sql = JoinedSql + " AND o.is_deleted = 0 " + ((notInList.Length > 0) ? " AND o.offering_id NOT IN (" + notInList + @") " : "");

        return DBBase.ExecuteQuery(sql).Tables[0];
    }
Exemple #58
0
    private void SpawnDropItem(Offering dropItem)
    {
        Vector3 dropPosition = this.transform.position;
        dropPosition.y = 0.25f;
        Vector3 rotation = new Vector3(45,0,0);

        DropItem item = Instantiate(LevelController.Instance.dropItemPrefab, dropPosition, Quaternion.Euler(rotation)) as DropItem;
        item.SetDropItem(dropItem);
    }
 public static Offering[] GetOfferingsByOrg(bool only_active, string organisation_ids, string offering_invoice_type_ids = null, string offering_type_ids = null)
 {
     DataTable tbl = GetDataTable_OfferingsByOrg(only_active, organisation_ids, offering_invoice_type_ids, offering_type_ids);
     Offering[] list = new Offering[tbl.Rows.Count];
     for (int i = 0; i < tbl.Rows.Count; i++)
         list[i] = OfferingDB.LoadAll(tbl.Rows[i]);
     return list;
 }
    public static Offering[] LoadFull(DataTable tbl)
    {
        Offering[] list = new Offering[tbl.Rows.Count];
        for (int i = 0; i < tbl.Rows.Count; i++)
            list[i] = LoadAll(tbl.Rows[i]);

        return list;
    }