Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
6fc02edd
Commit
6fc02edd
authored
Nov 22, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
63e04b17
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
124 additions
and
9 deletions
+124
-9
RB_Customer.cs
Edu.Model/Entity/Customer/RB_Customer.cs
+3
-7
CustomerModule.cs
Edu.Module.Customer/CustomerModule.cs
+88
-1
RB_CustomerRepository.cs
Edu.Repository/Customer/RB_CustomerRepository.cs
+33
-1
No files found.
Edu.Model/Entity/Customer/RB_Customer.cs
View file @
6fc02edd
using
Edu.Common.Enum.Customer
;
using
Edu.Common.Enum
;
using
Edu.Common.Enum.Customer
;
using
System
;
using
System
;
using
VT.FW.DB
;
using
VT.FW.DB
;
...
@@ -21,11 +22,6 @@ namespace Edu.Model.Entity.Customer
...
@@ -21,11 +22,6 @@ namespace Edu.Model.Entity.Customer
/// </summary>
/// </summary>
public
string
CustomerName
{
get
;
set
;
}
public
string
CustomerName
{
get
;
set
;
}
/// <summary>
/// 联系人
/// </summary>
public
string
ContactMan
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 联系电话
/// 联系电话
/// </summary>
/// </summary>
...
@@ -139,7 +135,7 @@ namespace Edu.Model.Entity.Customer
...
@@ -139,7 +135,7 @@ namespace Edu.Model.Entity.Customer
/// <summary>
/// <summary>
/// 状态 0正常,1删除
/// 状态 0正常,1删除
/// </summary>
/// </summary>
public
int
Status
{
get
;
set
;
}
public
DateStateEnum
Status
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 修改时间
/// 修改时间
...
...
Edu.Module.Customer/CustomerModule.cs
View file @
6fc02edd
using
Edu.Repository.Customer
;
using
Edu.Common.Enum
;
using
Edu.Model.ViewModel.Customer
;
using
Edu.Repository.Customer
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
VT.FW.DB
;
namespace
Edu.Module.Customer
namespace
Edu.Module.Customer
{
{
...
@@ -12,5 +16,88 @@ namespace Edu.Module.Customer
...
@@ -12,5 +16,88 @@ namespace Edu.Module.Customer
/// 同业客户管理仓储层对象
/// 同业客户管理仓储层对象
/// </summary>
/// </summary>
private
readonly
RB_CustomerRepository
customerRepository
=
new
RB_CustomerRepository
();
private
readonly
RB_CustomerRepository
customerRepository
=
new
RB_CustomerRepository
();
/// <summary>
/// 获取客户分页列表..
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Customer_Extend
>
GetCustomerPageModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Customer_Extend
query
)
{
var
list
=
customerRepository
.
GetCustomerPageRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
return
list
;
}
/// <summary>
/// 新增修改客户资料
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetCustomerModule
(
RB_Customer_Extend
model
)
{
bool
flag
;
if
(
model
.
CustomerId
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Customer_Extend
.
CustomerName
),
model
.
CustomerName
},
{
nameof
(
RB_Customer_Extend
.
ContactNumber
),
model
.
ContactNumber
},
{
nameof
(
RB_Customer_Extend
.
Fax
),
model
.
Fax
},
{
nameof
(
RB_Customer_Extend
.
QQ
),
model
.
QQ
},
{
nameof
(
RB_Customer_Extend
.
Email
),
model
.
Email
},
{
nameof
(
RB_Customer_Extend
.
Address
),
model
.
Address
},
{
nameof
(
RB_Customer_Extend
.
Sex
),
model
.
Sex
},
{
nameof
(
RB_Customer_Extend
.
CustomerSourceType
),
model
.
CustomerSourceType
},
{
nameof
(
RB_Customer_Extend
.
CustomerSource
),
model
.
CustomerSource
},
{
nameof
(
RB_Customer_Extend
.
CountryId
),
model
.
CountryId
},
{
nameof
(
RB_Customer_Extend
.
ProvinceId
),
model
.
ProvinceId
},
{
nameof
(
RB_Customer_Extend
.
CityId
),
model
.
CityId
},
{
nameof
(
RB_Customer_Extend
.
DistrictId
),
model
.
DistrictId
},
{
nameof
(
RB_Customer_Extend
.
LngLat
),
model
.
LngLat
},
{
nameof
(
RB_Customer_Extend
.
Account
),
model
.
Account
},
{
nameof
(
RB_Customer_Extend
.
Remark
),
model
.
Remark
},
{
nameof
(
RB_Customer_Extend
.
UpdateTime
),
model
.
UpdateTime
},
};
flag
=
customerRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Customer_Extend
.
CustomerId
),
model
.
CustomerId
));
}
else
{
var
newId
=
customerRepository
.
Insert
(
model
);
model
.
CustomerId
=
newId
;
flag
=
newId
>
0
;
}
return
flag
;
}
/// <summary>
/// 根据编号删除客户信息
/// </summary>
/// <param name="CustomerId"></param>
/// <returns></returns>
public
bool
RemoveCustomerModule
(
object
CustomerId
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Customer_Extend
.
Status
),(
int
)
DateStateEnum
.
Delete
},
};
var
flag
=
customerRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Customer_Extend
.
CustomerId
),
CustomerId
));
return
flag
;
}
/// <summary>
/// 根据客户编号获取客户实体类
/// </summary>
/// <param name="CustomerId"></param>
/// <returns></returns>
public
RB_Customer_Extend
GetCustomerModule
(
object
CustomerId
)
{
var
extModel
=
customerRepository
.
GetEntity
<
RB_Customer_Extend
>(
CustomerId
);
return
extModel
;
}
}
}
}
}
Edu.Repository/Customer/RB_CustomerRepository.cs
View file @
6fc02edd
using
Edu.Model.Entity.Customer
;
using
Edu.Common.Enum
;
using
Edu.Model.Entity.Customer
;
using
Edu.Model.ViewModel.Customer
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
namespace
Edu.Repository.Customer
namespace
Edu.Repository.Customer
{
{
...
@@ -10,5 +14,33 @@ namespace Edu.Repository.Customer
...
@@ -10,5 +14,33 @@ namespace Edu.Repository.Customer
/// </summary>
/// </summary>
public
class
RB_CustomerRepository
:
BaseRepository
<
RB_Customer
>
public
class
RB_CustomerRepository
:
BaseRepository
<
RB_Customer
>
{
{
/// <summary>
/// 获取客户分页列表..
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Customer_Extend
>
GetCustomerPageRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Customer_Extend
query
)
{
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*
FROM RB_Customer AS A
WHERE 1=1
"
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Customer_Extend
.
Status
),
(
int
)
DateStateEnum
.
Normal
);
if
(
query
!=
null
)
{
if
(!
string
.
IsNullOrEmpty
(
query
.
CustomerName
))
{
builder
.
AppendFormat
(
" AND A.{0} LIKE @CustomerName "
,
nameof
(
RB_Customer_Extend
.
CustomerName
));
parameters
.
Add
(
"CustomerName"
,
"%"
+
query
.
CustomerName
.
Trim
()
+
"%"
);
}
}
return
GetPage
<
RB_Customer_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment