private void btnSave_Click(object sender, EventArgs e) { _phase.Title = txtPhaseName.Text; _phase.Column1Text = col1HtmlEditorControl.InnerHtml; _phase.Column2Text = col2HtmlEditorControl.InnerHtml; _phase.Column3Text = col3HtmlEditorControl.InnerHtml; _phase.PractitionersTips = practitionersTipsHtmlEditorControl.InnerHtml; // Reorder bullets (they were ordereded in the control, but need to reorder the underlying list: column1BulletList.SortList(); column2BulletList.SortList(); column3BulletList.SortList(); //delete phase bullets removed by the user. foreach (int idPhaseBullet in column1BulletList.PhaseBulletsIDsToDelete) { PhaseBulletHelper.Delete(idPhaseBullet); } foreach (int idPhaseBullet in column2BulletList.PhaseBulletsIDsToDelete) { PhaseBulletHelper.Delete(idPhaseBullet); } foreach (int idPhaseBullet in column3BulletList.PhaseBulletsIDsToDelete) { PhaseBulletHelper.Delete(idPhaseBullet); } foreach (PhaseBullet phaseBullet in column1BulletList.Bullets) { phaseBullet.ColumnNumber = 1; phaseBullet.IDPhase = _phase.IDPhase; } foreach (PhaseBullet phaseBullet in column2BulletList.Bullets) { phaseBullet.ColumnNumber = 2; phaseBullet.IDPhase = _phase.IDPhase; } foreach (PhaseBullet phaseBullet in column3BulletList.Bullets) { phaseBullet.ColumnNumber = 3; phaseBullet.IDPhase = _phase.IDPhase; } try { PhaseHelper.Validate(_phase); PhaseHelper.Save(_phase); PhaseBulletHelper.SaveColumnBullets(column1BulletList.Bullets); PhaseBulletHelper.SaveColumnBullets(column2BulletList.Bullets); PhaseBulletHelper.SaveColumnBullets(column3BulletList.Bullets); PhaseHelper.GenerateAllFiles(_phase); DocumentHelper.DownloadFilesAsync(); CustomMessageBox.ShowMessage(ResourceHelper.GetResourceText("PhaseSavedOk")); LoadCombo(); } catch (Exception exception) { CustomMessageBox.ShowError(exception.Message); } }