private void Vornehmen_Click(object sender, EventArgs e) { try { if (!String.IsNullOrEmpty(werkzeug_neu) && height_neu != 0 && width_neu != 0 && depth_neu != 0 && werkzeug_neu.Length > 4) { newPt = new netDxf.Entities.Point(height_neu, width_neu, depth_neu); List <netDxf.Entities.Point> neuList = Doc.Points.ToList(); workpiece neuWorkpiece = new workpiece(); neuWorkpiece.depth = depth_neu; neuWorkpiece.height = height_neu; neuWorkpiece.width = width_neu; neuWorkpiece.werkzeugName = werkzeug_neu; foreach (netDxf.Entities.Point item in neuList) { Doc.RemoveEntity(item); } DXF_Management.DXF_Writer.JoinToDxF(PFAD, ref Doc, neuWorkpiece); MessageBox.Show("Erfolgreich vorgenommen!", "Arbeitseigenschaften Veränderung", MessageBoxButtons.OK, MessageBoxIcon.None); } else { MessageBox.Show("Falsche Eingabe \n Bitte überprüfen Sie Ihre Eingaben!", "Arbeitseigenschaften Veränderung", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } catch (Exception error) { MessageBox.Show(error.Message, "Arbeitseigenschaften Veränderung", MessageBoxButtons.OK, MessageBoxIcon.Stop); } }
private void writeToDB() { int result = 0; afmdbEntities ctx = new afmdbEntities(); workpiece workpiece = new workpiece(); workpiece.Name = "work"; workpiece.RunMode = 1; workpiece.LotNum = "2019-09-07"; workpiece.Operator = "xiao"; workpiece.Barcode = "2019-09-07 16:55"; workpiece.StartTime = this.dateTimePickerInputStart.Value; workpiece.EndTime = this.dateTimePickerInputEnd.Value; if (!int.TryParse(this.txtOkNg.Text, out result)) { result = 0; } workpiece.Result = result; workpiece.Mark1X = 21; workpiece.Mark1Y = 32; workpiece.Mark2X = 45; workpiece.Mark2Y = 65; ctx.workpiece.Add(workpiece); ctx.SaveChangesAsync(); }
public DXF_Writer(ObservableCollection <creativeElement> listAddedElements, workpiece workPiece) { if ((listAddedElements.Count == 0 || listAddedElements == null) || workPiece == null) { throw new Exception("Error : NTB_DXF_100000 : No avalaible parameter"); } else { Werkzeug = workPiece.werkzeugName; Height = workPiece.height; Width = workPiece.width; Depth = workPiece.depth; ListAddedElements = listAddedElements.ToList(); foreach (var creativeElement in ListAddedElements) { } } }