Ejemplo n.º 1
0
        async public static void ShowErrMsg(string option, string msg)
        {
            Messenger.Default.Send<DialogMessage>(new DialogMessage(string.Format("An error was happend on {0}:\r\n{1}", option, msg), null), "showMsg");
            LogService.LogServiceClient client = new LogService.LogServiceClient();
            try
            {
                client.Open();
                var insertTask = client.InsertSystemLogAsync(new LogService.SystemLog
                {
                    Level = LogService.LogLevel.Error,
                    OptionDate = DateTime.Now,
                    Info = string.Format("Operation:{0} Error:{1}", option, msg)
                });
                await insertTask;
                client.Close();
            }
            finally
            {
                client.Abort();
            }

        }