Example #1
0
        /// <summary>
        /// Update fields passed in
        /// Updates all fields to be the values passed in
        /// Does NOT update the ID field, this allows for the method to be used as part of a copy.
        /// Does NOT update the Date field, this allows for the method to be used as part of a copy.
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public bool Update(ClinicModel data)
        {
            if (data == null)
            {
                return(false);
            }

            // Don't update the ID, leave the old one in place
            // ID = data.ID;

            // Don't update the Date, leave the old one in place
            // Date = data.Date;

            // Update all the other fields
            Name      = data.Name;
            Address   = data.Address;
            City      = data.City;
            Country   = data.Country;
            Contact   = data.Contact;
            Phone     = data.Phone;
            Email     = data.Email;
            WhatsApp  = data.WhatsApp;
            Notes     = data.Notes;
            Latitude  = data.Latitude;
            Longitude = data.Longitude;

            return(true);
        }
Example #2
0
 /// <summary>
 /// Makes a copy of the data
 /// </summary>
 /// <param name="data"></param>
 public ClinicModel(ClinicModel data)
 {
     // Because this is a copy, let it have a new ID
     Update(data);
 }