SampleService.cs
3.19 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Linq;
using System.Xml.Serialization;
using WebApp;
using WebMvc.Areas.WebService;
using WebRepository;
namespace WebMvc.Areas.WebService
{
public class SampleService : ISampleService
{
private IUnitWork _unitWork;
public IRepository<WebRepository.Task> _app;
public IRepository<Container> _appc;
public IRepository<Inventory> _appi;
public IRepository<Location> _appl;
public IRepository<ReceiptDetail> _apprd;
public IRepository<ReceiptHeader> _apprh;
public IRepository<ShipmentHeader> _apph;
public IRepository<ShipmentDetail> _appsd;
public IRepository<TaskDetail> _apptd;
public IRepository<InventoryTransaction> _appit;
private BaseDBContext _context;
private IAuth _auth;
public SampleService(IUnitWork unitWork, IAuth auth, IRepository<Inventory> inventory, IRepository<InventoryTransaction> inventoryTransaction, IRepository<Container> Icontainer, IRepository<ReceiptHeader> receiptHeader, IRepository<ReceiptDetail> receiptDetail, IRepository<WebRepository.Task> repository, IRepository<Location> repositoryl, IRepository<ShipmentHeader> repositoryh, IRepository<TaskDetail> repositorytd, IRepository<ShipmentDetail> repositorysd, BaseDBContext context)
{
_unitWork = unitWork;
_app = repository;
_appl = repositoryl;
_apph = repositoryh;
_appsd = repositorysd;
_apptd = repositorytd;
_apprd = receiptDetail;
_apprh = receiptHeader;
_appc = Icontainer;
_appi = inventory;
_appit = inventoryTransaction;
_context = context;
_auth = auth;
LoginInfo loginInfo = new LoginInfo
{
Account = "NouYaWeb"
};
SetLoginInfo(loginInfo);
}
public void SetLoginInfo(LoginInfo loginInfo)
{
_app._loginInfo = loginInfo;
_appl._loginInfo = loginInfo;
_apph._loginInfo = loginInfo;
_appsd._loginInfo = loginInfo;
_apptd._loginInfo = loginInfo;
_appc._loginInfo = loginInfo;
_apprd._loginInfo = loginInfo;
_apprh._loginInfo = loginInfo;
_appi._loginInfo = loginInfo;
_appit._loginInfo = loginInfo;
}
public string Ping(string Request, string msg)
{
return "Hello Word!!";
}
public ReceiptResponse ReceiptService(MaterialsInformation[] materials,string msg)
{
ReceiptResponse receiptResponse = new ReceiptResponse();
try
{
receiptResponse.Code = 200;
receiptResponse.materials = materials;
receiptResponse.Message = "success";
}
catch (Exception ex)
{
receiptResponse.Code = 300;
receiptResponse.Message = ex.Message;
}
return receiptResponse;
}
}
}