public InvoiceEntity(Invoice Invoice, params object[] args) : base(Invoice) { foreach (object arg in args) { if (arg is Order Order) { OrderEntity = new OrderEntity(Order); } if (arg is ICollection <InvoiceLine> InvoiceLines) { InvoiceLineEntities = InvoiceLines.Select(model => new InvoiceLineEntity(model)).ToList(); } if (arg is ICollection <IssueNote> IssueNotes) { IssueNoteEntities = IssueNotes.Select(model => new IssueNoteEntity(model, model.Customer, model.WareHouse)).ToList(); } } }
public WareHouseEntity(WareHouse WareHouse, params object[] args) : base(WareHouse) { foreach (object arg in args) { if (arg is Employee Stockkeeper) { StockkeeperEntity = new EmployeeEntity(Stockkeeper); } if (arg is ICollection <Inventory> Inventories) { InventoryEntities = Inventories.Select(model => new InventoryEntity(model, model.Product)).ToList(); } if (arg is ICollection <IssueNote> IssueNotes) { IssueNoteEntities = IssueNotes.Select(model => new IssueNoteEntity(model, model.Customer, model.Invoice)).ToList(); } if (arg is ICollection <ReceiptNote> ReceiptNotes) { ReceiptNoteEntities = ReceiptNotes.Select(model => new ReceiptNoteEntity(model, model.Employee, model.Supplier)).ToList(); } } }
public CustomerEntity(Customer Customer, params object[] args) : base(Customer) { foreach (object arg in args) { if (arg is CustomerGroup CustomerGroup) { CustomerGroupEntity = new CustomerGroupEntity(CustomerGroup); } if (arg is ICollection <IssueNote> IssueNotes) { IssueNoteEntities = IssueNotes.Select(model => new IssueNoteEntity(model, model.Invoice, model.WareHouse)).ToList(); } if (arg is ICollection <Order> Orders) { OrderEntities = Orders.Select(model => new OrderEntity(model, model.ShipmentDetail)).ToList(); } if (arg is ICollection <ShipmentDetail> ShipmentDetails) { ShipmentDetailEntities = ShipmentDetails.Select(model => new ShipmentDetailEntity(model, model.City, model.Country)).ToList(); } } }
/// <summary> /// Call this method if an extraction failed. Possible causes of the failure are displayed for the user. /// </summary> /// <param name="issues"></param> private void ExtractionFailed(IssueNotes.Issue issues = IssueNotes.Issue.None) { issues |= extractor.possibleIssues; // add all issues that arised during extraction if (issues == IssueNotes.Issue.None) { // set background of inputs to neutral numericUpDownLevel.BackColor = SystemColors.Window; numericUpDownLowerTEffBound.BackColor = SystemColors.Window; numericUpDownUpperTEffBound.BackColor = SystemColors.Window; numericUpDownImprintingBonusExtractor.BackColor = SystemColors.Window; cbExactlyImprinting.BackColor = Color.Transparent; panelSums.BackColor = Color.Transparent; panelWildTamedBred.BackColor = Color.Transparent; labelTE.BackColor = Color.Transparent; llOnlineHelpExtractionIssues.Visible = false; labelErrorHelp.Visible = false; lbImprintingFailInfo.Visible = false; // TODO move imprinting-fail to upper note-info extractor.possibleIssues = IssueNotes.Issue.None; } else { // highlight controls which most likely need to be checked to solve the issue if (issues.HasFlag(IssueNotes.Issue.WildTamedBred)) { panelWildTamedBred.BackColor = Color.LightSalmon; } if (issues.HasFlag(IssueNotes.Issue.TamingEffectivenessRange)) { if (numericUpDownLowerTEffBound.Value > 0) { numericUpDownLowerTEffBound.BackColor = Color.LightSalmon; } if (numericUpDownUpperTEffBound.Value < 100) { numericUpDownUpperTEffBound.BackColor = Color.LightSalmon; } if (numericUpDownLowerTEffBound.Value == 0 && numericUpDownUpperTEffBound.Value == 100) { issues -= IssueNotes.Issue.TamingEffectivenessRange; } } if (issues.HasFlag(IssueNotes.Issue.CreatureLevel)) { numericUpDownLevel.BackColor = Color.LightSalmon; numericUpDownImprintingBonusExtractor.BackColor = Color.LightSalmon; statIOs[(int)StatNames.Torpidity].Status = StatIOStatus.Error; } if (issues.HasFlag(IssueNotes.Issue.ImprintingLocked)) { cbExactlyImprinting.BackColor = Color.LightSalmon; } if (issues.HasFlag(IssueNotes.Issue.ImprintingNotPossible)) { numericUpDownImprintingBonusExtractor.BackColor = Color.LightSalmon; } // don't show some issue notes if the input is not wrong if (issues.HasFlag(IssueNotes.Issue.LockedDom)) { bool oneStatIsDomLocked = false; for (int s = 0; s < Values.STATS_COUNT; s++) { if (statIOs[s].DomLevelLockedZero) { oneStatIsDomLocked = true; break; } } if (!oneStatIsDomLocked) { // no stat is domLocked, remove this note (which is ensured to be there) issues -= IssueNotes.Issue.LockedDom; } } if (!issues.HasFlag(IssueNotes.Issue.StatMultipliers)) { issues |= IssueNotes.Issue.StatMultipliers; // add this always? } if (rbTamedExtractor.Checked && creatureCollection.considerWildLevelSteps) { issues |= IssueNotes.Issue.WildLevelSteps; } labelErrorHelp.Text = "The extraction failed. See the following list of possible causes:\n\n" + IssueNotes.getHelpTexts(issues); labelErrorHelp.Visible = true; llOnlineHelpExtractionIssues.Visible = true; groupBoxPossibilities.Visible = false; groupBoxRadarChartExtractor.Visible = false; lbInfoYellowStats.Visible = false; if (rbBredExtractor.Checked && numericUpDownImprintingBonusExtractor.Value > 0) { lbImprintingFailInfo.Text = Loc.s("lbImprintingFailInfo"); lbImprintingFailInfo.Visible = true; } else if (rbTamedExtractor.Checked && "Procoptodon,Pulmonoscorpius,Troodon".Split(',').ToList().Contains(speciesSelector1.SelectedSpecies.name)) { // creatures that display wrong stat-values after taming lbImprintingFailInfo.Text = $"The {speciesSelector1.SelectedSpecies.name} is known for displaying wrong stat-values after taming. " + "Please try the extraction again after the server restarted."; lbImprintingFailInfo.Visible = true; } toolStripButtonSaveCreatureValuesTemp.Visible = true; // check for updates if (DateTime.Now.AddHours(-5) > Properties.Settings.Default.lastUpdateCheck) { CheckForUpdates(true); } } }