public static webObject loadActivityCollection(Activity aActivity) { ActivityCollection vActivityCollection = new ActivityCollection(); vActivityCollection.ActivityFilter.ActFilter.AssignFromSource(aActivity); FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session); webObject vWebObject = new webObject(); vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session); try { FanServiceConsumer.GetActivityCollection(vFanToken, vActivityCollection); vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK; vWebObject.aTransactionStatus.Message = "ActivityCollection Loaded"; ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus); vWebObject.AnObject = vActivityCollection; } catch (TransactionStatusException tx) { vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus); return(vWebObject); } catch (Exception ex) { vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException; vWebObject.aTransactionStatus.Message = "Load of ActivityCollection unsuccesful" + ex.Message; vWebObject.aTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message; return(vWebObject); } return(vWebObject); }
public static webObject deleteActivity(Activity aActivity) { FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session); webObject vWebObject = new webObject(); vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session); try { FanServiceConsumer.DeleteActivity(vFanToken, aActivity); vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK; vWebObject.aTransactionStatus.Message = "Activity Deleted"; ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus); vWebObject.AnObject = aActivity; } catch (TransactionStatusException tx) { vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus); return(vWebObject); } catch (Exception ex) { vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException; vWebObject.aTransactionStatus.Message = "Deletion of Activity unsuccesful" + ex.Message; vWebObject.aTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message; return(vWebObject); } return(vWebObject); }
public static webObject editWorkout(Workout aWorkout) { FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session); webObject vWebObject = new webObject(); vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session); try { FanServiceConsumer.EditWorkout(vFanToken, aWorkout); vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK; vWebObject.aTransactionStatus.Message = "Workout Edited"; ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus); vWebObject.AnObject = aWorkout; } catch (TransactionStatusException tx) { vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus); return(vWebObject); } catch (Exception ex) { vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException; vWebObject.aTransactionStatus.Message = "Edit of Workout unsuccesful" + ex.Message; vWebObject.aTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message; return(vWebObject); } return(vWebObject); }
public static webObject editFan(Fan aFan) { FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session); FanKey vFanKey = ServerSession.GetObject <FanKey>(HttpContext.Current.Session); aFan.FannKey = vFanKey.FannKey; 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.EditFan(vFanToken, aFan); vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK; vWebObject.aTransactionStatus.Message = "Fan Edited"; 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 = "Edit of Fan unsuccesful" + ex.Message; vWebObject.aTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message; return(vWebObject); } return(vWebObject); }
public static webObject deleteCell(Cell aCell) { FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session); ServerSession.ClearSessionBusiness(HttpContext.Current.Session); webObject vWebObject = new webObject(); vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session); try { FanServiceConsumer.DeleteCell(vFanToken, aCell); vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK; vWebObject.aTransactionStatus.Message = "Cell Deleted"; ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus); vWebObject.AnObject = aCell; } catch (TransactionStatusException tx) { vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus); return vWebObject; } catch (Exception ex) { vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException; vWebObject.aTransactionStatus.Message = "Deletion of Cell unsuccesful" + ex.Message; vWebObject.aTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message; return vWebObject; } return vWebObject; }
public static webObject loadFanSessionCollection(FanSessionCollection aFanSessionCollection) { FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session); FanKey vFanKey = ServerSession.GetObject <FanKey>(HttpContext.Current.Session); aFanSessionCollection.FanSessionFilter.FssFilter.FanKey = vFanKey.FannKey; webObject vWebObject = new webObject(); vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session); try { FanServiceConsumer.GetFanSessionCollection(vFanToken, aFanSessionCollection); vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK; vWebObject.aTransactionStatus.Message = "FanSessionCollection Loaded"; ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus); vWebObject.AnObject = aFanSessionCollection; } catch (TransactionStatusException tx) { vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus); return(vWebObject); } catch (Exception ex) { vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException; vWebObject.aTransactionStatus.Message = "Load of FanSessionCollection unsuccesful" + ex.Message; vWebObject.aTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message; return(vWebObject); } return(vWebObject); }
public static webObject loadExercise(Exercise aExercise) { FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session); webObject vWebObject = new webObject(); vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session); try { FanServiceConsumer.GetExercise(vFanToken, aExercise); vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK; vWebObject.aTransactionStatus.Message = "Exercise Loaded"; ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus); vWebObject.AnObject = aExercise; } catch (TransactionStatusException tx) { vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus); return(vWebObject); } catch (Exception ex) { vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException; vWebObject.aTransactionStatus.Message = "Load of Exercise unsuccesful" + ex.Message; vWebObject.aTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message; return(vWebObject); } return(vWebObject); }
public static webObject addCell(Cell aCell) { FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session); ServerSession.ClearSessionBusiness(HttpContext.Current.Session); webObject vWebObject = new webObject(); vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session); try { FanServiceConsumer.AddCell(vFanToken, aCell); vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK; vWebObject.aTransactionStatus.Message = "Cell Added"; ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus); vWebObject.AnObject = aCell; } catch (TransactionStatusException tx) { vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus); return(vWebObject); } catch (Exception ex) { vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException; vWebObject.aTransactionStatus.Message = "Addition of Cell unsuccesful" + ex.Message; vWebObject.aTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message; return(vWebObject); } return(vWebObject); }
public static webObject editFriendCollection(FriendCollection aFriendCollection) { FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session); ServerSession.ClearSessionBusiness(HttpContext.Current.Session); webObject vWebObject = new webObject(); vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session); try { FanServiceConsumer.SaveFriend(vFanToken, aFriendCollection); vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK; vWebObject.aTransactionStatus.Message = "FriendCollection Edited"; ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus); vWebObject.AnObject = aFriendCollection; } catch (TransactionStatusException tx) { vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus); return(vWebObject); } catch (Exception ex) { vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException; vWebObject.aTransactionStatus.Message = "Edit of FriendCollection unsuccesful" + ex.Message; vWebObject.aTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message; return(vWebObject); } return(vWebObject); }
public static webObject addFanSession(FanSession aFanSession) { FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session); FanKey vFanKey = ServerSession.GetObject<FanKey>(HttpContext.Current.Session); webObject vWebObject = new webObject(); vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session); try { FanServiceConsumer.AddFanSession(vFanToken, aFanSession); vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK; vWebObject.aTransactionStatus.Message = "FanSession Added"; ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus); vWebObject.AnObject = aFanSession; } catch (TransactionStatusException tx) { vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus); return vWebObject; } catch (Exception ex) { vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException; vWebObject.aTransactionStatus.Message = "Addition of FanSession unsuccesful" + ex.Message; vWebObject.aTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message; return vWebObject; } return vWebObject; }
public static webObject editFan(Fan aFan) { FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session); FanKey vFanKey = ServerSession.GetObject<FanKey>(HttpContext.Current.Session); aFan.FannKey = vFanKey.FannKey; 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.EditFan(vFanToken, aFan); vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK; vWebObject.aTransactionStatus.Message = "Fan Edited"; 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 = "Edit of Fan unsuccesful" + ex.Message; vWebObject.aTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message; return vWebObject; } return vWebObject; }
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 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 loadWorkoutCollection(Workout aWorkout) { WorkoutCollection vWorkoutCollection = new WorkoutCollection(); vWorkoutCollection.WorkoutFilter.WrtFilter.AssignFromSource(aWorkout); FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session); webObject vWebObject = new webObject(); vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session); try { FanServiceConsumer.GetWorkoutCollection(vFanToken, vWorkoutCollection); vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK; vWebObject.aTransactionStatus.Message = "WorkoutCollection Loaded"; ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus); vWebObject.AnObject = vWorkoutCollection; } catch (TransactionStatusException tx) { vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus); return vWebObject; } catch (Exception ex) { vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException; vWebObject.aTransactionStatus.Message = "Load of WorkoutCollection unsuccesful" + ex.Message; vWebObject.aTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message; return vWebObject; } return vWebObject; }
public static webObject loadExercise(Exercise aExercise) { FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session); webObject vWebObject = new webObject(); vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session); try { FanServiceConsumer.GetExercise(vFanToken, aExercise); vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK; vWebObject.aTransactionStatus.Message = "Exercise Loaded"; ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus); vWebObject.AnObject = aExercise; } catch (TransactionStatusException tx) { vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus); return vWebObject; } catch (Exception ex) { vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException; vWebObject.aTransactionStatus.Message = "Load of Exercise unsuccesful" + ex.Message; vWebObject.aTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message; return vWebObject; } return vWebObject; }
public static webObject editWorkout(Workout aWorkout) { FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session); webObject vWebObject = new webObject(); vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session); try { FanServiceConsumer.EditWorkout(vFanToken, aWorkout); vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK; vWebObject.aTransactionStatus.Message = "Workout Edited"; ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus); vWebObject.AnObject = aWorkout; } catch (TransactionStatusException tx) { vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus); return vWebObject; } catch (Exception ex) { vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException; vWebObject.aTransactionStatus.Message = "Edit of Workout unsuccesful" + ex.Message; vWebObject.aTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message; return vWebObject; } return vWebObject; }
public static webObject loadFriendCollection(FriendCollection aFriendCollection) { FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session); ServerSession.ClearSessionBusiness(HttpContext.Current.Session); webObject vWebObject = new webObject(); vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session); try { FanServiceConsumer.GetFriendCollection(vFanToken, aFriendCollection); vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK; vWebObject.aTransactionStatus.Message = "FriendCollection Loaded"; ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus); vWebObject.AnObject = aFriendCollection; } catch (TransactionStatusException tx) { vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus); return vWebObject; } catch (Exception ex) { vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException; vWebObject.aTransactionStatus.Message = "Load of FriendCollection unsuccesful" + ex.Message; vWebObject.aTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message; return vWebObject; } return vWebObject; }