// **************************************************
// Custom code for ChartTrackerForm
// Created: 1/3/2014 10:16:20 AM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Epicor.Mfg.BO;
using Epicor.Mfg.UI;
using Epicor.Mfg.UI.Adapters;
using Epicor.Mfg.UI.Customization;
using Epicor.Mfg.UI.ExtendedProps;
using Epicor.Mfg.UI.FormFunctions;
using Epicor.Mfg.UI.FrameWork;
using Epicor.Mfg.UI.Searches;
using Epicor.Mfg.Core;
using Epicor.Mfg.Lib;
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 **
Epicor.Mfg.UI.FrameWork.EpiUltraGrid myGrid;
BOReader _boReader;
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
// End Wizard Added Custom Method Calls
myGrid = (Epicor.Mfg.UI.FrameWork.EpiUltraGrid)csm.GetNativeControlReference("71f64ea7-7091-4d95-af97-914e4bac8a5d");
myGrid.DisplayLayout.Bands[0].Columns.Add("VendorNumVendorID","Supplier ID");
myGrid.InitializeRow += new Infragistics.Win.UltraWinGrid.InitializeRowEventHandler(grdMatLst_InitializeRow);
_boReader = new BOReader(((Session)oTrans.Session).ConnectionPool);
}
private void grdMatLst_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
{
if(!String.IsNullOrEmpty(e.Row.Cells["VendorNumVendorID"].Value.ToString()))
{
DataSet ds = _boReader.GetRows("PartTran","VendorNumVendorID='"+e.Row.Cells["VendorNumVendorID"].Value.ToString()+ "'","VendorNumVendorID");
if(ds.Tables[0].Rows.Count > 0 )
e.Row.Cells["VendorNumVendorID"].Value = ds.Tables[0].Rows[0]["VendorNumVendorID"];
}
}
public void DestroyCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
// Begin Wizard Added Object Disposal
// End Wizard Added Object Disposal
// Begin Custom Code Disposal
// End Custom Code Disposal
myGrid.InitializeRow += new Infragistics.Win.UltraWinGrid.InitializeRowEventHandler(grdMatLst_InitializeRow);
_boReader = null;
}
}