private async void ServiceGroupEdit_Load(object sender, EventArgs e)
{
Enabled = false;
using (var channel = ChannelManager.CreateChannel())
{
try
{
if (parenGrouptId != Guid.Empty)
{
parentGroup = await taskPool.AddTask(channel.Service.GetGroup(parenGrouptId));
}
if (groupId != Guid.Empty)
{
Group = await taskPool.AddTask(channel.Service.GetGroup(groupId));
}
else
{
Group = new LifeSituationGroup()
{
IsActive = true,
ParentGroup = parentGroup,
Code = "0.0",
Name = "Новая группа жизненной ситуации",
Columns = 2,
Rows = 5,
Color = "#FFFFFF",
FontSize = 1
};
}
Enabled = true;
}
catch (OperationCanceledException) { }
catch (CommunicationObjectAbortedException) { }
catch (ObjectDisposedException) { }
catch (InvalidOperationException) { }
catch (FaultException exception)
{
UIHelper.Warning(exception.Reason.ToString());
}
catch (Exception exception)
{
UIHelper.Warning(exception.Message);
}
}
}