public Bill_Master(List<BillItem>Bill , string ParentNumber, string Rev, decimal weight_val, decimal area_val)
{
try
{
InitializeComponent();
}
catch (Exception ex) { MessageBox.Show(ex.Message); }
try
{
weight.Value = weight_val;
area.Value = area_val;
}
catch { }
BillDataGrid.AutoGenerateColumns = false;
gid_txt.Text = Properties.Settings.Default.ecogroup;
if (Rev == "")
parentrev_txt.Text = DataList.GetCurrentRev(ParentNumber);
else
parentrev_txt.Text = Rev;
partnum_txt.Leave += partnum_txt_Leave;
mtlseq_txt.Text = GetNextSeq().ToString();
parent_txt.Text = ParentNumber;
try
{
EngWBDS = EngWB.GetDatasetForTree(gid_txt.Text, parent_txt.Text, parentrev_txt.Text, "", null, false, false);
BillDataGrid.DataSource = EngWBDS.Tables["ECOMtl"];
}
catch
{
try
{
MessageBox.Show("You must check part out before continuing.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Hand);
CheckOut_Master CO_M = new CheckOut_Master(parent_txt.Text);
DialogResult dr = CO_M.ShowDialog();
if (dr != DialogResult.Cancel)
{
EngWBDS = EngWB.GetDatasetForTree(gid_txt.Text, parent_txt.Text, parentrev_txt.Text, "", null, false, false);
BillDataGrid.DataSource = EngWBDS.Tables["ECOMtl"];
}
else
this.Close();
}
catch (Exception ex1) {MessageBox .Show (ex1.Message + "\n\nThis process will now close","Error!",MessageBoxButtons.OK,MessageBoxIcon.Error); }
}
this.FormClosing += Bill_Master_FormClosing;
BW.RunWorkerAsync(Bill);
try
{
BWForm.ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message,"Bill Master Error!",MessageBoxButtons.OK,MessageBoxIcon.Error);
BWForm.Dispose();
BWForm = new Waiting("Loading Bill of Materials into Epicor...");
BWForm.ShowDialog();
}
}