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); }
public static webObject editFanFedCollection(FanFedCollection aFanFedCollection) { FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session); ServerSession.ClearSessionBusiness(HttpContext.Current.Session); webObject vWebObject = new webObject(); vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session); // ********** TEMPORARY REMEDY UNTIL I SORT OUT DATETIME ISSUE foreach (FanFed vCF in aFanFedCollection.FanFedList) { vCF.FanFedDateJoined = DateTime.Now; } try { FanServiceConsumer.SaveFanFed(vFanToken, aFanFedCollection); vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK; vWebObject.aTransactionStatus.Message = "FanFedCollection Edited"; ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus); vWebObject.AnObject = aFanFedCollection; } catch (TransactionStatusException tx) { vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus); return(vWebObject); } catch (Exception ex) { vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException; vWebObject.aTransactionStatus.Message = "Edit of FanFedCollection unsuccesful" + ex.Message; vWebObject.aTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message; return(vWebObject); } return(vWebObject); }
public static webObject loadFan(Fan aFan) { FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session); FanKey vFanKey = ServerSession.GetObject <FanKey>(HttpContext.Current.Session); aFan.FannKey = vFanKey.FannKey; aFan.FanUserID = vFanToken.FanID; aFan.FanPassword = vFanToken.Password; ServerSession.ClearSessionBusiness(HttpContext.Current.Session); ServerSession.PutObject <FanKey>(HttpContext.Current.Session, vFanKey); // Review this element of pattern webObject vWebObject = new webObject(); vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session); try { FanServiceConsumer.GetFan(vFanToken, aFan); vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK; vWebObject.aTransactionStatus.Message = "Fan Loaded"; ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus); vWebObject.AnObject = aFan; } catch (TransactionStatusException tx) { vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus); return(vWebObject); } catch (Exception ex) { vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException; vWebObject.aTransactionStatus.Message = "Load of Fan unsuccesful" + ex.Message; vWebObject.aTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message; return(vWebObject); } return(vWebObject); }