/// <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(PhoneModel 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 ClinicID = data.ClinicID; DeviceModel = data.DeviceModel; SerialNumber = data.SerialNumber; Description = data.Description; ModelNumber = data.ModelNumber; LastUsed = data.LastUsed; Status = data.Status; TimeOut = data.TimeOut; ReadingCaptureCount = data.ReadingCaptureCount; TransmitSuccessImage = data.TransmitSuccessImage; TransmitFailImage = data.TransmitFailImage; return(true); }
/// <summary> /// Constructor for class /// </summary> public PhoneSettingsModel(PhoneModel data) { // Get Phone based on the ID passed in PhoneModel = data; // Get the Users that are part of that Clinic // Todo, narrow this down to only the users that make since given the Clinic and Phone UserList = Backend.DataSourceBackend.Instance.TechnicianBackend.Index(); }
/// <summary> /// Makes a copy of the data /// </summary> /// <param name="data"></param> public PhoneModel(PhoneModel data) { // Because this is a copy, let it have a new ID Update(data); }