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)); }); }
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()); }
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()); }
public string JsonResult() { var result = ResultMessage.Create(); return(JsonConvert.SerializeObject(result)); }