private void PrintPictureAction(object obj) { var settingData = HelperPrint.GetReportSetting(); SelectedPhoto.STT = PenjualanItem.STT; var listSource = new List <ReportDataSource> { new ReportDataSource { Value = new List <ModelsShared.Photo> { SelectedPhoto }, Name = "DataSet1" }, new ReportDataSource { Value = settingData, Name = "Config" } }; var content = new Reports.Contents.ReportContent(listSource, "TrireksaApp.Reports.Layouts.PrintImageLayout.rdlc", null); var dlg = new ModernWindow { Content = content, Title = "Manifest Outgoing", Style = (Style)App.Current.Resources["BlankWindow"], ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, WindowState = WindowState.Maximized, }; dlg.ShowDialog(); }
private async void PrintPackingListAction(object obj) { var list = await MainVM.ManifestOutgoingCollection.GetPackingList(SelectedItem.Id); var config = HelperPrint.GetReportSetting(); var sources = new List <Microsoft.Reporting.WinForms.ReportDataSource>() { new Microsoft.Reporting.WinForms.ReportDataSource() { Name = "DataSet1", Value = list }, new Microsoft.Reporting.WinForms.ReportDataSource() { Name = "Config", Value = config } }; var content = new Reports.Contents.ReportContent(sources, "TrireksaApp.Reports.Layouts.PackingListLayout.rdlc", null); var dlg = new ModernWindow { Content = content, Title = "Bukti Titipan Kapal", Style = (Style)App.Current.Resources["BlankWindow"], ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, WindowState = WindowState.Maximized, }; dlg.ShowDialog(); }
private void CallReportInvoice(string title, List <ModelsShared.Models.Invoice> data) { var list = new List <InvoiceReport>(); foreach (var item in data) { list.Add(new InvoiceReport(item)); } var content = new Reports.Contents.ReportContent(new Microsoft.Reporting.WinForms.ReportDataSource { Value = list }, "TrireksaApp.Reports.Layouts.InvoiceReportLayout.rdlc", new Microsoft.Reporting.WinForms.ReportParameter[] { new Microsoft.Reporting.WinForms.ReportParameter("Title", new string[] { title }) }); var dlg = new ModernWindow { Content = content, Title = "Nota", Style = (Style)App.Current.Resources["BlankWindow"], ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, WindowState = WindowState.Maximized, }; dlg.ShowDialog(); }
private void PreviewAction() { var listSource = new List <Microsoft.Reporting.WinForms.ReportDataSource>(); var setting = HelperPrint.GetReportSetting(); setting.FirstOrDefault().SignName = ResourcesBase.User.FullName ?? ResourcesBase.User.UserName; listSource.Add(new Microsoft.Reporting.WinForms.ReportDataSource() { Value = Manifest.Source, Name = "DataSet1" }); listSource.Add(new Microsoft.Reporting.WinForms.ReportDataSource() { Value = setting, Name = "Config" }); var content = new Reports.Contents.ReportContent(listSource, "TrireksaApp.Reports.Layouts.ManifestOutgoingLayout.rdlc", null); var dlg = new ModernWindow { Content = content, Title = "Manifest Outgoing", Style = (Style)App.Current.Resources["BlankWindow"], ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, WindowState = WindowState.Maximized, }; dlg.ShowDialog(); }
private void OnButtonClick(object sender, EventArgs e) { var wizard = Resources["Wizard"] as Wizard; if (wizard != null) { wizard.CurrentPage = wizard.Items[0] as WizardPage; wizard.Margin = new Thickness(0, 32, 0, 0); if (m_window != null) { m_window.Content = null; m_window = null; } m_window = new ModernWindow { Style = (Style)App.Current.Resources["EmptyWindow"], Title = "Wizard demonstration", Content = wizard, Width = 600, Height = 400, WindowStartupLocation = WindowStartupLocation.CenterScreen }; // Window will be closed by Wizard because FinishButtonClosesWindow = true and CancelButtonClosesWindow = true m_window.ShowDialog(); } }
private async void PrintTitipanKapalAction(object obj) { var item = await MainVM.ManifestOutgoingCollection.GetTitipanKapal(SelectedItem.Id); if (item != null) { var list = new List <titipankapal>(); list.Add(item); var content = new Reports.Contents.ReportContent(new Microsoft.Reporting.WinForms.ReportDataSource { Value = list }, "TrireksaApp.Reports.Layouts.TitipanKapalLayout.rdlc", null); var dlg = new ModernWindow { Content = content, Title = "Bukti Titipan Kapal", Style = (Style)App.Current.Resources["BlankWindow"], ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, WindowState = WindowState.Maximized, }; dlg.ShowDialog(); } else { ModernDialog.ShowMessage("Data Tidak Ditemukan", "Info", MessageBoxButton.OK); } }
private void PrintTitipanKapalAction(object obj) { var item = SelectedItem; if (item != null && item.Information != null) { var list = new List <Titipankapal> { new Titipankapal { AgentContactName = item.Agent.ContactName, AgentName = item.Agent.Name, AgentHandphone = item.Agent.Handphone, AgentPhone = item.Agent.Phone, ArmadaName = item.Information.ArmadaName, Code = item.Id, CrewAddress = item.Information.Address, Jumlah = item.PackingList.GroupBy(x => x.PackNumber).Count(), CrewContact = item.Information.Contact, CrewName = item.Information.CrewName, Destination = item.DestinationNavigation.Name, Origin = item.OriginNavigation.Name, PackNumber = item.PackingList.GroupBy(x => x.PackNumber).Count(), DestinationCode = item.DestinationNavigation.Code, OriginCode = item.OriginNavigation.Code, PortType = item.PortType, ReferenceNumber = item.Information.ReferenceNumber } }; var config = HelperPrint.GetReportSetting(); var sources = new List <Microsoft.Reporting.WinForms.ReportDataSource>() { new Microsoft.Reporting.WinForms.ReportDataSource() { Name = "DataSet1", Value = list }, new Microsoft.Reporting.WinForms.ReportDataSource() { Name = "Config", Value = config } }; var content = new Reports.Contents.ReportContent(sources, "TrireksaApp.Reports.Layouts.TitipanKapalLayout.rdlc", null); var dlg = new ModernWindow { Content = content, Title = "Bukti Titipan Kapal", Style = (Style)App.Current.Resources["BlankWindow"], ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, WindowState = WindowState.Maximized, }; dlg.ShowDialog(); } else { ModernDialog.ShowMessage("Data Tidak Ditemukan", "Info", MessageBoxButton.OK); } }
private void OnReportViewCommand(object args) { var patientVM = new ReportViewModel(PatientEntity, null); var window = new ModernWindow { Style = (Style)App.Current.Resources["BlankWindow"], Title = "Camera", IsTitleVisible = true, WindowState = WindowState.Maximized }; window.Content = new ReportView(patientVM, window); var closeResult = window.ShowDialog(); }
private void OnViewPDFCommand(object args) { string dir = Path.Combine(Program.BaseDir(), "Uploads", PatientEntity.UniqueID.ToString(), PatientReport.UniqueID.ToString()); string filePDF = Path.Combine(dir, "report.pdf"); var pdfVM = new PDFViewModel(filePDF); var window = new ModernWindow { Style = (Style)App.Current.Resources["BlankWindow"], Title = "Prediction Result", IsTitleVisible = true }; window.Content = new PDFView(pdfVM, window); var closeResult = window.ShowDialog(); }
private void PreviewAction() { var content = new Reports.Contents.ReportContent(new Microsoft.Reporting.WinForms.ReportDataSource { Value = Manifest.Source }, "TrireksaApp.Reports.Layouts.ManifestOutgoingLayout.rdlc", null); var dlg = new ModernWindow { Content = content, Title = "Manifest Outgoing", Style = (Style)App.Current.Resources["BlankWindow"], ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, WindowState = WindowState.Maximized, }; dlg.ShowDialog(); }
public static void PrintPreviewNotaAction(Penjualan obj) { var list = CreateReportModel(obj); var helperPrint = new HelperPrint(); var content = new Reports.Contents.ReportContent(helperPrint.CreateNotaDataSource(list), "TrireksaApp.Reports.Layouts.NotaComplete.rdlc", null); var dlg = new ModernWindow { Content = content, Title = "Nota", Style = (Style)App.Current.Resources["BlankWindow"], ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, WindowState = WindowState.Maximized, }; dlg.ShowDialog(); }
private void CallReportPenjualan(string title, List <PenjualanReportModel> list) { var content = new Reports.Contents.ReportContent(new Microsoft.Reporting.WinForms.ReportDataSource { Value = list }, "TrireksaApp.Reports.Layouts.AdminPenjualanLayout.rdlc", new Microsoft.Reporting.WinForms.ReportParameter[] { new Microsoft.Reporting.WinForms.ReportParameter("Title", new string[] { title }) }); var dlg = new ModernWindow { Content = content, Title = "Nota", Style = (Style)App.Current.Resources["BlankWindow"], ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, WindowState = WindowState.Maximized, }; dlg.ShowDialog(); }
private void AllDetailAction() { var man = new Penjualan.PenjualanInfoVM(this.SelectedItem); var content = new PenjualanInfo(); content.DataContext = man; var dlg = new ModernWindow { Content = content, Title = "Details", Style = (Style)App.Current.Resources["BlankWindow"], // ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, WindowState = WindowState.Normal, WindowStartupLocation = WindowStartupLocation.CenterScreen }; dlg.ShowDialog(); }
private void OnLoginCommand(object args) { var model = args as UserEntity; if (model != null) { var result = new User().Validate(model.UserNm, model.Pwd); if (result != null && result.Id > 0) { string[] roles = { EnumRoles.Administrator.ToString() }; Program.SetIdentity(result.Id.ToString(), roles); if (!result.IsConfigured) { var settingVM = new SettingsViewModel(result); var window = new ModernWindow { Style = (Style)App.Current.Resources["BlankWindow"], Title = "Settings", IsTitleVisible = true }; window.Content = new SettingsView(settingVM, window); window.Width = SystemParameters.MaximizedPrimaryScreenWidth - (SystemParameters.MaximizedPrimaryScreenWidth - 460); window.Height = SystemParameters.MaximizedPrimaryScreenHeight - (SystemParameters.MaximizedPrimaryScreenHeight - 500); var closeResult = window.ShowDialog(); if (closeResult == true) { Clear(); Helper.Profile(result.IsConfigured); } } else { Clear(); Helper.Profile(result.IsConfigured); } } else { ModernDialog.ShowMessage("Incorrect UserName or Password!", "Login", MessageBoxButton.OK); } } }
private void CitiesAgentAcanAccessAction() { var cnt = new Agent.CitiesAgentCanAccess(); var vm = new Agent.CitiesAgentCanAccessVM(Collection.SelectedItem); cnt.DataContext = vm; var wnd = new ModernWindow { WindowStartupLocation = WindowStartupLocation.CenterOwner, Style = (Style)App.Current.Resources["BlankWindow"], Title = "Cities Agent Can Access", Content = cnt, Height = 480, ResizeMode = ResizeMode.CanResizeWithGrip, }; vm.CloseWindow = wnd.Close; wnd.ShowDialog(); }
internal static void PrintPreview(string Title, string Layout, ReportDataSource source, ReportParameter[] parameters) { var content = new Reports.Contents.ReportContent(source, Layout, parameters); var dlg = new ModernWindow { Content = content, Title = Title, Style = (Style)App.Current.Resources["BlankWindow"], ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, WindowState = WindowState.Maximized, }; dlg.ShowDialog(); /* * Example : * ResourcesBase.PrintPreview("Print Photo", "TrireksaApp.Reports.Layouts.PrintImageLayout.rdlc", * new Microsoft.Reporting.WinForms.ReportDataSource { Value = new List<Photo> { SelectedPhoto } }, * null); */ }
private void ShowModalInternal(IViewModel viewModel) { _log.Debug(string.Format("Creating View for ViewModel - {0}", viewModel.GetType().FullName)); var view = CreateView(viewModel.GetType()); _log.Debug(string.Format("Binding View and ViewModel - {0}", viewModel.GetType().FullName)); BindViewModel(view, viewModel); var window = view as Window; if (window != null) { ConnectUpClosing(viewModel, window); window.Owner = Application.Current.MainWindow; window.ShowDialog(); } else { window = new ModernWindow { Content = view, SizeToContent = SizeToContent.WidthAndHeight, WindowStyle = WindowStyle.ToolWindow, Owner = Application.Current.MainWindow }; var supportHeader = viewModel as ISupportHeader; if (supportHeader != null && supportHeader.Header != null) { window.Title = supportHeader.Header.ToString(); } ConnectUpActivation(viewModel, window); ConnectUpClosing(viewModel, window); window.ShowDialog(); } }
/// <summary> /// Method for the right click on a transition. /// This method opens a footprintviewer /// </summary> /// <autor>Andrej Albrecht</autor> private static void Transition_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { try { Thumb thumb = (Thumb)sender; String transitionName = thumb.GetValue(ContentProperty).ToString(); ModernWindow footprintViewer = new ModernWindow { Style = (Style)Application.Current.Resources["EmptyWindow"], Width = 600, Height = 550, Content = new FootprintViewer(transitionName), //Topmost = true }; footprintViewer.ShowDialog(); } catch (Exception Ex) { ErrorHandling.ReportErrorToUser("Error: " + Ex.Message + Ex.StackTrace); } }
private void SystemMenuClick(object sender, RoutedEventArgs e) { var node = (sender as MenuItem).Tag as NavigationNode; if (!string.IsNullOrEmpty(node.Value)) { var nodeClass = node.Bundle.LoadClass(node.Value); if (nodeClass != null) { var nodeInstance = System.Activator.CreateInstance(nodeClass); if (typeof(ICommand).IsAssignableFrom(nodeClass)) { (nodeInstance as ICommand).Execute(sender); } else if (typeof(UserControl).IsAssignableFrom(nodeClass)) { var uc = (nodeInstance as UserControl); var dialog = new ModernWindow { Style = (Style)System.Windows.Application.Current.Resources["BlankWindow"], Title = (sender as MenuItem).Header.ToString(), Content = uc, WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner }; dialog.MinWidth = uc.Width; dialog.MinHeight = uc.Height; dialog.Width = uc.Width; dialog.Height = uc.Height; dialog.Owner = this; dialog.ShowDialog(); } } else { FileLogUtility.Error(string.Format("Failed to load class '{0}' from the Bundle '{1}'.", node.Value, node.Bundle.SymbolicName)); } } }
private void BrowseManifestCommandAction() { var view = new Contents.ManifestOutgoing.BrowseSTT(); var dlg = new ModernWindow() { Title = "Simulasi Manifest Outgoing", Style = (Style)App.Current.Resources["BlankWindow"], ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip, WindowState = WindowState.Maximized, Content = view, }; if (this.PackingListSimulation == null) { this.PackingListSimulation = new Models.PackingListSimulation(this.SourceFromDatabase); } var vm = new Contents.ManifestOutgoing.BrowseSTTVM(PackingListSimulation) { CloseWindow = dlg.Close }; view.DataContext = vm; dlg.ShowDialog(); if (PackingListSimulation.Packs.Count > 0) { this.PackingList = new List <packinglist>(); PenjualanTemporaty.Clear(); foreach (var item in SourceFromDatabase.Where(O => O.IsSelected == true)) { var a = new PenjualanView { Reciver = item.Reciver, Shiper = item.Shiper, STT = item.STT }; foreach (var pack in PackingListSimulation.Packs) { foreach (var cly in pack.PackingLists) { if (item.STT == cly.STT) { PackingList.Add(new packinglist { PenjualanId = item.Id, CollyId = cly.Id, CollyNumber = cly.CollyNumber, PackNumber = pack.PackNumber, STT = item.STT, Weight = cly.Weight }); a.Details.Add(cly); a.Pcs++; a.Weight += cly.Weight; } } } if (a.Pcs > 0) { PenjualanTemporaty.Add(a); } } this.PenjualanTemporaryView.Refresh(); } else { this.PackingListSimulation = null; } }