Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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);
        }
Beispiel #6
0
        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);
        }
Beispiel #7
0
        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);
        }
Beispiel #8
0
        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);
        }
Beispiel #9
0
        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);
        }