private void buttonEditReproductiveState_Click(object sender, EventArgs e) { rse = new ReproductiveStateEditor(Session, this.Individual, (IndividualReproductiveState)individualReproductiveStateBindingSource.Current); rse.ShowDialog(); dataGridViewIndividualReproductiveState.Refresh(); }
private void buttonAddNew_Click(object sender, EventArgs e) { rse = new ReproductiveStateEditor(Session, this.Individual); DialogResult result = rse.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { this.Individual.ReproductiveStateHistory.Add(rse.State); this.individualReproductiveStateBindingSource.Add(rse.State); this.RefreshLabels(); } }
protected override void RowAction(DataGridViewRow row) { Individual individual = (Individual)row.Cells["Individual"].Value; //IndividualReproductiveState irc = NHibernateHelper.GetCurrentSession().Get<IndividualReproductiveState>(row.Cells["Id"].Value); IndividualReproductiveState irs = null; if (troopVisit != null) { irs = new IndividualReproductiveState(); irs.Individual = individual; irs.TroopVisit = troopVisit; } ReproductiveStateEditor rce = new ReproductiveStateEditor(Session, individual, irs); if (rce.ShowDialog() == System.Windows.Forms.DialogResult.OK) { individual.ReproductiveStateHistory.Add(rce.State); RefreshRow(row); } }