I have a custom form. There is a BAQ when you select a part. I know the results that the BAQ is returning
I want to connect the BAQ results to the text box fields below. I have them set the epiDataview Item. The EpiMagic is not working for me today.
I am asking please, and still no dice. Is there another magic word?
Forms looks like:
Fun code…
// **************************************************
// Custom code for UD01Form
// Created: 5/10/2018 4:25:00 PM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Ice.BO;
using Ice.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinDock;
public class Script
{
// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
// Begin Wizard Added Module Level Variables **
// End Wizard Added Module Level Variables **
// Add Custom Module Level Variables Here **
DynamicQueryAdapter dqa_BOMPartSummary;
EpiDataView edv_BOMPartSummary;
public void InitializeCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
// Begin Wizard Added Variable Initialization
// End Wizard Added Variable Initialization
// Begin Wizard Added Custom Method Calls
this.grid_BasicReport.InitializeLayout += new Infragistics.Win.UltraWinGrid.InitializeLayoutEventHandler(this.grid_BasicReport_InitializeLayout);
this.btn_PartSearch.Click += new System.EventHandler(this.btn_PartSearch_Click);
this.btn_GenerateBOM.Click += new System.EventHandler(this.btn_GenerateBOM_Click);
// End Wizard Added Custom Method Calls
dqa_BOMPartSummary = new DynamicQueryAdapter(oTrans);
dqa_BOMPartSummary.BOConnect();
dqa_BOMPartSummary.GetDashboardQuery("ETK-BOMReviewSum");
edv_BOMPartSummary = new EpiDataView();
edv_BOMPartSummary.dataView = new DataView(dqa_BOMPartSummary.QueryResults.Tables["Results"]);
oTrans.Add("edv_BOMPartSummary", edv_BOMPartSummary);
}
public void DestroyCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
// Begin Wizard Added Object Disposal
this.grid_BasicReport.InitializeLayout -= new Infragistics.Win.UltraWinGrid.InitializeLayoutEventHandler(this.grid_BasicReport_InitializeLayout);
this.btn_PartSearch.Click -= new System.EventHandler(this.btn_PartSearch_Click);
this.btn_GenerateBOM.Click -= new System.EventHandler(this.btn_GenerateBOM_Click);
// End Wizard Added Object Disposal
// Begin Custom Code Disposal
dqa_BOMPartSummary = null;
// End Custom Code Disposal
}
private void msSearchOnPartAdapterShowDialog()
{
try
{
bool recordSelected = false;
string whereClause = "TypeCode = 'M'";
DataSet results = Ice.UI.FormFunctions.SearchFunctions.listLookup(oTrans, "PartAdapter", out recordSelected, true, whereClause, false);
if (recordSelected)
{
System.Data.DataRow adapterRow = results.Tables[0].Rows[0];
txtPartNum.Text = adapterRow["PartNum"].ToString();
msGetPartDetails();
}
}
catch (Exception ex) { MessageBox.Show("Exception thrown by SearchOnPartAdapterShowDialog: " + ex.Message); }
}
private void btn_PartSearch_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
msSearchOnPartAdapterShowDialog();
}
private void msGetPartDetails()
{
try
{
#region Create the QueryExecutionDataSet and set the parameters for the query
QueryExecutionDataSet parameters = new QueryExecutionDataSet();
DataRow parameterRow1 = parameters.ExecutionParameter.NewRow();
parameterRow1["ParameterID"] = "PartNum";
//hard coding for now till i know it works
parameterRow1["ParameterValue"] = "003-363";
parameterRow1["ValueType"] = "x(10)";
parameterRow1["IsEmpty"] = false;
parameterRow1["RowMod"] = "";
parameters.ExecutionParameter.Rows.Add(parameterRow1);
#endregion
dqa_BOMPartSummary.ExecuteDashboardParameterized(dqa_BOMPartSummary.RuntimeQuery, parameters);
DataTable results = dqa_BOMPartSummary.QueryResults.Tables["Results"];
edv_BOMPartSummary.dataView = new DataView(dqa_BOMPartSummary.QueryResults.Tables["Results"]);
//hard coding for now till i know it works
edv_BOMPartSummary.Row = 0;
}
catch (Exception ex) { MessageBox.Show("Exception thrown by GetPartDetails: " + ex.Message); }
}
}