public ResponseAccountRegister AccountRegister(string identifier, string account_name, string account_type) { RequestAccountRegister a = new RequestAccountRegister(identifier, account_name, account_type); ResponseAccountRegister ra = ResponseAccountRegister.ResponseToAccountRegister(a);; return(ra); }
public static ResponseAccountRegister ResponseToAccountRegister(RequestAccountRegister accountToRegister) { Log.Debug("Se inició el metodo de la 'Capa de Integración'", new Exception("Bank2.ConnectionException.FaultyCore: Core services are down!")); ResponseAccountRegister responseAccount; try { switch (accountToRegister.Account_Type) { case "EMPRESARIAL": accountToRegister.Account_Type = AccountTypes.EMPRESARIAL.ToString(); break; case "AHORRO": accountToRegister.Account_Type = AccountTypes.AHORRO.ToString(); break; case "CORRIENTE": accountToRegister.Account_Type = AccountTypes.CORRIENTE.ToString(); break; default: accountToRegister.Account_Type = AccountTypes.OTRO.ToString(); break; } Entities.Integration.accountRegister(accountToRegister.Identifier, accountToRegister.Account_Name, accountToRegister.Account_Type); responseAccount = new ResponseAccountRegister(true, accountToRegister.Identifier); Log.Info("El 'ResponseAccountRegister' se ha ejecutado exitosamente."); } catch (Exception ex) { Log.Error("Ocurrió un error al procesar 'ResponseAccountRegister'.", ex); responseAccount = new ResponseAccountRegister(false, accountToRegister.Identifier); } finally { GC.Collect(); Entities.Integration.SaveChanges(); } return(responseAccount); }
public ResponseAccountRegister AccountRegister(RequestAccountRegister requestAccountRegister) { ResponseAccountRegister objAccountRegister = new ResponseAccountRegister(); string identifier, name, type; identifier = requestAccountRegister.Identifier; name = requestAccountRegister.Account_Name; type = requestAccountRegister.Account_Type; try { entities.accountRegister(identifier, name, type); objAccountRegister.Success = true; objAccountRegister.Message = "La cuenta fue registrada con exito!"; } catch { objAccountRegister.Success = false; objAccountRegister.Message = "Hubo un error en con el proceso de registro"; } return(objAccountRegister); }