-
Notifications
You must be signed in to change notification settings - Fork 0
/
PassengerBL.cs
90 lines (76 loc) · 3.27 KB
/
PassengerBL.cs
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 DataAccessLib;
using ModelLib.Bases;
using ModelLib.Common;
using ModelLib.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UtilLib;
namespace BusinessLib
{
public class PassengerBL : BusinessBase
{
PassengerDA _passengerDA;
public PassengerBL()
: base(GlobalSettings.CustomerLogger)
{
_passengerDA = new PassengerDA();
}
public BusinessResponse<Passenger> SavePassenger(Passenger passenger)
{
Func<BusinessResponse<Passenger>, List<Passenger>> injector = (ret) =>
{
List<Passenger> pax = new List<Passenger>();
pax.Add(_passengerDA.Save(passenger));
return pax;
};
return ExecuteBusiness("PassengerBL.SavePassenger", injector);
}
public BusinessResponse<Passenger> GetPassengerByID(Passenger passenger)
{
Func<BusinessResponse<Passenger>, List<Passenger>> injector = (ret) =>
{
List<Passenger> passengersList = new List<Passenger>();
passengersList.Add(_passengerDA.GetByID(passenger));
return passengersList;
};
return ExecuteBusiness("PassengerBL.GetPassengerByID", injector);
}
public BusinessResponse<Passenger> FindPassenger(SearchModel<Passenger> searchQ)
{
Func<BusinessResponse<Passenger>, List<Passenger>> injector = (ret) =>
{
SearchResult<Passenger> passengersDetails = _passengerDA.Find(searchQ);
List<Passenger> passengersDetailsRes = new List<Passenger>();
passengersDetailsRes = passengersDetails.SearchResultList;
ret.MetaData.TotalRecords = passengersDetails.TotalRecords;
return passengersDetailsRes;
};
return ExecuteBusiness("PassengerBL.FindPassenger", injector);
}
public BusinessResponse<Passenger> DeletePassenger(Passenger passenger)
{
Func<BusinessResponse<Passenger>, List<Passenger>> injector = (ret) =>
{
List<Passenger> passengerDetails = new List<Passenger>();
passengerDetails.Add(_passengerDA.Delete(passenger));
return passengerDetails;
};
return ExecuteBusiness("PassengerBL.DeletePassenger", injector);
}
public BusinessResponse<PassengerDetails> FindPassengerDetails(SearchModel<PassengerDetails> searchQ)
{
Func<BusinessResponse<PassengerDetails>, List<PassengerDetails>> injector = (ret) =>
{
SearchResult<PassengerDetails> passengersDetails = _passengerDA.Find(searchQ);
List<PassengerDetails> passengersDetailsRes = new List<PassengerDetails>();
passengersDetailsRes = passengersDetails.SearchResultList;
ret.MetaData.TotalRecords = passengersDetails.TotalRecords;
return passengersDetailsRes;
};
return ExecuteBusiness("PassengerBL.FindPassenger", injector);
}
}
}