private void wizardPageSheetSetup_PageValidating(object sender, WizardPageValidatingEventArgs e) { if (e.Direction == Direction.Backward) { return; } if ((int)printTypeCombo.EditValue == 2) { ErrorProvider.SetError(printTypeCombo, usePerHorizontal.Value % 2 != 0 ? "Ungültige Anzahl Nutzen bei dieser Druckart" : ""); } else if ((int)printTypeCombo.EditValue == 3) { ErrorProvider.SetError(printTypeCombo, usePerVertical.Value % 2 != 0 ? "Ungültige Anzahl Nutzen bei dieser Druckart" : ""); } ErrorProvider.SetError(printFormatWidth, printFormatWidth.Value == 0 ? "Bitte ein Format eingeben" : ""); ErrorProvider.SetError(printFormatHeight, printFormatHeight.Value == 0 ? "Bitte ein Format eingeben" : ""); ErrorProvider.SetError(machineLookUp, (int)machineLookUp.EditValue == 0 ? "Bitte eine Druckmaschine auswählen" : ""); ErrorProvider.SetError(usePerHorizontal, usePerHorizontal.Value == 0 ? "Bitte Nutzen eingeben" : ""); ErrorProvider.SetError(usePerVertical, usePerVertical.Value == 0 ? "Bitte Nutzen eingeben" : ""); e.Valid = !ErrorProvider.HasErrors; if (e.Valid) { switch ((int)printTypeCombo.EditValue) { case 1: plate.Value = colorFront.Value; SingleOffset.PlateQuantity = (int)(colorFront.Value > colorBack.Value ? colorFront.Value : colorBack.Value); break; case 4: plate.Value = colorFront.Value + colorBack.Value; SingleOffset.PlateQuantity = (int)(colorFront.Value > colorBack.Value ? colorFront.Value : colorBack.Value); break; default: plate.Value = colorFront.Value > colorBack.Value ? colorFront.Value : colorBack.Value; SingleOffset.PlateQuantity = (int)(colorFront.Value > colorBack.Value ? colorFront.Value : colorBack.Value); break; } CalculatePaperQuantity(); } }
private void wizardPagePaper_PageValidating(object sender, WizardPageValidatingEventArgs e) { ErrorProvider.SetError(paperSearchLook, (int)paperSearchLook.EditValue == 0 ? "Bitte ein Papier auswählen" : ""); ErrorProvider.SetError(usePerSheet, usePerSheet.Value == 0 ? "Bitte Nutzen korrigieren" : ""); e.Valid = !ErrorProvider.HasErrors; }
private void detailsPage_PageValidating(object sender, WizardPageValidatingEventArgs e) { if (e.Direction == Direction.Forward) { treeList1.BeginUnboundLoad(); treeList1.ClearNodes(); var rootPaper = treeList1.AppendNode(new object[] { "Papier", null, null, null }, null); treeList1.AppendNode(new object[] { SingleOffset.Paper.Name, (additionPaper.Value / usePerSheet.Value) + (quantity.Value / (usePerHorizontal.Value * usePerVertical.Value)), SingleOffset.PaperPrice, SingleOffset.PaperCostTotal }, rootPaper); var rootSetup = treeList1.AppendNode(new object[] { "Einrichten", null, null, null }, null); treeList1.AppendNode(new object[] { SingleOffset.EasySetup ? "Einfaches Einrichten" : SingleOffset.DifficultSetup ? "Aufwendiges Einrichten" : "Kein Einrichten", null, null, SingleOffset.SetupCostTotal }, rootSetup); var rootPlate = treeList1.AppendNode(new object[] { "Platten", null, null, null }, null); treeList1.AppendNode(new object[] { "Platten", SingleOffset.PlateQuantity, SingleOffset.Machine.PlateCost, SingleOffset.PlateCost }, rootPlate); var rootColor = treeList1.AppendNode(new object[] { "Einrichten", null, null, null }, null); treeList1.AppendNode(new object[] { "Einfacher Farbwechsel", SingleOffset.EasyColorChange, (SingleOffset.Machine.PricePerColor * (SingleOffset.Machine.PricePerHour / 60)), SingleOffset.EasyColorChange * (SingleOffset.Machine.PricePerColor * (SingleOffset.Machine.PricePerHour / 60)) }, rootColor); treeList1.AppendNode(new object[] { "Aufwendiger Farbwechsel", SingleOffset.DifficultColorChange, (SingleOffset.Machine.DifficultColor * (SingleOffset.Machine.PricePerHour / 60)), SingleOffset.DifficultColorChange * (SingleOffset.Machine.DifficultColor * (SingleOffset.Machine.PricePerHour / 60)) }, rootColor); var rootPrint = treeList1.AppendNode(new object[] { "Druck", null, null, null }, null); var colors = SingleOffset.FkPrintType == 1 ? colorFront.Value : SingleOffset.FkPrintType > 2 ? colorFront.Value + colorBack.Value : colorFront.Value; treeList1.AppendNode(new object[] { "Fortdruck", paperQuantity.Value * (colors), null, SingleOffset.PrintCostTotal }, rootPrint); var rootTotal = treeList1.AppendNode(new object[] { "Total", null, null, SingleOffset.PositionTotal }, 99); treeList1.EndUnboundLoad(); treeList1.ExpandAll(); } }
private void wizardPageBasicProperties_PageValidating(object sender, WizardPageValidatingEventArgs e) { ErrorProvider.SetError(quantity, quantity.Value == 0 ? "Bitte eine gültige Auflage eingeben" : ""); ErrorProvider.SetError(finishSizeL, finishSizeL.Value == 0 ? "Bitte eine gültige Breite eingeben" : ""); ErrorProvider.SetError(finishSizeH, finishSizeH.Value == 0 ? "Bitte eine gültige Höhe eingeben" : ""); e.Valid = !ErrorProvider.HasErrors; if (e.Valid) { simpleColor.Value = colorFront.Value > colorBack.Value ? colorFront.Value : colorBack.Value; Drawing.Draw(finishSheetPanel.CreateGraphics(), (int)printFormatWidth.Value, (int)printFormatHeight.Value, (int)finishSizeL.Value, (int)finishSizeH.Value, (int)usePerVertical.Value, (int)usePerHorizontal.Value, flipUsePer.Checked); } }
private void welcomeWizardPage1_PageValidating(object sender, WizardPageValidatingEventArgs e) { }