UpgradeSelectionDlg : Cutom button with an action that is commented out, ver. 2.26.1555

This commit is contained in:
Milan Hanajik
2020-12-10 12:50:19 +01:00
parent 18506390fa
commit de0b84076f
3 changed files with 67 additions and 2 deletions
+52
View File
@@ -11,6 +11,7 @@ using NHibernate;
using Results;
using Results.Entities;
using TBF.Resources;
using System.Text;
namespace TBF.UI.Settings
{
@@ -1041,5 +1042,56 @@ namespace TBF.UI.Settings
"Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void customButton_Click(object sender, EventArgs e)
{
ActivityStart();
try
{
//ISession session = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config);
//var proceduresToModify = session.QueryOver<Config.Entities.Procedure>()
// .Where(x => (x.ProcedureState == Config.Entities.ProcedureState.Active))
// .OrderBy(x => x.ItemNr).Asc
// .List<Config.Entities.Procedure>();
//foreach (var proc in proceduresToModify)
//{
// if (!string.IsNullOrEmpty(proc.ResultsWriter) && proc.ResultsWriter.Contains("IperlLogger"))
// {
// Console.WriteLine("{0} ... {1}", proc.Name, proc.ResultsWriter);
// string[] writers = proc.ResultsWriter.Split(new char[] { '~' });
// StringBuilder sb = new StringBuilder();
// for (int i = 0; i < writers.Length; i++)
// {
// if (writers[i].Contains("IperlLogger"))
// {
// sb.Append("IperlLogger");
// }
// else
// {
// sb.Append(writers[i]);
// }
// if (i != writers.Length - 1) sb.Append("~");
// }
// proc.ResultsWriter = sb.ToString();
// session.SaveOrUpdate(proc);
// }
//}
//session.Flush();
ActivityEnd();
MessageBox.Show("Upgrade completed", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception exc)
{
ActivityEnd();
MessageBox.Show(string.Format("Upgrade failed:\r\n{0}", exc.Message),
"Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
}