private void addBtn_Click(object sender, System.EventArgs e) { int selectedIndex = containerViewTabPage.SelectedIndex; if (selectedIndex != 0) return; EM.QuickGrid.Index index = this.containerBundleGrid.GetCurrentIndex(); DataTable table = this.containerBundleGrid.GetTable(); if (table.Rows.Count <= index.row) return; DataRow row = table.Rows[index.row]; int bundleID = (int)row["ContainerBundleID"]; if (emDataSet.BOLItemTbl.FindByBOLIDContainerBundleID(CurrentKey,bundleID)!= null) return; // already there EMDataSet.BOLItemTblRow bolItemTblRow = emDataSet.BOLItemTbl.NewBOLItemTblRow(); bolItemTblRow.ContainerBundleID = bundleID; bolItemTblRow.BOLID = CurrentKey; using (TurnOffConstraints doThat = new TurnOffConstraints(emDataSet)) using (OpenConnection doIt = new OpenConnection(IsWrite.No,GetConnection())) { this.FillFromItemRow(bolItemTblRow); } emDataSet.BOLItemTbl.Rows.Add(bolItemTblRow); UpdateGrid(); RefreshContainerGrids(); }
public override void FillTablesFromDatabase() { m_emDataSet.Clear(); using (TurnOffConstraints doIt = new TurnOffConstraints(m_emDataSet)) { AdapterHelper.FillPOHeader(m_emDataSet,base.CurrentKey); AdapterHelper.FillTerms(m_emDataSet); AdapterHelper.FillShippingCode(m_emDataSet); DataInterface.UpdateComboBox(m_emDataSet.ShippingCodeTbl,"ShipCode",m_shipCodeCombo); DataInterface.UpdateComboBox(m_emDataSet.PaymentTermsTbl,"Terms",m_termsCombo); AdapterHelper.FillCompany(m_emDataSet); AdapterHelper.FillAllLocations(m_emDataSet); AdapterHelper.FillAllContacts(m_emDataSet); AdapterHelper.FillCountry(m_emDataSet); AdapterHelper.FillCurrency(m_emDataSet); if (IsEmptyTable()) return; AdapterHelper.FillPOItem(m_emDataSet,GetHeaderRow().POID); foreach (EMDataSet.POItemTblRow itemRow in m_emDataSet.POItemTbl) { AdapterHelper.FillContBundleFromPOItemNumber(m_emDataSet,itemRow.POItemNumber); } foreach (EMDataSet.ContBundleTblRow bundleRow in m_emDataSet.ContBundleTbl) { AdapterHelper.FillContainerHeader(m_emDataSet,bundleRow.ContID); AdapterHelper.FillBOLFromContBundleID(m_emDataSet,bundleRow.ContainerBundleID); } foreach (EMDataSet.BOLItemTblRow bolItemRow in m_emDataSet.BOLItemTbl) { AdapterHelper.FillBillOfLading(m_emDataSet,bolItemRow.BOLID); } AdapterHelper.FillOutConstraints(m_emDataSet); } }
public override void FillTablesFromDatabase() { emDataSet.Clear(); using (TurnOffConstraints doIt = new TurnOffConstraints(emDataSet)) { AdapterHelper.FillBillOfLading(emDataSet,CurrentKey); AdapterHelper.FillBillOfLadingItem(emDataSet,CurrentKey); foreach (EMDataSet.BOLItemTblRow row in emDataSet.BOLItemTbl.Rows) { FillFromItemRow(row); } } }