StudySiteItemViewModel NewSiteDataVM() { var newSite = new StudySiteItemModel { AllLocalSites = _appModel }; var newVm = new StudySiteItemViewModel(newSite); newVm.PropertyChanged += NewSiteDataVm_PropertyChanged; return(newVm); }
public static BlowTrial.Domain.Tables.StudyCentre MapToStudySite(StudySiteItemModel s) { return(new BlowTrial.Domain.Tables.StudyCentre { ArgbBackgroundColour = s.SiteBackgroundColour.Value.ToInt(), ArgbTextColour = s.SiteTextColour.ToInt(), IsCurrentlyEnrolling = s.IsCurrentlyEnrolling, IsOpvInIntervention = s.IsOpvInIntervention, IsToHospitalDischarge = s.IsToHospitalDischarge, Id = s.Id.Value, DefaultAllocation = s.DefaultAllocation, HospitalIdentifierMask = s.HospitalIdentifierMask, MaxIdForSite = s.Id.Value + s.MaxParticipantAllocations.Value - (s.Id == 1 ? 2 : 1), Name = s.SiteName, PhoneMask = s.PhoneMask, DuplicateIdCheck = (s.DuplicateIdCheck == Guid.Empty) ? Guid.NewGuid() : s.DuplicateIdCheck }); }
public StudySiteItemViewModel(StudySiteItemModel siteModel) { SiteModel = siteModel; CanAlterId = true; }