private void ListBoxICDCodes_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (this.ListBoxICDCodes.SelectedItem != null) { YellowstonePathology.Business.Billing.Model.ICDCode icdCode = (YellowstonePathology.Business.Billing.Model.ICDCode) this.ListBoxICDCodes.SelectedItem; ICDCodeEditDialog dlg = new ICDCodeEditDialog(icdCode); bool?dialogResult = dlg.ShowDialog(); if (dialogResult.HasValue && dialogResult.Value == true) { YellowstonePathology.Business.Billing.Model.ICDCodeCollection.Refresh(); this.NotifyPropertyChanged("ICDCodeCollection"); } } }
public ICDCodeEditDialog(YellowstonePathology.Business.Billing.Model.ICDCode icdCode) { if (icdCode == null) { this.m_ICDCode = new Business.Billing.Model.ICDCode(); } else { this.m_ICDCode = icdCode; } this.m_ICDCodeString = this.m_ICDCode.ToJSON(); this.m_HoldToCompareString = this.m_ICDCode.ToJSON(); InitializeComponent(); DataContext = this; }
private static ICDCodeCollection Load() { ICDCodeCollection result = new Model.ICDCodeCollection(); MySqlCommand cmd = new MySqlCommand("Select JSONValue from tblICDCode;"); cmd.CommandType = CommandType.Text; using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { YellowstonePathology.Business.Billing.Model.ICDCode icdCode = YellowstonePathology.Business.Billing.Model.ICDCodeFactory.FromJson(dr[0].ToString()); result.Add(icdCode); } } } return(result); }
private void ButtonOK_Click(object sender, RoutedEventArgs e) { Business.Rules.MethodResult result = this.CanSave(); if (result.Success == true) { if (this.m_HoldToCompareString != this.m_ICDCodeString) { YellowstonePathology.Business.Billing.Model.ICDCode codeToSave = YellowstonePathology.Business.Billing.Model.ICDCodeFactory.FromJson(this.m_ICDCodeString); codeToSave.Save(); this.DialogResult = true; } else { this.DialogResult = false; } this.Close(); } else { MessageBox.Show(result.Message); } }