| | | 1 | | using System; |
| | | 2 | | using System.Collections.Generic; |
| | | 3 | | using System.IO; |
| | | 4 | | using System.Text; |
| | | 5 | | using WinSolutions.Sveta.Server.Data.DataModel.Contexts; |
| | | 6 | | using WinSolutions.Sveta.Server.Data.DataModel.Entities; |
| | | 7 | | |
| | | 8 | | namespace WinSolutions.Sveta.Server.Data.DataLoading |
| | | 9 | | { |
| | | 10 | | public class ParsingError |
| | | 11 | | { |
| | 0 | 12 | | public Exception Exception{get;set;} |
| | | 13 | | |
| | 0 | 14 | | public int LineNumber{get;set;} |
| | | 15 | | |
| | 0 | 16 | | public List<string> Line { get; set; } = new List<string>(); |
| | | 17 | | } |
| | | 18 | | |
| | | 19 | | |
| | | 20 | | public delegate void OnBeforeAddRecordDelegate(BaseRecord rec); |
| | | 21 | | public interface IDataLoader |
| | | 22 | | { |
| | | 23 | | LoadingResult Load(SvetaDbContext context,Stream stream); |
| | | 24 | | |
| | | 25 | | void Rollback(SvetaDbContext context,long uploadId); |
| | | 26 | | |
| | | 27 | | void Commit(SvetaDbContext context,long uploadId); |
| | | 28 | | |
| | | 29 | | void GetTemplate(SvetaDbContext context, Stream stream, bool csvFormat = true); |
| | | 30 | | |
| | | 31 | | Action<BaseRecord> BeforeAddRecordAction {get;set;} |
| | | 32 | | } |
| | | 33 | | } |