Beispiel #1
0
        public IEnumerable <DTO.UserAgent> Get()
        {
            IEnumerable <DTO.UserAgent> collection;

            Model.ClfContext context = new Model.ClfContext();
            collection = new Service.LogRowService(context).GetDistinctUserAgents();
            return(collection);
        }
 public IEnumerable <Model.LogRowMismatch> Get(long importId, string exception, string row, int page, int size)
 {
     Model.ClfContext     context        = new Model.ClfContext();
     Model.LogRowMismatch logRowMismatch = new Model.LogRowMismatch
     {
         ImportId        = importId,
         ThrownException = exception,
         Row             = row
     };
     return(new Service.LogRowMismatchService(context).Filter(logRowMismatch, page, size));
 }
Beispiel #3
0
        public Model.Import Post([FromForm] IFormFile file)
        {
            string dir          = Path.Combine(Directory.GetCurrentDirectory(), "ProcessedFiles");
            string fileName     = ContentDispositionHeaderValue.Parse(file.ContentDisposition).FileName.Trim('"');
            string uploadedFile = Path.Combine(dir, fileName);

            using (FileStream stream = new FileStream(uploadedFile, FileMode.Create))
            {
                file.CopyTo(stream);
            }
            Service.FileProcessor processor = new Service.FileProcessor(uploadedFile);
            Model.ClfContext      context   = new Model.ClfContext();
            return(processor.ProcessFile(context));
        }
 public IEnumerable <Model.Import> Filter(int success, int error, string fileName, DateTime when)
 {
     //Model.Import.When
     //Model.Import.SuccessCount
     //Model.Import.ErrorCount
     //Model.Import.FileName
     Model.Import filter = new Model.Import
     {
         ErrorCount   = error,
         SuccessCount = success,
         FileName     = fileName,
         When         = when
     };
     Model.ClfContext context = new Model.ClfContext();
     return(new Service.ImportService(context).Filter(filter));
 }
 public IEnumerable <Model.LogRow> Get(long importId, string ipAddress, short responseCode, DateTime when, string userAgent, string method, int page, int size)
 {
     //Model.LogRow.ImportId
     //Model.LogRow.IpAddress
     //Model.LogRow.ResponseCode
     //Model.LogRow.Date
     //Model.LogRow.UserAgent
     //Model.LogRow.Method
     Model.ClfContext context = new Model.ClfContext();
     Model.LogRow     logRow  = new Model.LogRow
     {
         ImportId     = importId,
         IpAddress    = ipAddress,
         ResponseCode = responseCode,
         Date         = when,
         UserAgent    = userAgent
     };
     if (!string.IsNullOrEmpty(method))
     {
         logRow.SetMethodByName(method);
     }
     return(new Service.LogRowService(context).Filter(logRow, page, size));
 }
 public void Delete(int id)
 {
     Model.ClfContext context = new Model.ClfContext();
     new Service.ImportService(context).Delete(id);
 }
 public Model.Import Get(long id)
 {
     Model.ClfContext context = new Model.ClfContext();
     return(new Service.ImportService(context).Get(id));
 }
 public void Post([FromBody] Model.Import import)
 {
     Model.ClfContext context = new Model.ClfContext();
     new Service.ImportService(context).InsertOrUpdate(import);
 }
 public void Delete(long id)
 {
     Model.ClfContext context = new Model.ClfContext();
     new Service.LogRowMismatchService(context).Delete(id);
 }
 public Model.LogRowMismatch Get(long id)
 {
     Model.ClfContext context = new Model.ClfContext();
     return(new Service.LogRowMismatchService(context).Get(id));
 }
 public bool Post([FromBody] Model.LogRowMismatch entity)
 {
     Model.ClfContext context = new Model.ClfContext();
     return(new Service.LogRowMismatchService(context).TryCorrect(entity));
 }
 public void Post([FromBody] Model.LogRow entity)
 {
     Model.ClfContext context = new Model.ClfContext();
     new Service.LogRowService(context).InsertOrUpdate(entity);
 }