private void Save() { Hashtable htColumnsShowsNew = new Hashtable(); for (int i = 0; i < fpColumnShows_Sheet1.RowCount; i++) { string id = fpColumnShows_Sheet1.Cells[i, 0].Text; Objects.Column c = htColumnsShows[id] as Objects.Column; if (c == null) { c = htColumnsUnShows[id] as Objects.Column; } Objects.Column newC = c.Clone(); newC.SortId = i; htColumnsShowsNew.Add(newC.ID, newC); } Hashtable htColumnsUnShowsNew = new Hashtable(); for (int i = 0; i < fpColumnUnShows_Sheet1.RowCount; i++) { string id = fpColumnUnShows_Sheet1.Cells[i, 0].Text; Objects.Column c = htColumnsShows[id] as Objects.Column; if (c == null) { c = htColumnsUnShows[id] as Objects.Column; } Objects.Column newC = c.Clone(); newC.SortId = i; htColumnsUnShowsNew.Add(newC.ID, newC); } Hashtable htConditionsShowsNew = new Hashtable(); for (int i = 0; i < fpConditionShows_Sheet1.RowCount; i++) { string id = fpConditionShows_Sheet1.Cells[i, 0].Text; Objects.Condition c = htConditionsShows[id] as Objects.Condition; if (c == null) { c = htConditionsUnShows[id] as Objects.Condition; } Objects.Condition newC = c.Clone(); newC.SortId = i; htConditionsShowsNew.Add(newC.ID, newC); } Hashtable htConditionsUnShowsNew = new Hashtable(); for (int i = 0; i < fpConditionUnShows_Sheet1.RowCount; i++) { string id = fpConditionUnShows_Sheet1.Cells[i, 0].Text; Objects.Condition c = htConditionsShows[id] as Objects.Condition; if (c == null) { c = htConditionsUnShows[id] as Objects.Condition; } Objects.Condition newC = c.Clone(); newC.SortId = i; htConditionsUnShowsNew.Add(newC.ID, newC); } if (OnSave != null) { OnSave(htColumnsShowsNew, htColumnsUnShowsNew, htConditionsShowsNew, htConditionsUnShowsNew); } Close(); }