public void ReadColumn(string sColName) { if (m_oWorksheetFeed == null) { throw new System.Exception("The sheet is unselected"); } if (m_oWorksheetFeed.Entries.Count != 1) { return; } string sChecked = "checked"; m_oCurrentColumn.sName = sColName; m_oCurrentColumn.nIndex = ObtainIndexByName(sColName); m_oSelectedList.StartNewList(sColName); m_oValidationDataTable.Reset(); m_oValidationDataTable.Columns.Add(new System.Data.DataColumn(sChecked, typeof(bool))); m_oValidationDataTable.AddColumn(sColName); foreach (ListEntry worksheetRow in m_oListFeed.Entries) { string scanData = worksheetRow.Elements[m_oCurrentColumn.nIndex].Value.ToString(); m_oSelectedList.PushBack(scanData); System.Data.DataRow dr = m_oValidationDataTable.NewRow(); dr[sColName] = scanData; dr[sChecked] = false; m_oValidationDataTable.Rows.Add(dr); } }
public void OnSubmit() { pList oList = new pList(); oList.StartNewList("items"); foreach (System.Data.DataRow row in m_oValidationDataTable.Rows) { if ((bool)row[0] == true) { oList.PushBack(row[1].ToString()); } } if (oList.Rows.Count > 0) { forms.SubmitForm oSub = new forms.SubmitForm(); oSub.AddList(oList); if (oSub.ShowDialog() == DialogResult.OK) { int i = 0; foreach (System.Data.DataRow row in m_oValidationDataTable.Rows) { if ((bool)row[0] == true) { RemoveRow(i); } i++; } System.Windows.Forms.MessageBox.Show("items cleared:)"); } else { System.Windows.Forms.MessageBox.Show("action canceled"); } } ReadColumn(m_oCurrentColumn.sName); }