public static WorkflowBankAccount GetInstance(MemberBankAccount bankAccount, ServiceWorkflow functionWorkflow) { return(new WorkflowBankAccount { Account = bankAccount, Workflow = functionWorkflow, }); }
public Dictionary <string, Object> CashAdd(MemberBankAccount model) { try { Dictionary <string, Object> dic = new Dictionary <string, object>(); dic = CommonRequest.ApiCashAdd(model); return(dic); } catch (Exception e) { logger.Error("添加银行卡接口异常:" + e.Message); return(null); } }
public static void AddTransaction(BizPortalSessionContext context, int functionId, int pageId, string action, MemberBankAccount mbaTarget, ref string message, ref int warningCount) { string functionName = ""; string lange = context.CurrentLanguage.Code; using (ITransaction tx = context.PersistenceSession.BeginTransaction()) { try { if (mbaTarget.IsNotFinalized) { warningCount++; message = Messages.Genaral.TransactionApproved.Format(lange); } if (warningCount == 0) { MaintenanceWorkflow fw = GetFunctionMaintenanceWorkflow(context.User, functionId); functionName = Messages.MemberBankAccount.AddMemberBankAccount.Format(lange, mbaTarget.BankAccount.AccountName, mbaTarget.BankAccount.AccountNo); if (fw.MemberFunction == null) { warningCount++; message = Messages.Genaral.IsNotMemberFunction.Format(context.CurrentLanguage.Code); } else { BizPortalFunction function = fw.MemberFunction.Function; AddMemberBankAccountTransaction transactionMember = new AddMemberBankAccountTransaction(context, fw, DateTime.Now, context.Member, mbaTarget); transactionMember.Transit(context, fw, functionName, TransitionEventCode.SubmitEvent); transactionMember.Persist(context); tx.Commit(); message = String.Format("- {0} {1} {2} <br/>", functionName, Messages.Genaral.Success.Format(lange), Messages.Genaral.PendingApproval.Format(lange)); context.Log(functionId, pageId, 0, action, functionName); //edit by itsada use action gobal } } } catch (Exception e) { tx.Rollback(); warningCount++; message = string.Format("{0}", e.Message); context.Log(functionId, pageId, 0, action, functionName + message); //edit by itsada use action gobal } } }
public static void AddTransaction(BizPortalSessionContext context, int functionId, int pageId, MemberBankAccount mbaTarget, ref string message, ref int warningCount) { string functionName = ""; string accountNoTemp = mbaTarget.BankAccount.AccountNo; string lange = context.CurrentLanguage.Code; using (ITransaction tx = context.PersistenceSession.BeginTransaction()) { try { functionName = Messages.MemberBankAccount.AddMemberBankAccount.Format(lange, mbaTarget.BankAccount.AccountName, accountNoTemp); if (mbaTarget.IsNotFinalized) { warningCount++; message = Messages.Genaral.TransactionApproved.Format(lange); } if (warningCount == 0) { MaintenanceWorkflow fw = GetFunctionMaintenanceWorkflow(context.User, functionId); //functionName = Messages.MemberBankAccount.AddMemberBankAccount.Format(lange, mbaTarget.BankAccount.AccountName, accountNoTemp); if (fw.MemberFunction == null) { warningCount++; message = Messages.Genaral.IsNotMemberFunction.Format(context.CurrentLanguage.Code); } else { BizPortalFunction function = fw.MemberFunction.Function; if (mbaTarget.BankAccount.Bank.OfficialIDNo == "022") //022=CIMBT edit by kittikun { mbaTarget.BankAccount.AccountNo = "03" + accountNoTemp + "03"; } AddMemberBankAccountTransaction transactionMember = new AddMemberBankAccountTransaction(context, fw, DateTime.Now, context.Member, mbaTarget); transactionMember.Transit(context, fw, functionName, TransitionEventCode.SubmitEvent); transactionMember.Persist(context); tx.Commit(); message = String.Format("- {0} {1} {2} <br/>", functionName, Messages.Genaral.Success.Format(lange), Messages.Genaral.PendingApproval.Format(lange)); context.Log(functionId, pageId, 0, ActionLog.ClientAdminFunction.AddMemberBankAccount, functionName); } } } catch (Exception e) { tx.Rollback(); warningCount++; message = functionName + Messages.Genaral.TransactionException.Format(e.Message); context.Log(functionId, pageId, 0, ActionLog.ClientAdminFunction.AddMemberBankAccount, functionName + message); } } }