private static void saveSurfaces(int cipherDetail, int idCalculation) { List <Surface> surfaces = Part.getSurfaces(); int countSufaces = Part.getCountSurfaces(); for (int i = 1; i < countSufaces; i++) { Surface surface = surfaces[i]; ParametersOfSurface parametersOfSurface = surface.getParametersOfSurface(); string nameSurface = surface.getNameSurface(); double diameterOfSurface = parametersOfSurface.getDiameterOfPart(); int typeOfPart = parametersOfSurface.getTypeOfPart().getIndex(); int typeOfAllowance = parametersOfSurface.getTypeOfAllowance().getIndex(); int typeOfProcessedSurface = parametersOfSurface.getTypeOfProcessedSurface().getIndex(); double surfaseRoughness = parametersOfSurface.getSurfaceRoughnessRz(); double holeDepth = parametersOfSurface.getHoleDepth(); double tolerance = parametersOfSurface.getAllowance(); dbConnection.SetQuery($@"INSERT INTO {SURFACE} VALUES ({idCalculation}, '{nameSurface}', {doubleToStringForDb(diameterOfSurface)}, {typeOfPart}, {typeOfAllowance}, {typeOfProcessedSurface}, {doubleToStringForDb(surfaseRoughness)}, {doubleToStringForDb(holeDepth)}, {doubleToStringForDb(tolerance)})"); int idSurface = getIdentCurrent(SURFACE); saveToTableOperationsAndResults(idSurface, surface, idCalculation); } }
private bool checkOfIntervalDiameter() { double diameterOFPart = parametersOfPart.getDiameterOfPart(); Interval intervalOfDiameter = new Interval(0, 3150); bool checkOfDiameter = intervalOfDiameter.checkOfInterval(diameterOFPart); if (checkOfDiameter) { return(true); } else { MessageBox.Show("Введен некорректный диаметр", "Ошибка"); return(false); } }
private static void insertParametersIntextBox(FormOfWorkWithDatabase form, int index) { DependenceSurface surface = surfaces[index]; ParametersOfSurface parameters = surface.getParametersOfSurface(); form.diameterOfSurface.Text = parameters.getDiameterOfPart().ToString(); form.typeOfPart.Text = parameters.getTypeOfPart().getName(); form.typeOfAllowance.Text = parameters.getTypeOfAllowance().getName(); form.TypeOfProcessedSurface.Text = parameters.getTypeOfProcessedSurface().getName(); form.SurfaceRoughness.Text = ConversionRoughnessRzAndRa.RzToRa(parameters.getSurfaceRoughnessRz()).ToString(); form.HoleDepth.Text = parameters.getHoleDepth().ToString(); form.Tolerance.Text = parameters.getAllowance().ToString(); }