/// <summary> /// 业务逻辑 /// </summary> protected override void ExecuteMethod() { var MerchantPwd = Encrpty.MD5Pwd(this.Parameter.MerchantPwd); var user = new UserAccount() { UserName = this.Parameter.ReapayMerchantNo, Email = this.Parameter.ReapayMerchantNo, UserPwd = MerchantPwd, RealName = this.Parameter.Contact, Phone = this.Parameter.Phone, Ip = "127.0.0.1", Status = 2, ReapalMerchantId = this.Parameter.ReapalMerchantId, CreateTime = DateTime.Now, UserType = 3, PartnerCode = "00", Vip = 0, IsOnVip = 0, TicketDelayEmail = this.Parameter.ReapayMerchantNo, MerchantCode = this.Parameter.MerchantCode, UserCompanyName = this.Parameter.MerchantName, IdNumber = "", BankCardNumber = "", LCCReceivesEmail = "", BillLateFee = 0, GraceCount = 0, OverdueCount = 0 }; userAccountRep.Insert(user); user.PayCenterCode = this.Parameter.MerchantCode + user.UserId.ToString(); var interfaceUser = interfaceAccountRep.GetInterfaceAccount(new InterfaceAccount() { MerchantCode = this.Parameter.MerchantCode }); updateMerchantProcessor.InitData(interfaceUser.ReapayMerchantNo, interfaceUser.MerchantCode, this.Parameter.ReapayMerchantNo, this.Parameter.ReapalMerchantId, this.Parameter.MerchantName, user.PayCenterCode); var result = updateMerchantProcessor.Execute(); if (!result.Success) { throw new Exception(result.Message); } user.Status = 0; int returnVal = userAccountRep.Update(user); if (returnVal <= 0) { throw new Exception("更新数据库失败"); } }
/// <summary> /// 业务逻辑 /// </summary> protected override void ExecuteMethod() { Random rd = new Random(); var MerchantCode = ChineseSpellHelp.GetChineseSpell(this.Parameter.MerchantName) + rd.Next(100, 999); var MerchantPwd = Encrpty.MD5Pwd(this.Parameter.MerchantPwd); registeredMerchantProcessor.InitData(this.Parameter.ReapayMerchantNo, this.Parameter.MerchantPwd, MerchantCode, this.Parameter.MerchantName, this.Parameter.Contact, "", "", this.Parameter.ReapayMerchantNo, this.Parameter.ReapalMerchantId, this.Parameter.Phone, "", this.Parameter.ReapayMerchantNo, this.Parameter.ReapalMerchantPwd.Trim()); var result = registeredMerchantProcessor.Execute(); if (!result.Success) { throw new Exception(result.Message); } InterfaceAccount _InterfaceAccount = new InterfaceAccount() { Contact = this.Parameter.Contact, CreateTime = DateTime.Now, CreateUserID = 0, MerchantCode = MerchantCode, MerchantName = this.Parameter.MerchantName, MerchantPwd = MerchantPwd, Phone = this.Parameter.Phone, ReapalMerchantId = this.Parameter.ReapalMerchantId, ReapayMerchantNo = this.Parameter.ReapayMerchantNo, Status = 0, UpdateTime = DateTime.Now, UserKey = Guid.NewGuid().ToString().Replace("-", ""), CertAddress = "", UpdateUserID = 0, IsCheckPrice = 0 }; interfaceAccountRep.Insert(_InterfaceAccount); //生成证书 var interfaceAccountmodel = ServiceCommon.GenerateUserCer(_InterfaceAccount); _InterfaceAccount.CertAddress = interfaceAccountmodel.CertAddress; _InterfaceAccount.CertPassword = interfaceAccountmodel.CertPassword; int i = interfaceAccountRep.Update(_InterfaceAccount); if (i <= 0) { throw new System.Exception("更新数据库失败"); } }