//private MySQLDatabase _database = new MySQLDatabase("DefaultConnection"); // public MySQLDatabase _database = new MySQLDatabase("DefaultConnection"); public BE_User LoginValidation(string userName, string passwordHash, BE_LoginType loginType) { _database = new MySQLDatabase(connectionString); DA_User objDA_USer = new DA_User(_database); BE_User resultBe_User; switch (loginType) { case BE_LoginType.FacebookLogin: resultBe_User = null; break; case BE_LoginType.GoogleLogin: resultBe_User = null; break; default: resultBe_User = objDA_USer.loginValidation(userName, BE.Security.Encriptar(passwordHash)); break; } if (resultBe_User == null) { return(resultBe_User); } resultBe_User.Options = (new BL_Option(this.connectionString)).GetOptionMenuByUserName(userName); resultBe_User.OptionsMenu = resultBe_User.Options.FindAll(x => x.ismenu == 1); return(resultBe_User); }
public BE_Json LoginValidation(string userName, string passwordHash, int LoginType = 0) { //BL_Usuario _blUsuario = new BL_Usuario(); //_blUsuario.connectionString = AppConfig.DbConnection; //return _blUsuario.LoginValidation(userName, passwordHash); BE_Json objJson = null; var objListaAux = string.Empty; BE_LoginType bE_LoginType = (BE_LoginType)LoginType; try { BL_Usuario _blUsuario = new BL_Usuario(); _blUsuario.connectionString = AppConfig.DbConnection; objListaAux = JsonConvert.SerializeObject(_blUsuario.LoginValidation(userName, passwordHash, bE_LoginType)); objJson = new BE_Json(); objJson.data = objListaAux; objJson.status = CManager.RESULTADO_WCF.OK; } catch (Exception ex) { objJson = new BE_Json(); objJson.data = "Hubo en error en servidor:" + ex.Message + ";" + ex.StackTrace + ";" + ex.ToString(); objJson.status = CManager.RESULTADO_WCF.ERROR; objJson.status = CManager.RESULTADO_WCF.ERROR; } finally { objListaAux = null; } return(objJson); }