/// <summary>
        /// Confirms all relation requests to the citizen whose Id matches the given citizenId
        /// </summary>
        /// <param name="citizenId">Citizen Id</param>
        public void ConfirmAllRelatives(long citizenId)
        {
            var relatives = GetRelatives(citizenId);

            foreach (var relative in relatives)
            {
                DBEntities.Entry(relative).State = EntityState.Modified;
                relative.CitizenConfirmed        = true;
                relative.RelativeConfirmed       = true;
            }
            DBEntities.SaveChanges();
        }
示例#2
0
        /// <summary>
        /// update available rooms count for specific medical place
        /// and update time to be last time updated
        /// </summary>
        /// <param name="careUnits">care units that are being updated</param>
        public void UpdateAvailableRoomCount(List <CareUnit> careUnits)
        {
            DateTime time = DateTime.Now;

            foreach (CareUnit careUnit in careUnits)
            {
                careUnit.LastUpdate = time;

                DBEntities.CareUnits.Attach(careUnit);

                DBEntities.Entry(careUnit).Property(unit => unit.LastUpdate).IsModified         = true;
                DBEntities.Entry(careUnit).Property(unit => unit.AvailableRoomCount).IsModified = true;
            }
            DBEntities.SaveChanges();
        }
示例#3
0
 /// <summary>
 /// Adds workslot to the database
 /// </summary>
 /// <param name="slot">Workslot</param>
 public void AddWorkSlot(WorkSlot slot)
 {
     DBEntities.WorkSlots.Add(slot);
     DBEntities.SaveChanges();
 }
示例#4
0
 /// <summary>
 /// save an attachment to database
 /// </summary>
 public void SaveAttachment(Attachment attachment)
 {
     DBEntities.Attachments.Add(attachment);
     DBEntities.SaveChanges();
 }
 /// <summary>
 /// Add new Pharmacy to Pharmacies in database
 /// </summary>
 /// <param name="pharmacy">A Pharmacy object</param>
 public void AddPharmacy(Pharmacy pharmacy)
 {
     DBEntities.Pharmacies.Add(pharmacy);
     DBEntities.SaveChanges();
 }
 /// <summary>
 ///  Add new SOS to SOSses table in database
 /// </summary>
 /// <param name="sos">A SOSs object</param>
 public void AddSOS(SOSs sos)
 {
     DBEntities.SOSses.Add(sos);
     DBEntities.SaveChanges();
 }