// private SqlGeneratorBase sqlBase; public RollCallSearch(MDIMainForm mdiForm) { InitializeComponent(); _bs = new BindingSource(); _mdiForm = mdiForm; rcd = new ResidentRollCallData(); }
public ImportResidentRollCall(Jarvis jarvis) { InitializeComponent(); _residentRollCall = new ResidentRollCall(); rcd = new ResidentRollCallData(); _jarvis = jarvis; //_residentRollCall.FileName = "sdfsdfsdf"; }
private void Search() { if (IsValidated()) { try { ResidentRollCallData data = new ResidentRollCallData(); List <ResidentRollCallFileLog> list = data.GetImportFiles(cmbMonth.Text, cmbYear.Text); ListBox listBox = (ListBox)lstFiles; listBox.DataSource = list; listBox.DisplayMember = "FileName"; listBox.ValueMember = "ResidentRollCallImportId"; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void btnSave_Click(object sender, EventArgs e) { DataAccess.DBCommand dbcNew = new DataAccess.DBCommand(DataAccess.DBCommand.TransactionType.WithTransaction); try { rcd = new ResidentRollCallData(dbcNew); rcd.SaveRollCalll(_residentRollCall); MoveFileToArchive(_residentRollCall); MessageBox.Show("Resident Roll Call saved to database successfully", "Sae Roll Call", MessageBoxButtons.OK, MessageBoxIcon.Information); //this.DialogResult = DialogResult.OK; dgRollCallData.DataSource = null; dgRollCallData.Refresh(); dbcNew.CommitTransactions(); ResetTextBoxes(); // dbcNew.CloseConnection(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Import Roll Call", MessageBoxButtons.OK, MessageBoxIcon.Error); dbcNew.rollbackTransactions(); } }