username@email.com
21 小时以前 f0c21ec9c1e9c7cd5db58caeb760c7d7ca6df002
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
 
/**  
* OA_DriverRecordBLL.cs
*
* 功 能: 合作客户业务逻辑类
* 类 名: OA_DriverRecordBLL
*
* Ver    变更日期             负责人  变更内容
* ───────────────────────────────────
* V0.01  2013-4-2 15:11       吴辉      初版
* V0.02  2013-5-29 17:43      吴崎均    增加转换在线会员为厂商客户方法 
*
*
*
*
*
*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CY.IDAL;
using CY.Model;
using AbstractFactory;
using CY.IBaseDAL;
using CY.Infrastructure.DESEncrypt;
using CY.Infrastructure.Query;
 
namespace CY.BLL
{
    public class OA_DriverRecordBLL
    {
        IOA_DriverRecordDAL _IOA_DriverRecordDAL = null;
 
        /// <summary>
        /// 初始化构造
        /// </summary>
        public OA_DriverRecordBLL()
        {
            //获取OA_DriverRecord DAL实现
            _IOA_DriverRecordDAL = Factory.GetDALByInterfaceName(DALInterface.IOA_DriverRecordDAL) as IOA_DriverRecordDAL;
 
 
        }
 
         
        /// <summary>
        /// 获取全部合作客户
        /// </summary>
        /// <param name="Keyid">主键id</param>
        /// <returns></returns>
        public IEnumerable<OA_DriverRecord> GetModelList()
        {
            Query query = new Query();
            return _IOA_DriverRecordDAL.SelectAllModel(query);
        }
 
 
       
 
        /// <summary>
        /// 获取全部合作客户
        /// </summary>
        /// <param name="Keyid">主键id</param>
        /// <returns></returns>
        public OA_DriverRecord GetModelByKeyid(Guid keyid)
        {
 
            return _IOA_DriverRecordDAL.GetModelByKeyid(keyid);
        }
 
 
 
        /// <summary>
        /// 获取全部合作客户
        /// </summary>
        /// <param name="Keyid">主键id</param>
        /// <returns></returns>
        public OA_DriverRecord GetModelByTimeCarIDClockType(DateTime CreatTime, int CarID, int ClockType)
        {
 
            return _IOA_DriverRecordDAL.GetModelByTimeCarIDClockType(CreatTime, CarID, ClockType);
        }
 
 
        /// <summary>
        /// 查询合作客户分页列表
        /// </summary>
        /// <param name="pa"></param>
        /// <returns></returns>
        public IEnumerable<OA_DriverRecord> SelectModelPage(Pagination pa, string CreatTimeStart, string CreatTimeEnd,
            string CarID, string CreaterName,string ClockType)
        {
            string Condition = "  ";
            string sort = " CreatTime desc   ";
 
 
            if (!string.IsNullOrEmpty(CreatTimeStart))
            {
                Condition += " and DATEDIFF(day,'" + CreatTimeStart + "',od.[CreatTime]) >= 0    ";
              
            }
 
            if (!string.IsNullOrEmpty(CreatTimeEnd))
            {
                Condition += " and DATEDIFF(day,'" + CreatTimeEnd + "',od.[CreatTime]) <= 0    ";
             
            }
 
 
            if (!string.IsNullOrEmpty(CarID))
                Condition += " and  od.CarID = " + CarID + "";
            if (!string.IsNullOrEmpty(ClockType))
                Condition += " and  od.ClockType = " + ClockType + "";
            
 
            if (!string.IsNullOrEmpty(CreaterName))
                Condition += " and  od.Creater like '%" + CreaterName + "%'";
 
 
            Query query = new Query();
            IList<Criterion> criterias = new List<Criterion>()
            {
                new Criterion("", Condition),
 
                new Criterion("orderBy",sort)
            };
            query.Criteria = criterias;
            return _IOA_DriverRecordDAL.SelectModelPage(query, pa);
        }
 
 
 
    }
}