Пример #1
0
        private void ClickImportCommand(object obj = null)
        {
            if (!Import.IsReady())
            {
                return;
            }

            Import.UpdateStatus(StatusMessage.Create(TransferStatus.Started, "Importing..."));
            Task.Run(() =>
            {
                try
                {
                    DBService db = new DBService(ConnectionString.GetString());
                    List <ItemPriceDTO> items = Serializer.FromCSV(Import.Path);
                    ImportResult results      = db.UpdateItemPrices(items);
                    ResultMessage message     = ResultMessage.Create(items, results);
                    ImportResultsToFile(results);
                    Import.UpdateStatus(StatusMessage.Create(TransferStatus.Success, message.Generate()));
                }
                catch (Exception ex)
                {
                    Import.UpdateStatus(StatusMessage.Create(TransferStatus.Failed, "Unable to read import file.", ex));
                }

                Import.UpdateStatus(StatusMessage.Create(TransferStatus.Stopped));
            });
        }
Пример #2
0
        public ResultMessage PostEntity(MessageEntity message)
        {
            DataManager.Instance.Info("message:" + message.message);
            DataManager.Instance.Info("type:" + message.type);
            DataManager.Instance.Info("level:" + message.level);

            return(ResultMessage.Create());
        }
Пример #3
0
        public ResultMessage PostMessage(string message, string type, string level)
        {
            DataManager.Instance.Info("message:" + message);
            DataManager.Instance.Info("type:" + type);
            DataManager.Instance.Info("level:" + level);

            //return DataManager.Instance.JsonResult();

            return(ResultMessage.Create());
        }
Пример #4
0
        public string JsonResult()
        {
            var result = ResultMessage.Create();

            return(JsonConvert.SerializeObject(result));
        }