|
@@ -627,16 +627,18 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
CreateUserId = _UserId
|
|
|
};
|
|
|
|
|
|
- var companyAdd = await _sqlSugar.Insertable(_CustomerCompany).ExecuteReturnIdentityAsync();
|
|
|
- if (companyAdd < 0)
|
|
|
+ var companyAdd = await _sqlSugar.Insertable(_CustomerCompany).ExecuteReturnEntityAsync();
|
|
|
+ if (companyAdd == null)
|
|
|
{
|
|
|
_Msg += string.Format("{0} 公司信息添加失败!请前往客户信息确认!\r\n", clientName);
|
|
|
}
|
|
|
- companyId = companyAdd;
|
|
|
+ _CustomerCompanies.Add(companyAdd);
|
|
|
+ companyId = companyAdd.Id;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Crm_DeleClient _DeleClient = new Crm_DeleClient() {
|
|
|
+ Crm_DeleClient _DeleClient = new Crm_DeleClient() {
|
|
|
+ CrmCompanyId = companyId,
|
|
|
LastName = item.LastName,
|
|
|
FirstName = item.FirstName,
|
|
|
Pinyin = item.Pinyin,
|
|
@@ -651,6 +653,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
|
|
|
var clientEdit = await _sqlSugar.Updateable(_DeleClient).UpdateColumns(it =>
|
|
|
new
|
|
|
{
|
|
|
+ it.CrmCompanyId,
|
|
|
it.LastName,
|
|
|
it.FirstName,
|
|
|
it.Sex,
|