AmsLaserficheDataProvider
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
using LFSO100Lib;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace AmsLaserficheDataProvider.Controllers
{
public class PreLevyController : ApiController
{
public IHttpActionResult Get(string id)
{
if (WebApiApplication.IsConnectedToLaserfiche)
{
if (id.IndexOf("-", 0) < 0)
{
return Ok(
new Models.ErrorModel(true, "Cycle number was not provided.")
);
}
try
{
string[] results = id.Split(new char[] { '-' });
string path = ConfigurationManager.AppSettings["LF_ROOT"] + results[0] + "\\" + results[1] + "\\Pre-Levy Mail";
ILFEntry entry = WebApiApplication.LaserficheConnection.Database.GetEntryByPath(path);
return Ok(
new Models.EntryModel(entry.ID)
);
}
catch (Exception ex)
{
return Ok(
new Models.ErrorModel(true, ex.Message)
);
}
}
else
{
return Ok(
new Models.ErrorModel(true, WebApiApplication.LaserficheConnectionError)
);
}
}
}
}
|
Revision |
Author |
Commited |
Message |
1
|
BBDSCHRIS
|
Thu 09 Aug, 2018 12:33:02 +0000 |
|