public static TransactionStatus fanLogon(Fan aFan) { ServerSession.ClearSessionBusiness(HttpContext.Current.Session); TransactionStatus vTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session); try { ServerSession.Logon(HttpContext.Current.Session, aFan); vTransactionStatus.TransactionResult = TransactionResult.OK; vTransactionStatus.Message = "Login succesful"; vTransactionStatus.TargetUrl = "/fandashboard.aspx"; ServerSession.SetTransactionStatus(HttpContext.Current.Session, vTransactionStatus); } catch (TransactionStatusException tx) { vTransactionStatus.AssignFromSource(tx.TransactionStatus); return(vTransactionStatus); } catch (Exception ex) { vTransactionStatus.TransactionResult = TransactionResult.GeneralException; vTransactionStatus.Message = "Login Unsuccesful - please check your username and password are correct" + ex.Message; vTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message; return(vTransactionStatus); } return(vTransactionStatus); }
protected void Page_Load(object sender, EventArgs e) { Fan vFan = new Fan(); vFan.FanUserID = "*****@*****.**"; vFan.FanPassword = "******"; ServerSession.Logon(HttpContext.Current.Session, vFan); FanKey vFanKey = new FanKey(); vFanKey.FannKey = vFan.FannKey; ServerSession.PutObject <FanKey>(HttpContext.Current.Session, vFanKey); }