public GeneratorViewModel(DataStoreItem item) : base(item) { foreach (Elution l in ((Generator)item).Elutions) { Elutions.Add(l); } (item as Generator).GeneratorEluting += GeneratorEluting; (item as Generator).GeneratorEluted += GeneratorEluted; ElutionDate = DateTime.Now; ElutionExpiryDate = DateTime.Now.AddDays(1); AddElutionCommand = new RelayCommand(MakeElution); }
public void Elute(double volume, double activity, double moly, DateTime ElutionDate, DateTime ExpiryDate, string batchNumber) { Elution result = new Elution(); result.Creator = iRadiate.DataModel.Common.DataStoreItem.CurrentUser; result.Radiopharmaceutical = _product; result.Volume = volume; result.Breakthrough = moly; result.Generator = this; result.ManufacturerBatchNumber = batchNumber; result.Supplier = "In-house"; result.Manufacturer = "In-house"; result.CalibrationActivity = activity; result.CalibrationDate = ElutionDate; result.ExpiryDate = ExpiryDate; OnGeneratorEluting(new NewDataStoreItemEventArgs(result)); Elutions.Add(result); OnGeneratorEluted(new NewDataStoreItemEventArgs(result)); }
private void GeneratorEluted(object sender, NewDataStoreItemEventArgs e) { Elutions.Add(e.NewItem as Elution); RaisePropertyChanged("Elutions"); }