public void SubmitForm(AccountEntity accountEntity, string keyValue) { if (!string.IsNullOrEmpty(keyValue)) { accountEntity.Modify(keyValue); service.Update(accountEntity); } else { accountEntity.Create(); service.Insert(accountEntity); } }
public async Task SaveForm(AccountEntity entity) { if (entity.Id.IsNullOrZero()) { await entity.Create(); await this.BaseRepository().Insert(entity); } else { await entity.Modify(); await this.BaseRepository().Update(entity); } }
public void SubmitForm(AccountEntity entity, string keyValue) { if (string.IsNullOrEmpty(keyValue)) { var pwd = entity.accountCard.Substring(entity.accountCard.Length - 6, 6); entity.accountPwd = DESEncrypt.Encrypt(Md5.md5(pwd, 32)).ToUpper(); entity.Create(); accountRepository.Insert(entity); } else { entity.Modify(keyValue); accountRepository.Update(entity); } }