private void FormDefinitions_Closing(object sender, System.ComponentModel.CancelEventArgs e) { //Correct the item orders of all definition categories. List <Def> listDefUpdates = new List <Def>(); foreach (KeyValuePair <DefCat, List <Def> > kvp in Defs.GetDeepCopy()) { for (int i = 0; i < kvp.Value.Count; i++) { if (kvp.Value[i].ItemOrder != i) { kvp.Value[i].ItemOrder = i; listDefUpdates.Add(kvp.Value[i]); } } } listDefUpdates.ForEach(x => Defs.Update(x)); if (_isDefChanged || listDefUpdates.Count > 0) { DataValid.SetInvalid(InvalidType.Defs); } }
private void FormDefinitions_Closing(object sender, System.ComponentModel.CancelEventArgs e) { //Correct the item orders of all definition categories. List <Def> listDefUpdates = new List <Def>(); foreach (KeyValuePair <DefCat, List <Def> > kvp in Defs.GetDeepCopy()) { for (int i = 0; i < kvp.Value.Count; i++) { if (kvp.Value[i].ItemOrder != i) { kvp.Value[i].ItemOrder = i; listDefUpdates.Add(kvp.Value[i]); } } } listDefUpdates.ForEach(x => Defs.Update(x)); if (_isDefChanged || listDefUpdates.Count > 0) { //A specialty could have been renamed, invalidate the specialty associated to the currently selected patient just in case. PatientL.InvalidateSelectedPatSpecialty(); DataValid.SetInvalid(InvalidType.Defs); } }
private void RefreshDefs() { Defs.RefreshCache(); _listDefsAll = Defs.GetDeepCopy().SelectMany(x => x.Value).ToList(); }