public void GetUserInfoByUserIdTest(LoginApp app) { var response = app.GetUserInfoByUserId("yangyang"); Console.WriteLine(JsonHelper.Instance.Serialize(response)); }
public static void accountApp(int id) { if (id == 1) { Console.WriteLine("AccountApp - TEST - START"); //LoginApp.doLogin("yodlee_10000004", "yodlee123", "ysluser2", "TEST@123"); Accounts accounts = AccountApp.getAccounts(); Console.WriteLine("------------------------"); Console.WriteLine("Account Id Account Name"); Console.WriteLine("------------------------"); Console.WriteLine(accounts.ToString()); Console.WriteLine("------------------------"); } else { Console.WriteLine("AccountApp - TEST - START"); //LoginApp.doLogin("yodlee_10000004", "yodlee123", "ysluser2", "TEST@123"); Accounts accounts = AccountApp.getAccountsWithOptions(); Console.WriteLine("------------------------"); Console.WriteLine("AccountId PlanName ProviderName CusipNumber Description HoldingType Price"); Console.WriteLine("------------------------"); Console.WriteLine(accounts.ToString()); Console.WriteLine("------------------------"); } LoginApp.readValue(); }
public static void AddAccount(int type) { Providers providers = null; RefreshStatus refreshStatus = null; Console.WriteLine("Add Provider Account App - TEST - START"); Console.WriteLine("Enter the name of the Provider you want to search : "); String searchString = Console.ReadLine(); //String searchString = "Dag"; ProviderApp.searchProvider(searchString); if (type == 2) { Console.WriteLine("Enter the Provider Id : "); String providerId = Console.ReadLine(); //String providerId = "16442"; providers = ProviderApp.getProviderLoginForm(providerId); addMFA_Account(providers); } if (type == 1) { Console.WriteLine("Enter the Provider Id : "); String providerId = Console.ReadLine(); //String providerId = "16441"; providers = ProviderApp.getProviderLoginForm(providerId); addNonMFA_Account(providers); } //Console.ReadLine(); LoginApp.readValue(); }
public void Handle(ISession session) { LoginApp loginApp = AppManager.GetAppOfType <LoginApp>() as LoginApp; if (loginApp == null) { return; } Application.Current.Dispatcher.Invoke(() => loginApp.view.RegisterResponse(StatusCode)); }
//------------------------------------------------------------------------- // 响应登陆请求 public void client2LoginLogin(RpcSession s, Dictionary <byte, object> map_param) { EbLog.Note("LoginUCenterSession.client2LoginLogin()"); string account = (string)map_param[0]; string password = (string)map_param[1]; string serverGroup = (string)map_param[2]; string channel = (string)map_param[3]; LoginApp <ComponentDef> login = EntityMgr.findFirstEntity("EtApp").getComponent <LoginApp <ComponentDef> >(); login.addLoginPlayer(serverGroup, account, password, channel, this); }
public static void assetSummaryApp() { Console.WriteLine("AssetSummary - TEST - START"); //LoginApp.doLogin("yodlee_10000004", "yodlee123", "ysluser2", "TEST@123"); Console.WriteLine("------------------------"); Console.WriteLine("ClassificationType ClassificationValue Contribution Value HoldingId AccountId Value Cash"); Console.WriteLine("------------------------"); AssetSummaries assetSummaries = AssetSummaryApp.AssetSummaries; Console.WriteLine(assetSummaries.ToString()); LoginApp.readValue(); }
public static void transactionApp() { Console.WriteLine("TransactionApp - TEST - START"); //LoginApp.doLogin("yodlee_10000004", "yodlee123", "sprint13last30days", "TEST@123"); Transactions transactions = TransactionApp.Transactions; Console.WriteLine("-------------------------------"); Console.WriteLine("TransactionId Amount BaseType"); Console.WriteLine("-------------------------------"); Console.WriteLine(transactions.ToString()); Console.WriteLine("-------------------------------"); LoginApp.readValue(); //Console.ReadLine(); }
public static void siteApp() { Console.WriteLine("SiteAPP - TEST - START"); //LoginApp.doLogin("yodlee_10000004", "yodlee123", "ysluser2", "TEST@123"); Console.WriteLine("Enter the site you want to search : "); string searchString = Console.ReadLine(); searchSite(searchString); Console.WriteLine("Enter the site Id : "); string site = Console.ReadLine(); getSiteLoginForm(site); LoginApp.readValue(); }
public static void billsApp() { Console.WriteLine("BillsApp - TEST - START"); //LoginApp.doLogin("yodlee_10000004", "yodlee123", "ysluser2", "TEST@123"); Bills bills = BillsApp.Bills; Console.WriteLine("------------------"); Console.WriteLine("Bill Id Due Amount"); Console.WriteLine("------------------"); Console.WriteLine(bills.ToString()); Console.WriteLine("------------------"); LoginApp.readValue(); }
public static string localURLVer1 = ConfigurationManager.AppSettings["url"];//"http://*****:*****@" // 1-Register // 2-LogIn // "); // string choice; // choice = Console.ReadLine(); // int choiceValue; // int.TryParse(choice, out choiceValue); // switch(choiceValue) memberSuccess = LoginApp.doMemberLogin(); } while (!auth && ++count < MAX_LOGINS); while (memberSuccess == 0) { memberSuccess = LoginApp.doMemberLogin(); } if (memberSuccess == 1) { List <string> headers = new List <string>(); string usersessionid = LoginApp.usession; string cbrandsessionid = LoginApp.cbsession; headers.Add("Authorization:{userSession= " + usersessionid + ",cobSession=" + cbrandsessionid + "}"); cred.CoBrandauth = usersessionid; cred.Memberauth = cbrandsessionid; } //cred.auth= doLogin("sbCobd711dae4ac2ebf69822f2e9f34d71738ba", "ff17cb34-c563-4b33-8042-251683b3a06b", "sbMemd711dae4ac2ebf69822f2e9f34d71738ba3", "sbMemd711dae4ac2ebf69822f2e9f34d71738ba3#123"); return(View(cred)); }
public void Handle(ISession session) { LoginApp loginApp = AppManager.GetAppOfType <LoginApp>() as LoginApp; if (loginApp == null) { return; } if (StatusCode == 200) { (session as ClientSession).LoggedIn(Token); } Application.Current.Dispatcher.Invoke(() => loginApp.view.LoginResponse(StatusCode)); ChatConnection.Instance.OnResponse(StatusCode); }
public LoginParse(AppInfoService infoService, ICacheContext cacheContext, IOptions <AppSetting> options, IHttpContextAccessor httpContextAccessor, LoginApp app, IRepository <UserRole> userRoleApp, CommonUtilDbApp commonApp, IRepository <Company> companyApp, ParameterSettingApp parameterSettingApp, IRepository <UserInfo> userInfo) { _appInfoService = infoService; _cacheContext = cacheContext; _appUserRole = userRoleApp; _options = options; _httpContextAccessor = httpContextAccessor; _loginApp = app; _commonApp = commonApp; _companyApp = companyApp; _parameterSettingApp = parameterSettingApp; _userInfoApp = userInfo; }
public void Test() { var login = new LoginApp(new UserRepository(), new ModuleRepository(), new RelevanceRepository(), new BaseRepository <ModuleElement>(), new ResourceRepository(), new OrgRepository() ); var user = login.Login("admin", "admin"); foreach (var module in user.Modules) { Console.WriteLine(module.Id + "\t" + module.Name); } }
public ActionResult CheckLogin(string username, string password, string code) { LoginContent result = new LoginContent() { IsSmsLogin = "******", Msg = "用户名密码错误", Success = false, MoPhone = "", LoginType = (int)LoginTypeEnum.ManageMember }; try { if (string.IsNullOrEmpty(username)) { result.Msg = "用户名不能为空"; return(Content(result.ToJson())); } if (string.IsNullOrEmpty(password)) { result.Msg = "请输入密码"; return(Content(result.ToJson())); } if (Session["nfine_session_verifycode"].IsEmpty() || Md5.md5(code.ToLower(), 16) != Session["nfine_session_verifycode"].ToString()) { result.Msg = "验证码错误,请重新输入"; return(Content(result.ToJson())); } using (var bll = new LoginApp()) { result = bll.CheckLogin(username, password); } if (!result.Success) { result.Msg = "用户名密码错误"; } return(Content(result.ToJson())); } catch (Exception ex) { result.Msg = ex.Message; result.Success = false; return(Content(result.ToJson())); } }
public App() { InitializeComponent(); Store = AccountStore.Create(); var account = Store.FindAccountsForService(Constants.AppName).FirstOrDefault(); //Handle Connectivity if (account == null || !Application.Current.Properties.ContainsKey("ExpiryDate")) { MainPage = new LoginApp(); } else { MainPage = new NavigationPage(new MainPage()); } }
//------------------------------------------------------------------------- public override void init() { mCoApp = (LoginApp <ComponentDef>)Entity.getCacheData("parent"); string projName = (string)Entity.getCacheData("ProjectName"); mServerGroupName = (string)Entity.getCacheData("ServerGroupName"); string preStr = "/" + projName + "/" + _eConstLoginNode.LoginServices.ToString() + "/" + mServerGroupName + "/"; LoginQueue = preStr + _eConstLoginNode.LoginQueue.ToString() + "/"; LoginCompleteQueue = preStr + _eConstLoginNode.LoginCompleteQueue.ToString() + "/"; LoginQueueLock = preStr + _eConstLoginNode.LoginQueueLock.ToString() + "/"; LoginCompleteQueueLock = preStr + _eConstLoginNode.LoginCompleteQueueLock.ToString() + "/"; LoginOfflineQueue = preStr + _eConstLoginNode.PlayerOfflineNode.ToString() + "/"; LoginOfflineQueueLock = preStr + _eConstLoginNode.PlayerOfflineLock.ToString() + "/"; mCoApp.mServerGroup.Add(mServerGroupName, this as LoginNode <ComponentDef>); }
public static void Main(string[] args) { Console.WriteLine("ProviderApp - TEST - START"); LoginApp.doLogin("yodlee_10000004", "yodlee123", "allcases", "TEST@123"); //Console con = new Console(); //if (con != null) { Console.WriteLine("Enter the site you want to search : "); String searchString = Console.ReadLine(); //String searchString = con //.readLine("Enter the site you want to search : "); searchProvider(searchString); //} //if (con != null) { Console.WriteLine("Enter the site Id : "); String site = Console.ReadLine(); getProviderLoginForm(site); //} }
public JsonResult Login(string chainNo, string account, string password) { var user = new LoginApp().Login(account, password); if (user == null || string.IsNullOrWhiteSpace(user.Account)) { return(Json(base.ErrResult("用户名或密码错误"))); } if (!new RepMenuApp().IsHaveMenuResponse(account)) { return(Json(base.ErrResult("无权限"))); } string timeStamp = DataTrans.GetTimeStamp(); WriteSession(user, timeStamp); SysLog(user.Account, timeStamp); WebHelper.UserToApplication(user.Account); return(SuccessReturn()); }
public static void holdingApp(int id) { Console.WriteLine("HoldingApp - TEST - START"); if (id == 1) { //LoginApp.doLogin("yodlee_10000004", "yodlee123", "ysluser2", "TEST@123"); Console.WriteLine("------------------------"); Console.WriteLine("HoldingId AccountId Description HoldingType Price"); Console.WriteLine("------------------------"); Holdings holdings = HoldingApp.Holdings; Console.WriteLine(holdings.ToString()); } else { //LoginApp.doLogin("yodlee_10000004", "yodlee123", "ysluser2", "TEST@123"); Console.WriteLine("------------------------"); Console.WriteLine("HoldingId AccountId Description HoldingType Value ClassificationType ClassificationValue allocation"); Console.WriteLine("------------------------"); Holdings holdings = HoldingApp.HoldingsWithAsset; Console.WriteLine(holdings.ToString()); } LoginApp.readValue(); }
public static void addSiteAccount() { Provider provider = new Provider(); Console.WriteLine("AddSiteAccountAPP - TEST - START"); //LoginApp.doLogin("yodlee_10000004", "yodlee123", "ysluser2", "TEST@123"); //LoginApp.doLogin("private-sandboxtwo", "Yodlee@123", "logademo1", "yodlee@123"); Console.WriteLine("Enter the site you want to search : "); string searchString = Console.ReadLine(); SiteApp.searchSite(searchString); Console.WriteLine("Enter the site Id : "); string site = Console.ReadLine(); provider = SiteApp.getSiteLoginForm(site); provider.getProvider()[0].LoginForm.Row[0].Field[0].Value = "DBmet1.site16441.1"; provider.getProvider()[0].LoginForm.Row[1].Field[0].Value = "site16441.1"; AddSiteAccount.addSiteAccount(provider); siteaccountId siteaccount = JsonConvert.DeserializeObject <siteaccountId>(jsonresp); Console.WriteLine(AddSiteAccount.getRefreshStatus(siteaccount.siteAccountId)); LoginApp.readValue(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) //if (true) { if (Page.Request.HttpMethod == "POST") //if (true) { SolicitudLogin solicitudLogin = null; string Valor = ""; //Leer JSON try { using (var streamReader = new System.IO.StreamReader(Request.GetBufferedInputStream())) { Valor = streamReader.ReadToEnd(); } System.Web.Script.Serialization.JavaScriptSerializer jsonSerializer = new System.Web.Script.Serialization.JavaScriptSerializer(); solicitudLogin = jsonSerializer.Deserialize <SolicitudLogin>(Valor); } catch (Exception) { Valor = ""; } //if (true) if (Valor != "") { LoginApp loginApp = new LoginApp(); AppDatos appDatos = new AppDatos(); loginApp.conexion = ConfigurationManager.ConnectionStrings["Conexion_App"].ConnectionString; loginApp.usuario = solicitudLogin.usuario; loginApp.password = solicitudLogin.password; try { appDatos.login(loginApp); } catch (Exception ex) { loginApp.resultado = ex.Message; loginApp.DatosJson = "No se encontró."; } Response.Clear(); Response.ContentType = "application/text;"; if (loginApp.resultado == "REGOK") { Response.Write(loginApp.DatosJson); } else { Response.Write("Error " + loginApp.resultado); } Response.End(); } else { Response.Clear(); Response.ContentType = "application/text;"; Response.Write("Error ID:000: Valores Incorrectos"); Response.End(); } } else { Response.Clear(); Response.ContentType = "application/text;"; Response.Write("Error ID:002 Tipo Incorrecto"); Response.End(); } } }
public LoginController() { _app = AutofacExt.GetFromFac <LoginApp>(); }
// ------------------- [ FUNCIONES GENERALES ] ------------------- // FUNCION QUE PERMITE LOGIN A LA APP public string IniciarSesionApp(LoginApp Login) { LoginAppRespuesta respuesta = new LoginAppRespuesta() { IdUsuario = 0, Respuesta = false, RespuestaText = "errLogin", }; try { SQL.comandoSQLTrans("Login"); SQL.commandoSQL = new SqlCommand("SELECT U.*, C.tokencentro, C.idnotificacion AS CentroNotifId FROM dbo.usuarios U JOIN dbo.centros C ON C.clave = @ClaveCentroDATA AND C.tokencentro = U.tokencentro WHERE U.usuario = @UsuarioDATA AND U.pass = @PassDATA AND U.activo > 0", SQL.conSQL, SQL.transaccionSQL); SqlParameter[] AppUsuarioLoginPars = { new SqlParameter("@UsuarioDATA", SqlDbType.VarChar) { Value = Login.Usuario }, new SqlParameter("@PassDATA", SqlDbType.VarChar) { Value = MISC.CrearMD5(Login.Password) }, new SqlParameter("@ClaveCentroDATA", SqlDbType.VarChar) { Value = Login.CentroClave }, }; SQL.commandoSQL.Parameters.AddRange(AppUsuarioLoginPars); using (var lector = SQL.commandoSQL.ExecuteReader()) { while (lector.Read()) { respuesta.IdUsuario = int.Parse(lector["id"].ToString()); respuesta.Respuesta = true; respuesta.TokenUsuario = lector["tokenusuario"].ToString(); respuesta.TokenCentro = lector["tokencentro"].ToString(); respuesta.UsuarioNombre = lector["nombre"].ToString() + " " + lector["apellido"].ToString(); respuesta.Administrador = bool.Parse(lector["administrador"].ToString()); respuesta.RespuestaText = "LoginCorrecto"; } } if (respuesta.IdUsuario > 0) { if (respuesta.Administrador) { respuesta.AlAnon = true; respuesta.CoordDeportiva = true; respuesta.CoordMedica = true; respuesta.CoordPsicologica = true; respuesta.CoordEspiritual = true; respuesta.Cord12Pasos = true; respuesta.Documentacion = true; } else { SQL.commandoSQL = new SqlCommand("SELECT * FROM dbo.usuariosperfiles WHERE idusuario = @IDUsuarioParam AND idcentro = (SELECT id FROM dbo.centros WHERE tokencentro = @TokenCentroDATA)", SQL.conSQL, SQL.transaccionSQL); SqlParameter[] UsuarioLoginPerfilPars = { new SqlParameter("@IDUsuarioParam", SqlDbType.Int) { Value = respuesta.IdUsuario }, new SqlParameter("@TokenCentroDATA", SqlDbType.VarChar) { Value = respuesta.TokenCentro }, }; SQL.commandoSQL.Parameters.AddRange(UsuarioLoginPerfilPars); using (var lector = SQL.commandoSQL.ExecuteReader()) { while (lector.Read()) { respuesta.AlAnon = bool.Parse(lector["alanon"].ToString()); respuesta.CoordDeportiva = bool.Parse(lector["coorddeportiva"].ToString()); respuesta.CoordMedica = bool.Parse(lector["coordmedica"].ToString()); respuesta.CoordPsicologica = bool.Parse(lector["coordpsicologica"].ToString()); respuesta.CoordEspiritual = bool.Parse(lector["coordespiritual"].ToString()); respuesta.Cord12Pasos = bool.Parse(lector["coorddocepasos"].ToString()); respuesta.Documentacion = bool.Parse(lector["documentacion"].ToString()); } } } } SQL.transaccionSQL.Commit(); return(JsonConvert.SerializeObject(respuesta)); } catch (Exception e) { SQL.transaccionSQL.Rollback(); respuesta.RespuestaText = e.ToString(); return(JsonConvert.SerializeObject(respuesta)); } finally { SQL.conSQL.Close(); } }
public UCenterZkWatcher(IComponent co_app) { mCoApp = co_app as LoginApp <ComponentDef>; }
public static void ApplicationStart(string connectionString, LoginApp loginApp) { DarkSQLManager.ConnectionString = connectionString; LoginApp = loginApp; }
public void login(LoginApp login) { try { object[] Valores = { login.usuario, login.password }; DataSet ds = SqlHelper.ExecuteDataset(login.conexion, "spCIDBD_get_Login", Valores); login.resultado = "No se encontraron resultados"; if (ds != null) { if (ds.Tables[0] != null) { if (ds.Tables[0].Rows.Count > 0) { switch (Convert.ToInt32(ds.Tables[0].Rows[0]["resultado"])) { case 1: { login.resultado = "REGOK"; login.result = Convert.ToInt32(ds.Tables[0].Rows[0]["resultado"]); login.IDUsuario = Convert.ToInt64(ds.Tables[0].Rows[0]["id"]); login.IDCOR = Convert.ToInt64(ds.Tables[0].Rows[0]["id_cor"]); login.token = ds.Tables[0].Rows[0]["token"].ToString(); login.Rol = Convert.ToInt64(ds.Tables[0].Rows[0]["rol"]); login.GenerarJSON(); } break; case 2: { login.resultado = "REGOK"; login.result = Convert.ToInt32(ds.Tables[0].Rows[0]["resultado"]); login.IDUsuario = Convert.ToInt64(ds.Tables[0].Rows[0]["id"]); login.IDCOR = Convert.ToInt64(ds.Tables[0].Rows[0]["id_cor"]); login.token = ds.Tables[0].Rows[0]["token"].ToString(); login.Rol = Convert.ToInt64(ds.Tables[0].Rows[0]["rol"]); login.GenerarJSON(); } break; case 3: { login.resultado = "REGOK"; login.result = Convert.ToInt32(ds.Tables[0].Rows[0]["resultado"]); login.IDUsuario = Convert.ToInt64(ds.Tables[0].Rows[0]["id"]); login.IDCOR = Convert.ToInt64(ds.Tables[0].Rows[0]["id_cor"]); login.token = ds.Tables[0].Rows[0]["token"].ToString(); login.Rol = Convert.ToInt64(ds.Tables[0].Rows[0]["rol"]); login.GenerarJSON(); } break; case 4: { login.resultado = "Usuario no encontrado, registrese por favor"; } break; case 5: { login.resultado = "Usuario o contraseña incorrecta"; } break; case 6: { login.resultado = "Usuario no encontrado, registrese por favor"; } break; } } } } } catch (Exception ex) { throw ex; } }