private void buttonIndividualSightingNew_Click(object sender, EventArgs e) { SightingChanges tcc = new SightingChanges(troopVisit); tcc.LoadData(); if (tcc.ShowDialog() == System.Windows.Forms.DialogResult.OK) { ChangeStage(Stage.ReproductiveState); } }
private void button2_Click(object sender, EventArgs e) { Troop t = Session.Get <Troop>("J"); IList <TroopVisit> tvs = Session .CreateQuery("from TroopVisit as tv " + "where tv.Troop = :troop " + "and Date = :date ") .SetParameter <Troop>("troop", t) .SetParameter <DateTime>("date", new DateTime(2009, 11, 07)) .List <TroopVisit>(); /// INTEGRITY CHECK /// The above query should only return a single instance if (tvs.Count != 1) { //ERROR } SightingChanges tcc = new SightingChanges(tvs[0]); tcc.LoadData(); tcc.ShowDialog(); }