|
@@ -282,258 +282,250 @@ Order By i.id Desc ", sqlWhere);
|
|
|
{
|
|
|
Result result = new Result() { Code = -2, Msg = "程序错误!" };
|
|
|
BeginTran();
|
|
|
- try
|
|
|
+
|
|
|
+ int id = 0;
|
|
|
+ Grp_InvitationOfficialActivities grp_Invitation = _mapper.Map<Grp_InvitationOfficialActivities>(dto);
|
|
|
+ if (dto.Status == 1)//添加
|
|
|
{
|
|
|
- int id = 0;
|
|
|
- Grp_InvitationOfficialActivities grp_Invitation = _mapper.Map<Grp_InvitationOfficialActivities>(dto);
|
|
|
- if (dto.Status == 1)//添加
|
|
|
- {
|
|
|
- //string selectSql = string.Format(@"select * from Grp_InvitationOfficialActivities where InviterArea='{0}' and Inviter='{1}' and DiId={2} and IsDel={3}"
|
|
|
- // , dto.InviterArea, dto.Inviter, dto.DiId, 0);
|
|
|
- //var _InvitationOfficialActivities = await _sqlSugar.SqlQueryable<Grp_InvitationOfficialActivities>(selectSql).FirstAsync();//查询是否存在
|
|
|
- //if (_InvitationOfficialActivities != null)
|
|
|
- //{
|
|
|
- // return result = new Result() { Code = -1, Msg = "该数据已存在,请勿重复添加!" };
|
|
|
- //}
|
|
|
+ //string selectSql = string.Format(@"select * from Grp_InvitationOfficialActivities where InviterArea='{0}' and Inviter='{1}' and DiId={2} and IsDel={3}"
|
|
|
+ // , dto.InviterArea, dto.Inviter, dto.DiId, 0);
|
|
|
+ //var _InvitationOfficialActivities = await _sqlSugar.SqlQueryable<Grp_InvitationOfficialActivities>(selectSql).FirstAsync();//查询是否存在
|
|
|
+ //if (_InvitationOfficialActivities != null)
|
|
|
+ //{
|
|
|
+ // return result = new Result() { Code = -1, Msg = "该数据已存在,请勿重复添加!" };
|
|
|
+ //}
|
|
|
|
|
|
- id = await AddAsyncReturnId(grp_Invitation);
|
|
|
- if (id != 0)//修改或添加商邀资料
|
|
|
+ id = await AddAsyncReturnId(grp_Invitation);
|
|
|
+ if (id != 0)//修改或添加商邀资料
|
|
|
+ {
|
|
|
+ Res_InvitationOfficialActivityData res_InvitationData = _mapper.Map<Res_InvitationOfficialActivityData>(dto);
|
|
|
+ res_InvitationData.Country = dto.InviterArea;
|
|
|
+ res_InvitationData.UnitName = dto.Inviter;
|
|
|
+ res_InvitationData.Delegation = dto.DiId.ToString();
|
|
|
+ Res_InvitationOfficialActivityData ifNullUp = await _sqlSugar.Queryable<Res_InvitationOfficialActivityData>().FirstAsync
|
|
|
+ (a => a.Country == res_InvitationData.Country && a.City == res_InvitationData.City && a.UnitName == res_InvitationData.UnitName && a.IsDel == 0);
|
|
|
+ if (ifNullUp == null)///添加或修改商邀资料
|
|
|
{
|
|
|
- Res_InvitationOfficialActivityData res_InvitationData = _mapper.Map<Res_InvitationOfficialActivityData>(dto);
|
|
|
- res_InvitationData.Country = dto.InviterArea;
|
|
|
- res_InvitationData.UnitName = dto.Inviter;
|
|
|
- res_InvitationData.Delegation = dto.DiId.ToString();
|
|
|
- Res_InvitationOfficialActivityData ifNullUp = await _sqlSugar.Queryable<Res_InvitationOfficialActivityData>().FirstAsync
|
|
|
- (a => a.Country == res_InvitationData.Country && a.City == res_InvitationData.City && a.UnitName == res_InvitationData.UnitName && a.IsDel == 0);
|
|
|
- if (ifNullUp == null)///添加或修改商邀资料
|
|
|
+ res_InvitationData.Remark = dto.OtherInformation;
|
|
|
+ int DataID = await _sqlSugar.Insertable(res_InvitationData).ExecuteReturnIdentityAsync();
|
|
|
+ if (DataID != 0)
|
|
|
{
|
|
|
- res_InvitationData.Remark = dto.OtherInformation;
|
|
|
- int DataID = await _sqlSugar.Insertable(res_InvitationData).ExecuteReturnIdentityAsync();
|
|
|
- if (DataID != 0)
|
|
|
- {
|
|
|
- result = new Result() { Code = 0, Msg = "添加成功!" };
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- RollbackTran();
|
|
|
- result = new Result() { Code = -1, Msg = "添加失败!" };
|
|
|
- }
|
|
|
-
|
|
|
+ result = new Result() { Code = 0, Msg = "添加成功!" };
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- int CTable = await _sqlSugar.Updateable<Res_InvitationOfficialActivityData>().Where(a => a.Id == ifNullUp.Id).SetColumns(a => new Res_InvitationOfficialActivityData
|
|
|
- {
|
|
|
- Contact = dto.Contact,
|
|
|
- Tel = dto.Tel,
|
|
|
- Email = dto.Email,
|
|
|
- Fax = dto.Fax,
|
|
|
- Address = dto.Address,
|
|
|
- Remark = dto.OtherInformation,
|
|
|
- }).ExecuteCommandAsync();
|
|
|
+ RollbackTran();
|
|
|
+ result = new Result() { Code = -1, Msg = "添加失败!" };
|
|
|
}
|
|
|
|
|
|
- Grp_CreditCardPayment C = new Grp_CreditCardPayment();
|
|
|
- C.PayDId = dto.PayDId;
|
|
|
- //if (C.PayDId == 72) C.IsPay = 1;
|
|
|
- //else C.IsPay = 0;
|
|
|
-
|
|
|
- C.ConsumptionPatterns = dto.ConsumptionPatterns;
|
|
|
- C.ConsumptionDate = dto.ConsumptionDate;
|
|
|
- C.CTDId = dto.CTDId;
|
|
|
- C.BankNo = dto.BankNo;
|
|
|
- C.CardholderName = dto.CardholderName;
|
|
|
- C.PayMoney = dto.PayMoney;
|
|
|
- C.PaymentCurrency = dto.PaymentCurrency;
|
|
|
- C.CompanyBankNo = dto.CompanyBankNo;
|
|
|
- C.OtherBankName = dto.OtherBankName;
|
|
|
- C.OtherSideNo = dto.OtherSideNo;
|
|
|
- C.OtherSideName = dto.OtherSideName;
|
|
|
- C.Remark = "";
|
|
|
- C.CreateUserId = dto.CreateUserId;
|
|
|
- C.MFOperator = 0;
|
|
|
- C.MFOperatorDate = "";
|
|
|
- C.IsAuditDM = 0;
|
|
|
- C.AuditDMOperate = 0;
|
|
|
- C.AuditDMDate = "";
|
|
|
- C.IsAuditMF = 0;
|
|
|
- C.AuditMFOperate = 0;
|
|
|
- C.AuditMFDate = "";
|
|
|
- C.IsAuditGM = 0;
|
|
|
- C.AuditGMOperate = 0;
|
|
|
- C.AuditGMDate = "";
|
|
|
- C.IsPay = 0;
|
|
|
- C.DIId = dto.DiId;
|
|
|
- C.CId = id;
|
|
|
- C.CTable = 81;
|
|
|
- C.PayPercentage = 100;
|
|
|
- C.PayThenMoney = 0;
|
|
|
- C.PayPercentageOld = 0;
|
|
|
- C.PayThenMoneyOld = 0;
|
|
|
- C.UpdateDate = "";
|
|
|
- C.Payee = dto.Payee;
|
|
|
- C.OrbitalPrivateTransfer = dto.OrbitalPrivateTransfer;
|
|
|
- C.ExceedBudget = 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ int CTable = await _sqlSugar.Updateable<Res_InvitationOfficialActivityData>()
|
|
|
+ .Where(a => a.Id == ifNullUp.Id)
|
|
|
+ .SetColumns(a => new Res_InvitationOfficialActivityData
|
|
|
+ {
|
|
|
+ Contact = dto.Contact,
|
|
|
+ Tel = dto.Tel,
|
|
|
+ Email = dto.Email,
|
|
|
+ Fax = dto.Fax,
|
|
|
+ Address = dto.Address,
|
|
|
+ Remark = dto.OtherInformation,
|
|
|
+ })
|
|
|
+ .ExecuteCommandAsync();
|
|
|
+ }
|
|
|
|
|
|
- //获取新汇率 int diId,int CId, int currencyId
|
|
|
- var rate = await fn(dto.DiId, 81, dto.InviteCurrency);
|
|
|
+ Grp_CreditCardPayment C = new Grp_CreditCardPayment();
|
|
|
+ C.PayDId = dto.PayDId;
|
|
|
+ if (C.PayDId == 72) C.IsPay = 1;
|
|
|
+ else C.IsPay = 0;
|
|
|
|
|
|
- if (rate.Code == 0)
|
|
|
- {
|
|
|
- var rateInfo = (rate.Data as CurrencyInfo);
|
|
|
- if (rateInfo is not null)
|
|
|
- {
|
|
|
+ C.ConsumptionPatterns = dto.ConsumptionPatterns;
|
|
|
+ C.ConsumptionDate = dto.ConsumptionDate;
|
|
|
+ C.CTDId = dto.CTDId;
|
|
|
+ C.BankNo = dto.BankNo;
|
|
|
+ C.CardholderName = dto.CardholderName;
|
|
|
+ C.PayMoney = dto.PayMoney;
|
|
|
+ C.PaymentCurrency = dto.PaymentCurrency;
|
|
|
+ C.CompanyBankNo = dto.CompanyBankNo;
|
|
|
+ C.OtherBankName = dto.OtherBankName;
|
|
|
+ C.OtherSideNo = dto.OtherSideNo;
|
|
|
+ C.OtherSideName = dto.OtherSideName;
|
|
|
+ C.Remark = "";
|
|
|
+ C.CreateUserId = dto.CreateUserId;
|
|
|
+ C.MFOperator = 0;
|
|
|
+ C.MFOperatorDate = "";
|
|
|
+ C.IsAuditDM = 0;
|
|
|
+ C.AuditDMOperate = 0;
|
|
|
+ C.AuditDMDate = "";
|
|
|
+ C.IsAuditMF = 0;
|
|
|
+ C.AuditMFOperate = 0;
|
|
|
+ C.AuditMFDate = "";
|
|
|
+ C.IsAuditGM = 0;
|
|
|
+ C.AuditGMOperate = 0;
|
|
|
+ C.AuditGMDate = "";
|
|
|
+ C.DIId = dto.DiId;
|
|
|
+ C.CId = id;
|
|
|
+ C.CTable = 81;
|
|
|
+ C.PayPercentage = 100;
|
|
|
+ C.PayThenMoney = 0;
|
|
|
+ C.PayPercentageOld = 0;
|
|
|
+ C.PayThenMoneyOld = 0;
|
|
|
+ C.UpdateDate = "";
|
|
|
+ C.Payee = dto.Payee;
|
|
|
+ C.OrbitalPrivateTransfer = dto.OrbitalPrivateTransfer;
|
|
|
+ C.ExceedBudget = 0;
|
|
|
|
|
|
- C.DayRate = rateInfo.Rate;
|
|
|
- C.RMBPrice = rateInfo.Rate * C.PayMoney;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- C.DayRate = 1;
|
|
|
- C.RMBPrice = C.PayMoney;
|
|
|
- }
|
|
|
- }
|
|
|
+ //获取新汇率 int diId,int CId, int currencyId
|
|
|
+ var rate = await fn(dto.DiId, 81, dto.InviteCurrency);
|
|
|
|
|
|
- int cId = await _sqlSugar.Insertable(C).ExecuteReturnIdentityAsync();
|
|
|
- var data = new { ccpId = cId, sign = 1 };
|
|
|
- if (cId != 0)
|
|
|
+ if (rate.Code == 0)
|
|
|
+ {
|
|
|
+ var rateInfo = (rate.Data as CurrencyInfo);
|
|
|
+ if (rateInfo is not null)
|
|
|
{
|
|
|
- result = new Result() { Code = 0, Msg = "添加成功!", Data = data };
|
|
|
+
|
|
|
+ C.DayRate = rateInfo.Rate;
|
|
|
+ C.RMBPrice = rateInfo.Rate * C.PayMoney;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- RollbackTran();
|
|
|
- result = new Result() { Code = -1, Msg = "添加失败!" };
|
|
|
+ C.DayRate = 1;
|
|
|
+ C.RMBPrice = C.PayMoney;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ int cId = await _sqlSugar.Insertable(C).ExecuteReturnIdentityAsync();
|
|
|
+ var data = new { ccpId = cId, sign = 1 };
|
|
|
+ if (cId != 0)
|
|
|
+ {
|
|
|
+ result = new Result() { Code = 0, Msg = "添加成功!", Data = data };
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ RollbackTran();
|
|
|
+ result = new Result() { Code = -1, Msg = "添加失败!" };
|
|
|
+ }
|
|
|
}
|
|
|
- else//修改
|
|
|
+ }
|
|
|
+ else//修改
|
|
|
+ {
|
|
|
+ var thisTime = new DateTime();
|
|
|
+ DateTime.TryParse(dto.InviteTime, out thisTime);
|
|
|
+ bool res = await UpdateAsync(a => a.Id == grp_Invitation.Id, a => new Grp_InvitationOfficialActivities
|
|
|
{
|
|
|
- var thisTime = new DateTime();
|
|
|
- DateTime.TryParse(dto.InviteTime, out thisTime);
|
|
|
- bool res = await UpdateAsync(a => a.Id == grp_Invitation.Id, a => new Grp_InvitationOfficialActivities
|
|
|
- {
|
|
|
- DiId = dto.DiId,
|
|
|
- InviterArea = dto.InviterArea,
|
|
|
- Inviter = dto.Inviter,
|
|
|
- InviteTime = thisTime,
|
|
|
- Attachment = dto.Attachment,
|
|
|
- InviteCost = dto.InviteCost,
|
|
|
- InviteCurrency = dto.InviteCurrency,
|
|
|
- SendCost = dto.SendCost,
|
|
|
- SendCurrency = dto.SendCurrency,
|
|
|
- EventsCost = dto.EventsCost,
|
|
|
- EventsCurrency = dto.EventsCurrency,
|
|
|
- TranslateCost = dto.TranslateCost,
|
|
|
- TranslateCurrency = dto.TranslateCurrency,
|
|
|
- IsGoOfficaiaBussiness = dto.IsGoOfficaiaBussiness,
|
|
|
- Remark = dto.Remark,
|
|
|
- });
|
|
|
- if (res)
|
|
|
+ DiId = dto.DiId,
|
|
|
+ InviterArea = dto.InviterArea,
|
|
|
+ Inviter = dto.Inviter,
|
|
|
+ InviteTime = thisTime,
|
|
|
+ Attachment = dto.Attachment,
|
|
|
+ InviteCost = dto.InviteCost,
|
|
|
+ InviteCurrency = dto.InviteCurrency,
|
|
|
+ SendCost = dto.SendCost,
|
|
|
+ SendCurrency = dto.SendCurrency,
|
|
|
+ EventsCost = dto.EventsCost,
|
|
|
+ EventsCurrency = dto.EventsCurrency,
|
|
|
+ TranslateCost = dto.TranslateCost,
|
|
|
+ TranslateCurrency = dto.TranslateCurrency,
|
|
|
+ IsGoOfficaiaBussiness = dto.IsGoOfficaiaBussiness,
|
|
|
+ Remark = dto.Remark,
|
|
|
+ });
|
|
|
+ if (res)
|
|
|
+ {
|
|
|
+ Res_InvitationOfficialActivityData res_InvitationData = _mapper.Map<Res_InvitationOfficialActivityData>(dto);
|
|
|
+ res_InvitationData.Country = dto.InviterArea;
|
|
|
+ res_InvitationData.UnitName = dto.Inviter;
|
|
|
+ Res_InvitationOfficialActivityData ifNullUp = await _sqlSugar.Queryable<Res_InvitationOfficialActivityData>().FirstAsync
|
|
|
+ (a => a.Country == res_InvitationData.Country && a.City == res_InvitationData.City && a.UnitName == res_InvitationData.UnitName && a.IsDel == 0);
|
|
|
+ if (ifNullUp == null)///添加或修改商邀资料
|
|
|
{
|
|
|
- Res_InvitationOfficialActivityData res_InvitationData = _mapper.Map<Res_InvitationOfficialActivityData>(dto);
|
|
|
- res_InvitationData.Country = dto.InviterArea;
|
|
|
- res_InvitationData.UnitName = dto.Inviter;
|
|
|
- Res_InvitationOfficialActivityData ifNullUp = await _sqlSugar.Queryable<Res_InvitationOfficialActivityData>().FirstAsync
|
|
|
- (a => a.Country == res_InvitationData.Country && a.City == res_InvitationData.City && a.UnitName == res_InvitationData.UnitName && a.IsDel == 0);
|
|
|
- if (ifNullUp == null)///添加或修改商邀资料
|
|
|
- {
|
|
|
- res_InvitationData.Remark = dto.OtherInformation;
|
|
|
- res_InvitationData.Delegation = dto.DiId.ToString();
|
|
|
+ res_InvitationData.Remark = dto.OtherInformation;
|
|
|
+ res_InvitationData.Delegation = dto.DiId.ToString();
|
|
|
|
|
|
- int DataID = await _sqlSugar.Insertable(res_InvitationData).ExecuteReturnIdentityAsync();
|
|
|
- if (DataID != 0)
|
|
|
- {
|
|
|
- result = new Result() { Code = 0, Msg = "添加成功!" };
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- RollbackTran();
|
|
|
- result = new Result() { Code = -1, Msg = "添加失败!" };
|
|
|
- }
|
|
|
+ int DataID = await _sqlSugar.Insertable(res_InvitationData).ExecuteReturnIdentityAsync();
|
|
|
+ if (DataID != 0)
|
|
|
+ {
|
|
|
+ result = new Result() { Code = 0, Msg = "添加成功!" };
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- int CTable = await _sqlSugar.Updateable<Res_InvitationOfficialActivityData>()
|
|
|
- .Where(a => a.Id == ifNullUp.Id)
|
|
|
- .SetColumns(a => new Res_InvitationOfficialActivityData
|
|
|
- {
|
|
|
- Contact = dto.Contact,
|
|
|
- Tel = dto.Tel,
|
|
|
- Email = dto.Email,
|
|
|
- Fax = dto.Fax,
|
|
|
- Address = dto.Address,
|
|
|
- Remark = dto.OtherInformation,
|
|
|
- }).ExecuteCommandAsync();
|
|
|
+ RollbackTran();
|
|
|
+ result = new Result() { Code = -1, Msg = "添加失败!" };
|
|
|
}
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ int CTable = await _sqlSugar.Updateable<Res_InvitationOfficialActivityData>()
|
|
|
+ .Where(a => a.Id == ifNullUp.Id)
|
|
|
+ .SetColumns(a => new Res_InvitationOfficialActivityData
|
|
|
+ {
|
|
|
+ Contact = dto.Contact,
|
|
|
+ Tel = dto.Tel,
|
|
|
+ Email = dto.Email,
|
|
|
+ Fax = dto.Fax,
|
|
|
+ Address = dto.Address,
|
|
|
+ Remark = dto.OtherInformation,
|
|
|
+ })
|
|
|
+ .ExecuteCommandAsync();
|
|
|
+ }
|
|
|
|
|
|
- Grp_CreditCardPayment grp_CreditCardPayment = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == grp_Invitation.Id && a.CTable == 81 && a.IsDel == 0);
|
|
|
- if (grp_CreditCardPayment != null)
|
|
|
- {
|
|
|
- //if (dto.PayDId == 72) grp_CreditCardPayment.IsPay = 1;
|
|
|
- //else grp_CreditCardPayment.IsPay = 0;
|
|
|
- grp_CreditCardPayment.IsPay = 0;
|
|
|
-
|
|
|
- grp_CreditCardPayment.PayMoney = dto.PayMoney;
|
|
|
- grp_CreditCardPayment.PaymentCurrency = dto.PaymentCurrency;
|
|
|
- grp_CreditCardPayment.Payee = dto.Payee;
|
|
|
- grp_CreditCardPayment.OrbitalPrivateTransfer = dto.OrbitalPrivateTransfer;
|
|
|
+ Grp_CreditCardPayment grp_CreditCardPayment = _sqlSugar.Queryable<Grp_CreditCardPayment>().First(a => a.CId == grp_Invitation.Id && a.CTable == 81 && a.IsDel == 0);
|
|
|
+ if (grp_CreditCardPayment != null)
|
|
|
+ {
|
|
|
+ if (dto.PayDId == 72) grp_CreditCardPayment.IsPay = 1;
|
|
|
+ else grp_CreditCardPayment.IsPay = 0;
|
|
|
|
|
|
+ grp_CreditCardPayment.PayMoney = dto.PayMoney;
|
|
|
+ grp_CreditCardPayment.PaymentCurrency = dto.PaymentCurrency;
|
|
|
+ grp_CreditCardPayment.Payee = dto.Payee;
|
|
|
+ grp_CreditCardPayment.OrbitalPrivateTransfer = dto.OrbitalPrivateTransfer;
|
|
|
|
|
|
- //获取新汇率 int diId,int CId, int currencyId
|
|
|
- var rate = await fn(dto.DiId, 81, dto.InviteCurrency);
|
|
|
+ //获取新汇率 int diId,int CId, int currencyId
|
|
|
+ var rate = await fn(dto.DiId, 81, dto.InviteCurrency);
|
|
|
|
|
|
- grp_CreditCardPayment.DayRate = 1;
|
|
|
- grp_CreditCardPayment.RMBPrice = grp_CreditCardPayment.PayMoney;
|
|
|
- if (rate.Code == 0)
|
|
|
+ grp_CreditCardPayment.DayRate = 1;
|
|
|
+ grp_CreditCardPayment.RMBPrice = grp_CreditCardPayment.PayMoney;
|
|
|
+ if (rate.Code == 0)
|
|
|
+ {
|
|
|
+ var rateInfo = (rate.Data as CurrencyInfo);
|
|
|
+ if (rateInfo is not null)
|
|
|
{
|
|
|
- var rateInfo = (rate.Data as CurrencyInfo);
|
|
|
- if (rateInfo is not null)
|
|
|
- {
|
|
|
-
|
|
|
- grp_CreditCardPayment.DayRate = rateInfo.Rate;
|
|
|
- grp_CreditCardPayment.RMBPrice = rateInfo.Rate * grp_CreditCardPayment.PayMoney;
|
|
|
- }
|
|
|
+ grp_CreditCardPayment.DayRate = rateInfo.Rate;
|
|
|
+ grp_CreditCardPayment.RMBPrice = rateInfo.Rate * grp_CreditCardPayment.PayMoney;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- int CTable = await _sqlSugar.Updateable<Grp_CreditCardPayment>()
|
|
|
- .Where(a => a.Id == grp_CreditCardPayment.Id)
|
|
|
- .SetColumns(a => new Grp_CreditCardPayment
|
|
|
- {
|
|
|
- ConsumptionPatterns = dto.ConsumptionPatterns,
|
|
|
- ConsumptionDate = dto.ConsumptionDate,
|
|
|
- PayDId = dto.PayDId,
|
|
|
- IsPay = grp_CreditCardPayment.IsPay,
|
|
|
- CTDId = dto.CTDId,
|
|
|
- BankNo = dto.BankNo,
|
|
|
- CardholderName = dto.CardholderName,
|
|
|
- CompanyBankNo = dto.CompanyBankNo,
|
|
|
- OtherBankName = dto.OtherBankName,
|
|
|
- OtherSideNo = dto.OtherSideNo,
|
|
|
- OtherSideName = dto.OtherSideName,
|
|
|
- PayMoney = grp_CreditCardPayment.PayMoney,
|
|
|
- PaymentCurrency = grp_CreditCardPayment.PaymentCurrency,
|
|
|
- Payee = grp_CreditCardPayment.Payee,
|
|
|
- OrbitalPrivateTransfer = grp_CreditCardPayment.OrbitalPrivateTransfer,
|
|
|
- DayRate = grp_CreditCardPayment.DayRate,
|
|
|
- RMBPrice = grp_CreditCardPayment.RMBPrice,
|
|
|
- }).ExecuteCommandAsync();
|
|
|
- if (CTable != 0)
|
|
|
- {
|
|
|
- var data = new { ccpId = grp_CreditCardPayment.Id, sign = 2 };
|
|
|
- result = new Result() { Code = 0, Msg = "修改成功!", Data = data };
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- result = new Result() { Code = -1, Msg = "修改失败!" };
|
|
|
- RollbackTran();
|
|
|
- }
|
|
|
+ int CTable = await _sqlSugar.Updateable<Grp_CreditCardPayment>()
|
|
|
+ .Where(a => a.Id == grp_CreditCardPayment.Id)
|
|
|
+ .SetColumns(a => new Grp_CreditCardPayment
|
|
|
+ {
|
|
|
+ ConsumptionPatterns = dto.ConsumptionPatterns,
|
|
|
+ ConsumptionDate = dto.ConsumptionDate,
|
|
|
+ PayDId = dto.PayDId,
|
|
|
+ IsPay = grp_CreditCardPayment.IsPay,
|
|
|
+ CTDId = dto.CTDId,
|
|
|
+ BankNo = dto.BankNo,
|
|
|
+ CardholderName = dto.CardholderName,
|
|
|
+ CompanyBankNo = dto.CompanyBankNo,
|
|
|
+ OtherBankName = dto.OtherBankName,
|
|
|
+ OtherSideNo = dto.OtherSideNo,
|
|
|
+ OtherSideName = dto.OtherSideName,
|
|
|
+ PayMoney = grp_CreditCardPayment.PayMoney,
|
|
|
+ PaymentCurrency = grp_CreditCardPayment.PaymentCurrency,
|
|
|
+ Payee = grp_CreditCardPayment.Payee,
|
|
|
+ OrbitalPrivateTransfer = grp_CreditCardPayment.OrbitalPrivateTransfer,
|
|
|
+ DayRate = grp_CreditCardPayment.DayRate,
|
|
|
+ RMBPrice = grp_CreditCardPayment.RMBPrice,
|
|
|
+ }).ExecuteCommandAsync();
|
|
|
+ if (CTable != 0)
|
|
|
+ {
|
|
|
+ var data = new { ccpId = grp_CreditCardPayment.Id, sign = 2 };
|
|
|
+ result = new Result() { Code = 0, Msg = "修改成功!", Data = data };
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- RollbackTran();
|
|
|
result = new Result() { Code = -1, Msg = "修改失败!" };
|
|
|
+ RollbackTran();
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -542,13 +534,14 @@ Order By i.id Desc ", sqlWhere);
|
|
|
result = new Result() { Code = -1, Msg = "修改失败!" };
|
|
|
}
|
|
|
}
|
|
|
- CommitTran();
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
- result = new Result() { Code = -2, Msg = "程序错误!" };
|
|
|
- throw;
|
|
|
+ else
|
|
|
+ {
|
|
|
+ RollbackTran();
|
|
|
+ result = new Result() { Code = -1, Msg = "修改失败!" };
|
|
|
+ }
|
|
|
}
|
|
|
+ CommitTran();
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
}
|