/// <summary> /// Generates overview using <see cref="Karafa.GUI.OverviewForm"/>. /// </summary> /// <param name="construction">Construction to generate invoices overview from</param> public void GenerateInvoiceOverview(Construction construction) { // Get data source Hashtable result = GetInvoiceOverview(construction); // Get column definition List<ColumnDefinition> definitions = GenerateInvoiceOverViewDatagridDefinition(); // Show overview OverviewForm form = new OverviewForm(result, definitions); form.Owner = this.owner; form.Show(); }
/// <summary> /// Creates sumary for whole construction harmonogram /// </summary> /// <param name="variation">Variation with object definition</param> /// <param name="construction">Concstruction with data for header and etap Grid</param> /// <param name="save">True to save PDF document, false not to.</param> public void CreateHarmonogramOverView( ConstructionVariation variation, Construction construction, bool save = true) { // For every object in variation ... foreach (ConstructionObject obj in variation.ObjectList) { // ... create Etap overview PDF pages new EtapsDrawer(this.document).CreateEtapOverView( obj, construction, false); } // Save document string fileName = string.Format("{0}-{1}", construction.Name, Properties.Resources.TITLE_HARMONOGRAM); SaveDocument(fileName, true); }
/// <summary> /// Creates overView of given <see cref="Karafa.ConstructionHierarchy.ConstructionObject"/>>. /// </summary> /// <param name="obj"><see cref="Karafa.ConstructionHierarchy.ConstructionObject"/> with Etaps list</param> /// <param name="construction"><see cref="Karafa.ConstructionHierarchy.Construction"/> with header data</param> /// <param name="save">True to save PDF document, false not to.</param> public void CreateEtapOverView( ConstructionObject obj, Construction construction, bool save = true) { this.obj = obj; this.construction = construction; // Create PDF page PdfPage page = NewPage(); try { // Draw initial header int yCoordinate = DrawHeader(page, 0, 0, page.Width.Value); // Draw every subsection name ane its prices yCoordinate = DrawEtapsGraph(page, 0, yCoordinate, page.Width.Value, page.Height.Value); // Add New page page = NewPage(); yCoordinate = DrawItemsOfEtaps(page, 0, 20); // Save etap and show it if (save) SaveDocument(obj.Name, true); } catch (Exception ex) { Karafa.Errors.KarafaLogger.LogError(ex); // Report error only when this document should be shown if (save) KarafaMainWindow.Instance.ReportProcess( Properties.Resources.MESSAGE_ERROR_ETAP_OVERVIEW_FAILED ); } }
/// <summary> /// Gets all invoices form selected construction to be shown in /// <see cref="Karafa.GUI.OverviewForm"/>. /// </summary> /// <param name="construction">Selected construction</param> /// <returns>Hashtable with proper data</returns> private Hashtable GetInvoiceOverview(Construction construction) { // Get invoices of curretn construction List<Invoice> invoices = construction.InvoiceList; if (invoices == null || invoices.Count == 0) return null; // No invoices to show Hashtable overview = new Hashtable(); overview.Add(Properties.Resources.LABEL_INVOICE, invoices); return overview; }
/// <summary> /// Empties etap data grid /// </summary> /// <param name="construction">Selected Construction</param> private void OnConstructionSelected(Construction construction) { this.dg_Harmonogram.ItemsSource = ""; }
/// <summary> /// Reaction on selected construction fired from selection user fontrol /// </summary> /// <param name="construction">Selected construction</param> private void OnConstructionSelected(Construction construction) { // No calculation selected, no functionality is enabled SetImportedItemsControlsEnability(false); }
private void OnConstructionSelected(Construction construction) { DisableDataGrids(); }