source: BMXNET_RPMS_dotNET_UTILITIES-BMX/branch/IHS BMX Framework/IndianHealthService.BMXNet.WinForm/Forms/ChangeDivisionDialog.cs@ 1146

Last change on this file since 1146 was 1146, checked in by Sam Habiel, 13 years ago

Initial Import of BMX4

File size: 2.2 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Text;
7using System.Windows.Forms;
8using IndianHealthService.BMXNet.Model;
9using IndianHealthService.BMXNet.WinForm.Model;
10
11namespace IndianHealthService.BMXNet.Forms
12{
13 internal partial class ChangeDivisionDialog : Form
14 {
15 public ChangeDivisionDialog()
16 {
17 InitializeComponent();
18 }
19
20 private void cancelButton_Click(object sender, EventArgs e)
21 {
22
23 }
24
25 private void okButton_Click(object sender, EventArgs e)
26 {
27 this.DialogResult = DialogResult.OK;
28 this.Close();
29 }
30
31 private List<SelectableDivision> _divisions = new List<SelectableDivision>();
32
33 public List<SelectableDivision> Divisions
34 {
35 get { return _divisions; }
36 set { _divisions = value; }
37 }
38
39 private void ChangeDivisionDialog_Load(object sender, EventArgs e)
40 {
41 this.Icon = this.Owner.Icon;
42
43 this.divisionList.BeginUpdate();
44 this.divisionList.DataSource=this.Divisions;
45 foreach (WinDivision each in this.Divisions) {
46 if (each.MostRecentLookup)
47 {
48 this.divisionList.SelectedItem = each;
49 }
50 }
51 this.divisionList.EndUpdate();
52
53 this.divisionList.Focus();
54 this.UpdateCues();
55 }
56
57 private void divisionList_SelectedIndexChanged(object sender, EventArgs e)
58 {
59 this.UpdateCues();
60 }
61
62 public void UpdateCues()
63 {
64 this.okButton.Enabled = this.SelectedDivision!= null;
65 }
66
67 public Division SelectedDivision
68 {
69 get { return (Division)this.divisionList.SelectedItem; }
70 }
71
72 private void divisionList_DoubleClick(object sender, EventArgs e)
73 {
74 if (this.okButton.Enabled)
75 {
76 this.DialogResult = DialogResult.OK;
77 this.Close();
78 }
79 }
80
81 }
82}
Note: See TracBrowser for help on using the repository browser.