Commit 8ab4ab80 authored by liudong1993's avatar liudong1993

1

parent d9252b72
......@@ -232,6 +232,45 @@ namespace REBORN.Module.DMCModule
if (id > 0)
{
flag = true;
if (!string.IsNullOrEmpty(model.BankNo) && !string.IsNullOrEmpty(model.OpeningBank)) {
//查询一下 卡号是否存在, 不存在 就插入
string bankNo = System.Text.RegularExpressions.Regex.Replace(model.BankNo, @"[^0-9]+", "");
if (!string.IsNullOrEmpty(bankNo))
{
bool IsCreate = true;
var list = clientBankAccountRepository.GetBankAccountListRepository(new Model.Extend.Finance.RB_ClientBankAccount_Extend() { RB_Group_Id = model.RB_Group_id, CardNum = bankNo });
if (list.Any())
{
foreach (var item in list)
{
string cardNum2 = System.Text.RegularExpressions.Regex.Replace(item.CardNum, @"[^0-9]+", "");
if (bankNo.Replace(" ", "") == cardNum2.Replace(" ", ""))
{
IsCreate = false;
}
}
}
if (IsCreate) {
clientBankAccountRepository.Insert(new Model.Entity.Finance.RB_ClientBankAccount()
{
ID = 0,
Type = Common.Enum.Finance.ClientTypeEnum.HotelSupplier,
ObjID = id,
BankId = 0,
OpenBankName = model.OpeningBank,
CardNum = model.BankNo,
AccountHolder = !string.IsNullOrEmpty(model.CompanyName) ? model.CompanyName : model.Name,
AccountAlias = model.Name,
AccountClassify = 2,
Status = 0,
CreateBy = model.UpdateBy,
CreateDate = DateTime.Now,
RB_Group_Id = model.RB_Group_id,
AccountType = 1
});
}
}
}
}
}
if (flag)//新增供应商类型
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment