コード例 #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);
        }
コード例 #2
0
 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));
 }
コード例 #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));
        }
コード例 #4
0
 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));
 }
コード例 #5
0
 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));
 }
コード例 #6
0
 public void Delete(int id)
 {
     Model.ClfContext context = new Model.ClfContext();
     new Service.ImportService(context).Delete(id);
 }
コード例 #7
0
 public Model.Import Get(long id)
 {
     Model.ClfContext context = new Model.ClfContext();
     return(new Service.ImportService(context).Get(id));
 }
コード例 #8
0
 public void Post([FromBody] Model.Import import)
 {
     Model.ClfContext context = new Model.ClfContext();
     new Service.ImportService(context).InsertOrUpdate(import);
 }
コード例 #9
0
 public void Delete(long id)
 {
     Model.ClfContext context = new Model.ClfContext();
     new Service.LogRowMismatchService(context).Delete(id);
 }
コード例 #10
0
 public Model.LogRowMismatch Get(long id)
 {
     Model.ClfContext context = new Model.ClfContext();
     return(new Service.LogRowMismatchService(context).Get(id));
 }
コード例 #11
0
 public bool Post([FromBody] Model.LogRowMismatch entity)
 {
     Model.ClfContext context = new Model.ClfContext();
     return(new Service.LogRowMismatchService(context).TryCorrect(entity));
 }
コード例 #12
0
 public void Post([FromBody] Model.LogRow entity)
 {
     Model.ClfContext context = new Model.ClfContext();
     new Service.LogRowService(context).InsertOrUpdate(entity);
 }