/// <summary> /// 从数据库导入 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonImportFromDatabase_Click(object sender, EventArgs e) { //此处加入导入数据代码,把包线存入 data.lstBasicCoreEnvelope //Todo BLL.BLLCoreEnvelopeDesign coreBll = new BLL.BLLCoreEnvelopeDesign(); List<XCommon.CoreEnvelopeDesign> lstCoreEnvelope = coreBll.GetListModel(); if (lstCoreEnvelope == null || lstCoreEnvelope.Count == 0) { MessageBox.Show("重心包线数据库没有数据"); return; } SelectCoreCutForm cutForm = new SelectCoreCutForm(this, "DB"); cutForm.ShowDialog(); if (coreEnvelope != null) { data.lstBasicCoreEnvelope = CoreEnvelopeDesign.GetStringToListCorePointData(coreEnvelope.CoreEnvelope); XCommon.XLog.Write("成功从数据库导入\"" + coreEnvelope.DesignData_Name + "\"数据!"); } //成功后,执行以下代码 UpdateCoreEnvelopeData(); 剪裁ToolStripMenuItem.Enabled = true; }
private void buttonImportFromDesignData_Click(object sender, EventArgs e) { //此处加入导入数据代码,把包线存入 data.lstBasicCoreEnvelope if (mainForm.designProjectData.lstCoreEnvelopeDesign == null || mainForm.designProjectData.lstCoreEnvelopeDesign.Count == 0) { MessageBox.Show("当前重心包线没有数据"); return; } //Todo SelectCoreCutForm cutForm = new SelectCoreCutForm(this, mainForm, "CoreEnvelope"); cutForm.ShowDialog(); if (coreEnvelopeDesign != null) { if (coreEnvelopeDesign.FormulaList != null && coreEnvelopeDesign.FormulaList.Count > 0) { if (data.lstBasicCoreEnvelope!=null&&data.lstBasicCoreEnvelope.Count>0) { data.lstBasicCoreEnvelope.Clear(); } foreach (XCommon.NodeFormula formula in coreEnvelopeDesign.FormulaList) { if (data.lstBasicCoreEnvelope == null) { data.lstBasicCoreEnvelope = new List<CorePointData>(); } CorePointData pt = new CorePointData(); pt.pointName = formula.NodeName; pt.pointXValue = Math.Round(formula.XFormula.Value, 6); pt.pointYValue = Math.Round(formula.YFormula.Value, 6); data.lstBasicCoreEnvelope.Add(pt); } XCommon.XLog.Write("成功从当前设计数据导入\"" + coreEnvelopeDesign.DataName + "\"数据!"); } else { return; } } else { return; } //成功后,执行以下代码 UpdateCoreEnvelopeData(); 剪裁ToolStripMenuItem.Enabled = true; }
private void buttonImportFromCutData_Click(object sender, EventArgs e) { //此处加入导入数据代码,把包线存入 data.lstBasicCoreEnvelope //Todo if (mainForm.designProjectData.lstCutResultData == null || mainForm.designProjectData.lstCutResultData.Count == 0) { MessageBox.Show("当前重心包线剪裁没有数据"); return; } SelectCoreCutForm cutForm = new SelectCoreCutForm(this, mainForm, "CoreCut"); cutForm.ShowDialog(); if (coreEnvelopeCut != null && coreEnvelopeCut != null && coreEnvelopeCut.lstBasicCoreEnvelope.Count > 0 && coreEnvelopeCut.lstCutEnvelopeCore.Count == 0) { if (data.lstBasicCoreEnvelope == null) { data.lstBasicCoreEnvelope = new List<CorePointData>(); } data.lstBasicCoreEnvelope.Clear(); foreach (CorePointData pt in coreEnvelopeCut.lstBasicCoreEnvelope) { CorePointData core = new CorePointData(); core.pointName = pt.pointName; core.pointXValue = pt.pointXValue; core.pointYValue = pt.pointYValue; data.lstBasicCoreEnvelope.Add(core); } XCommon.XLog.Write("当前剪裁结果无剪裁数据,导入\"" + coreEnvelopeCut.cutResultName + "\"基准数据!"); } if (coreEnvelopeCut != null && coreEnvelopeCut != null && coreEnvelopeCut.lstBasicCoreEnvelope.Count > 0 && coreEnvelopeCut.lstCutEnvelopeCore.Count > 0) { if (data.lstBasicCoreEnvelope == null) { data.lstBasicCoreEnvelope = new List<CorePointData>(); } data.lstBasicCoreEnvelope.Clear(); foreach (CorePointData pt in coreEnvelopeCut.lstCutEnvelopeCore) { CorePointData core = new CorePointData(); core.pointName = pt.pointName; core.pointXValue = pt.pointXValue; core.pointYValue = pt.pointYValue; data.lstBasicCoreEnvelope.Add(core); } XCommon.XLog.Write("成功从当前剪裁数据导入\"" + coreEnvelopeCut.cutResultName + "\"数据!"); } //成功后,执行以下代码 UpdateCoreEnvelopeData(); 剪裁ToolStripMenuItem.Enabled = true; }