public virtual void SaveItem() { try { DesktopApplication.Librarian.SaveItem(Item); //EditButtonVisible = true; //SaveButtonVisible = false; Close(); } catch (Exception ex) { if (ex.InnerException == null) { DesktopApplication.ShowDialog("Error caught", ex.Message); } else { DesktopApplication.ShowDialog("Error caught", ex.Message + "; inner exception: " + ex.InnerException.Message); } } }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var app = DesktopApplication.Create("Test Desktop Application"); //app.AddModule<SavedXrmConnectionsModule>(); app.AddModule <TestTextSearchModule>(); app.AddModule <TestDialogModule>(); app.AddModule <SavedXrmConnectionsModule>(); app.AddModule <DebugDialogModule>(); //app.AddModule<XrmSettingsModule>(); app.AddModule <TestSettingsModule>(); app.AddModule <TestCrudModule>(); app.AddModule <SavedRequestModule>(); app.AddModule <ConsoleApplicationModule>(); app.AddModule <TestGridEditModule>(); app.AddModule <ThemeModule>(); app.AddModule <AllPropertyTypesDialogModule>(); app.AddModule <AllPropertyTypesCompactModule>(); app.AddModule <TestAppAboutModule>(); app.Run(); }
private void PrintButton_Click(object sender, RoutedEventArgs e) { PreCalTimeBox.Visibility = Visibility.Visible; PreCalTimePicker.Visibility = Visibility.Hidden; var printDialog = new PrintDialog(); if (Properties.Settings.Default.ConfirmPrinterForLabels) { if (printDialog.ShowDialog() == true) { MainDockPanel.Children.Clear(); FlowDocument fd = new FlowDocument(); fd.DataContext = MainDockPanel.DataContext; fd.Blocks.Add(new BlockUIContainer(LabelGrid)); fd.PagePadding = new Thickness(20); fd.PageHeight = printDialog.PrintableAreaHeight; fd.PageWidth = printDialog.PrintableAreaWidth; var paginator = ((IDocumentPaginatorSource)fd).DocumentPaginator; printDialog.PrintDocument(paginator, "Dose Label"); DesktopApplication.CloseActiveWindow(); } } else { MainDockPanel.Children.Clear(); FlowDocument fd = new FlowDocument(); fd.DataContext = MainDockPanel.DataContext; fd.Blocks.Add(new BlockUIContainer(LabelGrid)); fd.PagePadding = new Thickness(20); fd.PageHeight = printDialog.PrintableAreaHeight; fd.PageWidth = printDialog.PrintableAreaWidth; var paginator = ((IDocumentPaginatorSource)fd).DocumentPaginator; printDialog.PrintDocument(paginator, "Dose Label"); DesktopApplication.CloseActiveWindow(); } }
private void GetLogEntries() { LogEntries.Clear(); if (LogEndDate <= LogStartDate) { DesktopApplication.ShowDialog("Error", "Start date must be earlier than end date"); return; } using (SqlConnection tmpCon = new SqlConnection(Properties.Settings.Default.InterfaceConnString)) { tmpCon.Open(); SqlCommand command = new SqlCommand("SELECT * FROM system_logging WHERE entered_date > '" + LogStartDate.ToString("yyyy-MM-dd HH:mm:ss") + "' AND log_date < '" + LogEndDate.ToString("yyyy-MM-dd HH:mm:ss") + "'", tmpCon); //command.Parameters.AddWithValue("@StartDate", LogStartDate); //SqlParameter startDateParam = new SqlParameter("@StartDate", SqlDbType.DateTime); //startDateParam.Value = LogStartDate; // SqlParameter endDateParam = new SqlParameter("@EndDate", SqlDbType.DateTime); //endDateParam.Value = endDateParam; //command.Parameters.Add(startDateParam); //command.Parameters.Add(endDateParam); //command.Parameters.AddWithValue("@EndDate", LogEndDate); SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { //reader.Read(); LogEntry entry = new LogEntry(); entry.LogCallSite = reader["log_call_site"].ToString(); entry.LogDate = reader["log_date"].ToString(); //entry.LogDate= reader.GetDateTime(reader.GetOrdinal("log_date")); entry.LogException = reader["log_exception"].ToString(); entry.LogLevel = reader["log_level"].ToString(); entry.LogLogger = reader["log_logger"].ToString(); entry.LogMessage = reader["log_message"].ToString(); entry.LogStackTrace = reader["log_stacktrace"].ToString(); LogEntries.Add(entry); } } }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var app = DesktopApplication.Create("JosephM Xrm Developer Tool"); app.AddModule <SavedXrmConnectionsModule>(); app.AddModule <DeploymentModule>(); app.AddModule <CodeGeneratorModule>(); app.AddModule <XrmRecordExtractModule>(); app.AddModule <XrmTextSearchModule>(); app.AddModule <CustomisationExporterModule>(); app.AddModule <CustomisationImportModule>(); app.AddModule <InstanceComparerModule>(); app.AddModule <RecordCountsModule>(); app.AddModule <XrmCrudModule>(); app.AddModule <SavedRequestModule>(); app.AddModule <ConsoleApplicationModule>(); app.AddModule <XrmDeveloperToolAboutModule>(); app.AddModule <DevAppReleaseCheckModule>(); app.AddModule <SavedConnectionAppConnectionModule>(); app.AddModule <ThemeModule>(); app.Run(); }
public void SaveLayout() { Properties.Settings.Default.Save(); DesktopApplication.ShowToastInformation("Whiteboard layout saved", DesktopApplication.NotificationPosition.BottomLeft); }
public OpenWithFileViewer(DesktopApplication app) { this.app = app; }
private void viewChemical() { DataStoreItemViewModel dvm = new DataStoreItemViewModel((DataStoreItem)SelectedChemical); DesktopApplication.MakeModalDocument(dvm); }
private void addNewInventoryItem() { //Application.ShowDialog("Debug",SelectedInventoryType); if (SelectedInventoryType == "Split Unit Dose") { SplitUnitDose d = new SplitUnitDose(); d.CalibrationDate = DateTime.Now; d.ExpiryDate = DateTime.Now.AddHours(12); d.ItemSaving += InventoryItem_ItemSaved; DesktopApplication.MakeModalDocument(new SplitUnitDoseViewModel(d)); } else if (SelectedInventoryType == "Bulk Tc99m") { Elution bd = new Elution(); bd.CalibrationDate = DateTime.Now; bd.ExpiryDate = DateTime.Now.AddDays(1); bd.ItemSaving += InventoryItem_ItemSaved; System.Diagnostics.Debug.WriteLine("Bulk Dose has been created"); //InventoryItems.Add(bd); //System.Diagnostics.Debug.WriteLine("Bulk Dose added to inventory"); DesktopApplication.MakeModalDocument(new BulkDoseViewModel(bd)); } else if (SelectedInventoryType == "Reconstituted Kit") { ReconstitutedColdKit bd = new ReconstitutedColdKit(); bd.CalibrationDate = DateTime.Now; bd.ExpiryDate = DateTime.Now.AddDays(1); bd.ItemSaving += InventoryItem_ItemSaved; //InventoryItems.Add(bd); //System.Diagnostics.Debug.WriteLine("Bulk Dose added to inventory"); DesktopApplication.MakeModalDocument(new ReconstitutedColdKitViewModel(bd)); } else if (SelectedInventoryType == "Cold Kit") { Kit ck = new Kit(); ck.ExpiryDate = DateTime.Now.AddDays(30); ck.ItemSaving += InventoryItem_ItemSaved; //InventoryItems.Add(bd); //System.Diagnostics.Debug.WriteLine("Bulk Dose added to inventory"); DesktopApplication.MakeModalDocument(new DataStoreItemViewModel(ck)); } else if (SelectedInventoryType == "Generator") { Generator ck = new Generator(); ck.ItemSaving += InventoryItem_ItemSaved; ck.CalibrationDate = DateTime.Now; ck.ExpiryDate = DateTime.Now.AddDays(7); //InventoryItems.Add(bd); //System.Diagnostics.Debug.WriteLine("Bulk Dose added to inventory"); DesktopApplication.MakeModalDocument(new GeneratorViewModel(ck)); } else if (SelectedInventoryType == "Unit Dose") { SyringeUnitDose ck = new SyringeUnitDose(); ck.ItemSaving += InventoryItem_ItemSaved; ck.CalibrationDate = DateTime.Now; ck.ExpiryDate = DateTime.Now.AddDays(1); //InventoryItems.Add(bd); //System.Diagnostics.Debug.WriteLine("Bulk Dose added to inventory"); DesktopApplication.MakeModalDocument(new BaseUnitDoseViewModel(ck)); } else if (SelectedInventoryType == "Capsule") { CapsuleUnitDose cap = new CapsuleUnitDose(); cap.ItemSaving += InventoryItem_ItemSaved; cap.CalibrationDate = DateTime.Now; cap.ExpiryDate = DateTime.Now.AddDays(1); //InventoryItems.Add(bd); //System.Diagnostics.Debug.WriteLine("Bulk Dose added to inventory"); DesktopApplication.MakeModalDocument(new CapsuleUnitDoseViewModel(cap)); } }
public DefaultDesktopApplication(DesktopApplication application) : base(application.Id, application.DisplayName, isDefault: true) { this.application = application; }
internal AspNetCoreExecutionTarget(DesktopApplication desktopApplication) { DesktopApplication = desktopApplication; Image = Stock.Browser; }
public static async Task Main() { var application = new DesktopApplication <Component1>( appConfiguration: app => app.UseLocalBrowser()); await application.RunAsync(); }
private void editForm() { iRadiate.Desktop.Common.Forms.FormDesignerModule m = new Desktop.Common.Forms.FormDesignerModule(((Form)SelectedForm).FormTemplates.OrderBy(x => x.VersionDate).Last()); DesktopApplication.MakeDocument(m); //DesktopApplication.MainViewModel.LaunchModule(typeof(iRadiate.Desktop.Common.Forms.FormDesignerModule)); }
private void OnInactivity(object sender, EventArgs e) { _inactiveMousePosition = Mouse.GetPosition(this); DesktopApplication.FireIdleEvent(); }
protected override void Execute() { PatientViewModel vm = new PatientViewModel(_scanbag.Patient); DesktopApplication.MakeModalDocument(vm, "iRadiate.Desktop.Common", "iRadiate.Desktop.Common.View.PatientView"); }
private void Reschedule() { DesktopApplication.MakeModalDocument(this, "iRadiate.Desktop.Common", "iRadiate.Desktop.Common.View.RescheduleTaskView"); }
public BrowserExecutionTarget(string id, string displayName, DesktopApplication app) { this.name = displayName; this.id = id; this.DesktopApp = app; }
internal AspNetCoreExecutionTarget(DesktopApplication desktopApplication) { DesktopApplication = desktopApplication; }
internal FileViewer(DesktopApplication app) { this.app = app; }
public UserDefinedOpenWithFileViewer(DesktopApplication app) : base(app) { }
private void MilkGenerator() { DesktopApplication.MakeModalDocument(new MilkGeneratorViewModel(SelectedInventoryItem as Generator)); }
private void Button_Click(object sender, RoutedEventArgs e) { DesktopApplication.ShowToastInformation("button clicked", DesktopApplication.NotificationPosition.BottomRight); }
private void viewKitDefinition() { DesktopApplication.MakeModalDocument(new DataStoreItemViewModel(SelectedKitDefinition as DataStoreItem)); }
public void LaunchDataStoreItem(DataStoreItemViewModel ItemViewModel) { DesktopApplication.MakeModalDocument(ItemViewModel); }
private void saveBridge() { if (ID != 0) { using (SqlConnection conn = new SqlConnection()) { conn.ConnectionString = Properties.Settings.Default.InterfaceConnString; conn.Open(); string cmdString = "UPDATE StudyTypeBridges SET ForeignKey = @ForeignKey, " + "ForeignName = @ForeignName, LocalKey = @LocalKey, IsFollowUp = @IsFollowUp, " + "FollowUpRange = @FollowUpRange, NumberOfInjections = @NumberOfInjections, NumberOfScans = @NumberOfScans, " + "Injection1Delay = @Injection1Delay, Injection2Delay = @Injection2Delay, Injection1RadiopharmaceuticalID = @Injection1ID, " + "Injection2RadiopharmaceuticalID = @Injection2ID, Injection1Activity = @Injection1Activity, Injection2Activity = @Injection2Activity, " + "Scan1Delay = @Scan1Delay, Scan1RoomID = @Scan1RoomID, Scan1Duration = @Scan1Duration, " + "Scan2Delay = @Scan2Delay, Scan2RoomID = @Scan2RoomID, Scan2Duration = @Scan2Duration, " + "Injection1Route = @Injection1Route, Injection2Route = @Injection2Route " + "WHERE ID = @ID"; SqlCommand insertCommand = new SqlCommand(cmdString, conn); insertCommand.Parameters.AddWithValue("@ForeignKey", ForeignKey); insertCommand.Parameters.AddWithValue("@ForeignName", ForeignName); insertCommand.Parameters.AddWithValue("@LocalKey", LocalKey); insertCommand.Parameters.AddWithValue("@IsFollowUp", IsFollowUp); insertCommand.Parameters.AddWithValue("@FollowupRange", Range); insertCommand.Parameters.AddWithValue("@ID", ID); insertCommand.Parameters.AddWithValue("@NumberOfInjections", NumInjections); insertCommand.Parameters.AddWithValue("@NumberOfScans", NumScans); if (NumInjections == 1) { insertCommand.Parameters.AddWithValue("@Injection1Delay", InjectionDetails[0].InjectionDelay); //DesktopApplication.ShowDialog("Info", InjectionDetails[0].Radiopharmaceutical.Name); insertCommand.Parameters.AddWithValue("@Injection1ID", InjectionDetails[0].Radiopharmaceutical.ID); //insertCommand.Parameters.AddWithValue("@Injection1ID", 0); insertCommand.Parameters.AddWithValue("@Injection1Activity", InjectionDetails[0].InjectionActivity); if (InjectionDetails[0].AdministrationRoute.HasValue) { insertCommand.Parameters.AddWithValue("@Injection1Route", (int)InjectionDetails[0].AdministrationRoute); } else { insertCommand.Parameters.AddWithValue("@Injection1Route", DBNull.Value); } insertCommand.Parameters.AddWithValue("@Injection2Delay", 0); insertCommand.Parameters.AddWithValue("@Injection2ID", 0); insertCommand.Parameters.AddWithValue("@Injection2Activity", 0); insertCommand.Parameters.AddWithValue("@Injection2Route", DBNull.Value); } else if (NumInjections == 2) { insertCommand.Parameters.AddWithValue("@Injection1Delay", InjectionDetails[0].InjectionDelay); insertCommand.Parameters.AddWithValue("@Injection1ID", InjectionDetails[0].Radiopharmaceutical.ID); insertCommand.Parameters.AddWithValue("@Injection1Activity", InjectionDetails[0].InjectionActivity); if (InjectionDetails[0].AdministrationRoute.HasValue) { insertCommand.Parameters.AddWithValue("@Injection1Route", (int)InjectionDetails[0].AdministrationRoute); } else { insertCommand.Parameters.AddWithValue("@Injection1Route", DBNull.Value); } insertCommand.Parameters.AddWithValue("@Injection2Delay", InjectionDetails[1].InjectionDelay); insertCommand.Parameters.AddWithValue("@Injection2ID", InjectionDetails[1].Radiopharmaceutical.ID); insertCommand.Parameters.AddWithValue("@Injection2Activity", InjectionDetails[1].InjectionActivity); if (InjectionDetails[1].AdministrationRoute.HasValue) { insertCommand.Parameters.AddWithValue("@Injection2Route", (int)InjectionDetails[1].AdministrationRoute); } else { insertCommand.Parameters.AddWithValue("@Injection2Route", DBNull.Value); } } else { insertCommand.Parameters.AddWithValue("@Injection1Delay", 0); insertCommand.Parameters.AddWithValue("@Injection1ID", 0); insertCommand.Parameters.AddWithValue("@Injection1Activity", 0); insertCommand.Parameters.AddWithValue("@Injection1Route", DBNull.Value); insertCommand.Parameters.AddWithValue("@Injection2Delay", 0); insertCommand.Parameters.AddWithValue("@Injection2ID", 0); insertCommand.Parameters.AddWithValue("@Injection2Activity", 0); insertCommand.Parameters.AddWithValue("@Injection2Route", DBNull.Value); } if (NumScans == 1) { insertCommand.Parameters.AddWithValue("@Scan1Delay", ScanDetails[0].ScanDelay); insertCommand.Parameters.AddWithValue("@Scan1RoomID", ScanDetails[0].Room.ID); insertCommand.Parameters.AddWithValue("@Scan1Duration", ScanDetails[0].ScanDuration); insertCommand.Parameters.AddWithValue("@Scan2Delay", 0); insertCommand.Parameters.AddWithValue("@Scan2RoomID", 0); insertCommand.Parameters.AddWithValue("@Scan2Duration", 0); } else if (NumScans == 2) { insertCommand.Parameters.AddWithValue("@Scan1Delay", ScanDetails[0].ScanDelay); insertCommand.Parameters.AddWithValue("@Scan1RoomID", ScanDetails[0].Room.ID); insertCommand.Parameters.AddWithValue("@Scan1Duration", ScanDetails[0].ScanDuration); insertCommand.Parameters.AddWithValue("@Scan2Delay", ScanDetails[1].ScanDelay); insertCommand.Parameters.AddWithValue("@Scan2RoomID", ScanDetails[1].Room.ID); insertCommand.Parameters.AddWithValue("@Scan2Duration", ScanDetails[1].ScanDuration); } else { insertCommand.Parameters.AddWithValue("@Scan1Delay", 0); insertCommand.Parameters.AddWithValue("@Scan1RoomID", 0); insertCommand.Parameters.AddWithValue("@Scan1Duration", 0); insertCommand.Parameters.AddWithValue("@Scan2Delay", 0); insertCommand.Parameters.AddWithValue("@Scan2RoomID", 0); insertCommand.Parameters.AddWithValue("@Scan2Duration", 0); } if (insertCommand.ExecuteNonQuery() > 0) { DesktopApplication.ShowDialog("Saved", "Interface updated."); conn.Close(); } else { DesktopApplication.ShowDialog("Error", "Interface failed to save."); conn.Close(); } } } }
private void ViewAppointment() { DesktopApplication.MakeDocument(Appointment); }