Example #1
0
        public static webObject editCellFanCollection(CellFanCollection aCellFanCollection)
        {
            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 (CellFan vCF in aCellFanCollection.CellFanList)
            {
                vCF.CellFanDateJoined = DateTime.Now;
            }

            try
            {
                FanServiceConsumer.SaveCellFan(vFanToken, aCellFanCollection);
                vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK;
                vWebObject.aTransactionStatus.Message           = "CellFanCollection Edited";
                ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus);
                vWebObject.AnObject = aCellFanCollection;
            }
            catch (TransactionStatusException tx)
            {
                vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus);
                return(vWebObject);
            }
            catch (Exception ex)
            {
                vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException;
                vWebObject.aTransactionStatus.Message           = "Edit of CellFanCollection unsuccesful" + ex.Message;
                vWebObject.aTransactionStatus.InnerMessage      = ex.InnerException == null ? String.Empty : ex.InnerException.Message;
                return(vWebObject);
            }
            return(vWebObject);
        }