示例#1
0
        public static webObject editFanSessionActivityCollection(FanSessionActivityCollection aFanSessionActivityCollection)
        {
            FanToken  vFanToken  = ServerSession.GetFanToken(HttpContext.Current.Session);
            webObject vWebObject = new webObject();

            vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session);

            try
            {
                FanServiceConsumer.SaveFanSessionActivity(vFanToken, aFanSessionActivityCollection);
                vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK;
                vWebObject.aTransactionStatus.Message           = "FanSessionActivityCollection Edited";
                ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus);
                vWebObject.AnObject = aFanSessionActivityCollection;
            }
            catch (TransactionStatusException tx)
            {
                vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus);
                return(vWebObject);
            }
            catch (Exception ex)
            {
                vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException;
                vWebObject.aTransactionStatus.Message           = "Edit of FanSessionActivityCollection unsuccesful" + ex.Message;
                vWebObject.aTransactionStatus.InnerMessage      = ex.InnerException == null ? String.Empty : ex.InnerException.Message;
                return(vWebObject);
            }
            return(vWebObject);
        }
示例#2
0
 /// <summary>
 ///   The overloaded Load method that will fill the <c>FanSessionActivityList</c> property a <see cref="FanSessionActivityCollection"/> object as an
 ///   ordered <c>List</c> of <see cref="FanSessionActivity"/>, filtered by the filter properties of the passed <see cref="FanSessionActivityCollection"/>.
 /// </summary>
 /// <param name="aFanSessionActivityCollection">The <see cref="FanSessionActivityCollection"/> object that must be filled.</param>
 /// <remarks>
 ///   The filter properties of the <see cref="FanSessionActivityCollection"/> must be correctly completed by the calling application.
 /// </remarks>
 /// <exception cref="ArgumentNullException">If <c>aFanSessionActivityCollection</c> argument is <c>null</c>.</exception>
 public static void Load(FanSessionActivityCollection aFanSessionActivityCollection)
 {
     if (aFanSessionActivityCollection == null)
     {
         throw new ArgumentNullException("aFanSessionActivityCollection");
     }
     using (var vSqlCommand = new SqlCommand()
     {
         CommandType = CommandType.Text,
         Connection = new SqlConnection(Connection.Instance.SqlConnectionString)
     })
     {
         var vStringBuilder = BuildSQL();
         if (aFanSessionActivityCollection.IsFiltered)
         {
             if (aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.WrtKey > 0)
             {
                 vStringBuilder.AppendLine("and t2.WRT_Key = @WRTKey");
                 vSqlCommand.Parameters.AddWithValue("@WRTKey", aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.WrtKey);
             }
             if (aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.FanKey > 0)
             {
                 vStringBuilder.AppendLine("and t2.FAN_Key = @FANKey");
                 vSqlCommand.Parameters.AddWithValue("@FANKey", aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.FanKey);
             }
             if (aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.FssKey > 0)
             {
                 vStringBuilder.AppendLine("and t2.FSS_Key = @FSSKey");
                 vSqlCommand.Parameters.AddWithValue("@FSSKey", aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.FssKey);
             }
             if (aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.ActKey > 0)
             {
                 vStringBuilder.AppendLine("and t1.ACT_Key = @ACTKey");
                 vSqlCommand.Parameters.AddWithValue("@ACTKey", aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.ActKey);
             }
             if (aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.ExcKey > 0)
             {
                 vStringBuilder.AppendLine("and t1.EXC_Key = @EXCKey");
                 vSqlCommand.Parameters.AddWithValue("@EXCKey", aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.ExcKey);
             }
         }
         vStringBuilder.AppendLine("order by t2.FSS_Key");
         vSqlCommand.CommandText = vStringBuilder.ToString();
         vSqlCommand.Connection.Open();
         using (SqlDataReader vSqlDataReader = vSqlCommand.ExecuteReader())
         {
             while (vSqlDataReader.Read())
             {
                 var vFanSessionActivity = new FanSessionActivity();
                 DataToObject(vFanSessionActivity, vSqlDataReader, false);
                 aFanSessionActivityCollection.FanSessionActivityList.Add(vFanSessionActivity);
             }
             vSqlDataReader.Close();
         }
         vSqlCommand.Connection.Close();
     }
 }
示例#3
0
        /// <summary>
        /// Save a <see cref="FanSessionActivity" /> list passed as an argument.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey" /> object.</param>
        /// <param name="aFanSessionActivityCollection">A cell fan collection.</param>
        /// <exception cref="Zephry.ZpAccessException">Access Denied; FanSessionActivity</exception>
        /// <exception cref="ArgumentNullException">If <c>aFanSessionActivity</c> argument is <c>null</c>.</exception>
        public static void Save(FanKey aFanKey, FanSessionActivityCollection aFanSessionActivityCollection)
        {
            if (aFanSessionActivityCollection == null)
            {
                throw new ArgumentNullException("Update FanSessionActivityCollection Business");
            }

            //if (!FanFunctionAccessData.HasModeAccess(aFanKey, "FanSessionActivity", AccessMode.Update))
            //{
            //    throw new ZpAccessException("Access Denied", String.Format("{0}", aFanKey.FannKey), AccessMode.Update, "FanSessionActivity");
            //}

            FanSessionActivityData.Save(aFanSessionActivityCollection);
        }
        /// <summary>
        /// Save a <see cref="FanSessionActivity" /> list passed as an argument.
        /// </summary>
        /// <param name="aFanKey">A <see cref="FanKey" /> object.</param>
        /// <param name="aFanSessionActivityCollection">A cell fan collection.</param>
        /// <exception cref="Zephry.ZpAccessException">Access Denied; FanSessionActivity</exception>
        /// <exception cref="ArgumentNullException">If <c>aFanSessionActivity</c> argument is <c>null</c>.</exception>
        public static void Save(FanKey aFanKey, FanSessionActivityCollection aFanSessionActivityCollection)
        {
            if (aFanSessionActivityCollection == null)
            {
                throw new ArgumentNullException("Update FanSessionActivityCollection Business");
            }

            //if (!FanFunctionAccessData.HasModeAccess(aFanKey, "FanSessionActivity", AccessMode.Update))
            //{
            //    throw new ZpAccessException("Access Denied", String.Format("{0}", aFanKey.FannKey), AccessMode.Update, "FanSessionActivity");
            //}

            FanSessionActivityData.Save(aFanSessionActivityCollection);
        }
示例#5
0
 /// <summary>
 ///   Insert a <see cref="FanSessionActivity"/> passed as an argument via Stored Procedure that returns the newly inserted FanSessionActivity Key
 /// </summary>
 /// <param name="aFanSessionActivity">A <see cref="FanSessionActivity"/>.</param>
 /// <exception cref="ArgumentNullException">If <c>aFanSessionActivity</c> argument is <c>null</c>.</exception>
 public static void Insert(FanSessionActivityCollection aFanSessionActivityCollection)
 {
     if (aFanSessionActivityCollection == null)
     {
         throw new ArgumentNullException("aFanSessionActivityCollection");
     }
     using (var vSqlCommand = new SqlCommand()
     {
         CommandType = CommandType.Text,
         Connection = new SqlConnection(Connection.Instance.SqlConnectionString)
     })
     {
         var vStringBuilder = new StringBuilder();
         vStringBuilder.AppendLine("insert into FSA_FanSessionActivity");
         vStringBuilder.AppendLine("       (FAN_Key,");
         vStringBuilder.AppendLine("        WRT_Key,");
         vStringBuilder.AppendLine("        EXC_Key,");
         vStringBuilder.AppendLine("        ACT_Key,");
         vStringBuilder.AppendLine("        FSA_Result)");
         vStringBuilder.AppendLine("values");
         vStringBuilder.AppendLine("       (@FANKey,");
         vStringBuilder.AppendLine("        @WRTKey,");
         vStringBuilder.AppendLine("        @EXCKey,");
         vStringBuilder.AppendLine("        @ACTKey,");
         vStringBuilder.AppendLine("        @FSAResult)");
         vStringBuilder.AppendLine(";");
         vSqlCommand.Parameters.Add("@FANKey", SqlDbType.Int);
         vSqlCommand.Parameters.Add("@WRTKey", SqlDbType.Int);
         vSqlCommand.Parameters.Add("@EXCKey", SqlDbType.Int);
         vSqlCommand.Parameters.Add("@ACTKey", SqlDbType.Int);
         vSqlCommand.Parameters.Add("@FSAResult", SqlDbType.NVarChar);
         vSqlCommand.CommandText = vStringBuilder.ToString();
         vSqlCommand.Connection.Open();
         aFanSessionActivityCollection.FanSessionActivityList.ForEach(vFanSessionActivity =>
         {
             vSqlCommand.Parameters["@FANKey"].Value    = vFanSessionActivity.WrtKey;
             vSqlCommand.Parameters["@WRTKey"].Value    = vFanSessionActivity.FanKey;
             vSqlCommand.Parameters["@EXCKey"].Value    = vFanSessionActivity.ExcKey;
             vSqlCommand.Parameters["@ACTKey"].Value    = vFanSessionActivity.ActKey;
             vSqlCommand.Parameters["@FSAResult"].Value = vFanSessionActivity.FsaResult;
             vSqlCommand.ExecuteScalar();
         });
         vSqlCommand.Connection.Close();
     }
 }
示例#6
0
        public static webObject loadFanSessionActivityCollection(FanSessionActivityCollection aFanSessionActivityCollection)
        {
            FanToken vFanToken = ServerSession.GetFanToken(HttpContext.Current.Session);
            webObject vWebObject = new webObject();
            vWebObject.aTransactionStatus = ServerSession.GetTransactionStatus(HttpContext.Current.Session);

            try
            {
                FanServiceConsumer.GetFanSessionActivityCollection(vFanToken, aFanSessionActivityCollection);
                vWebObject.aTransactionStatus.TransactionResult = TransactionResult.OK;
                vWebObject.aTransactionStatus.Message = "FanSessionActivityCollection Loaded";
                ServerSession.SetTransactionStatus(HttpContext.Current.Session, vWebObject.aTransactionStatus);
                vWebObject.AnObject = aFanSessionActivityCollection;
            }
            catch (TransactionStatusException tx)
            {
                vWebObject.aTransactionStatus.AssignFromSource(tx.TransactionStatus);
                return vWebObject;
            }
            catch (Exception ex)
            {
                vWebObject.aTransactionStatus.TransactionResult = TransactionResult.GeneralException;
                vWebObject.aTransactionStatus.Message = "Load of FanSessionActivityCollection unsuccesful" + ex.Message;
                vWebObject.aTransactionStatus.InnerMessage = ex.InnerException == null ? String.Empty : ex.InnerException.Message;
                return vWebObject;
            }
            return vWebObject;
        }
示例#7
0
 public static void Save(FanSessionActivityCollection aFanSessionActivityCollection)
 {
     Delete(aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter);
     Insert(aFanSessionActivityCollection);
 }
 public static void Save(FanSessionActivityCollection aFanSessionActivityCollection)
 {
     Delete(aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter);
     Insert(aFanSessionActivityCollection);
 }
 /// <summary>
 ///   The overloaded Load method that will fill the <c>FanSessionActivityList</c> property a <see cref="FanSessionActivityCollection"/> object as an
 ///   ordered <c>List</c> of <see cref="FanSessionActivity"/>, filtered by the filter properties of the passed <see cref="FanSessionActivityCollection"/>.
 /// </summary>
 /// <param name="aFanSessionActivityCollection">The <see cref="FanSessionActivityCollection"/> object that must be filled.</param>
 /// <remarks>
 ///   The filter properties of the <see cref="FanSessionActivityCollection"/> must be correctly completed by the calling application.
 /// </remarks>
 /// <exception cref="ArgumentNullException">If <c>aFanSessionActivityCollection</c> argument is <c>null</c>.</exception>
 public static void Load(FanSessionActivityCollection aFanSessionActivityCollection)
 {
     if (aFanSessionActivityCollection == null)
     {
         throw new ArgumentNullException("aFanSessionActivityCollection");
     }
     using (var vSqlCommand = new SqlCommand()
     {
         CommandType = CommandType.Text,
         Connection = new SqlConnection(Connection.Instance.SqlConnectionString)
     })
     {
         var vStringBuilder = BuildSQL();
         if (aFanSessionActivityCollection.IsFiltered)
         {
             if (aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.WrtKey > 0)
             {
                 vStringBuilder.AppendLine("and t2.WRT_Key = @WRTKey");
                 vSqlCommand.Parameters.AddWithValue("@WRTKey", aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.WrtKey);
             }
             if (aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.FanKey > 0)
             {
                 vStringBuilder.AppendLine("and t2.FAN_Key = @FANKey");
                 vSqlCommand.Parameters.AddWithValue("@FANKey", aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.FanKey);
             }
             if (aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.FssKey > 0)
             {
                 vStringBuilder.AppendLine("and t2.FSS_Key = @FSSKey");
                 vSqlCommand.Parameters.AddWithValue("@FSSKey", aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.FssKey);
             }
             if (aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.ActKey > 0)
             {
                 vStringBuilder.AppendLine("and t1.ACT_Key = @ACTKey");
                 vSqlCommand.Parameters.AddWithValue("@ACTKey", aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.ActKey);
             }
             if (aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.ExcKey > 0)
             {
                 vStringBuilder.AppendLine("and t1.EXC_Key = @EXCKey");
                 vSqlCommand.Parameters.AddWithValue("@EXCKey", aFanSessionActivityCollection.FanSessionActivityFilter.FsaFilter.ExcKey);
             }
         }
         vStringBuilder.AppendLine("order by t2.FSS_Key");
         vSqlCommand.CommandText = vStringBuilder.ToString();
         vSqlCommand.Connection.Open();
         using (SqlDataReader vSqlDataReader = vSqlCommand.ExecuteReader())
         {
             while (vSqlDataReader.Read())
             {
                 var vFanSessionActivity = new FanSessionActivity();
                 DataToObject(vFanSessionActivity, vSqlDataReader, false);
                 aFanSessionActivityCollection.FanSessionActivityList.Add(vFanSessionActivity);
             }
             vSqlDataReader.Close();
         }
         vSqlCommand.Connection.Close();
     }
 }
示例#10
0
 /// <summary>
 ///   Insert a <see cref="FanSessionActivity"/> passed as an argument via Stored Procedure that returns the newly inserted FanSessionActivity Key 
 /// </summary>
 /// <param name="aFanSessionActivity">A <see cref="FanSessionActivity"/>.</param>
 /// <exception cref="ArgumentNullException">If <c>aFanSessionActivity</c> argument is <c>null</c>.</exception>
 public static void Insert(FanSessionActivityCollection aFanSessionActivityCollection)
 {
     if (aFanSessionActivityCollection == null)
     {
         throw new ArgumentNullException("aFanSessionActivityCollection");
     }
     using (var vSqlCommand = new SqlCommand()
     {
         CommandType = CommandType.Text,
         Connection = new SqlConnection(Connection.Instance.SqlConnectionString)
     })
     {
         var vStringBuilder = new StringBuilder();
         vStringBuilder.AppendLine("insert into FSA_FanSessionActivity");
         vStringBuilder.AppendLine("       (FAN_Key,");
         vStringBuilder.AppendLine("        WRT_Key,");
         vStringBuilder.AppendLine("        EXC_Key,");
         vStringBuilder.AppendLine("        ACT_Key,");
         vStringBuilder.AppendLine("        FSA_Result)");
         vStringBuilder.AppendLine("values");
         vStringBuilder.AppendLine("       (@FANKey,");
         vStringBuilder.AppendLine("        @WRTKey,");
         vStringBuilder.AppendLine("        @EXCKey,");
         vStringBuilder.AppendLine("        @ACTKey,");
         vStringBuilder.AppendLine("        @FSAResult)");
         vStringBuilder.AppendLine(";");
         vSqlCommand.Parameters.Add("@FANKey", SqlDbType.Int);
         vSqlCommand.Parameters.Add("@WRTKey", SqlDbType.Int);
         vSqlCommand.Parameters.Add("@EXCKey", SqlDbType.Int);
         vSqlCommand.Parameters.Add("@ACTKey", SqlDbType.Int);
         vSqlCommand.Parameters.Add("@FSAResult", SqlDbType.NVarChar);
         vSqlCommand.CommandText = vStringBuilder.ToString();
         vSqlCommand.Connection.Open();
         aFanSessionActivityCollection.FanSessionActivityList.ForEach(vFanSessionActivity =>
         {
             vSqlCommand.Parameters["@FANKey"].Value = vFanSessionActivity.WrtKey;
             vSqlCommand.Parameters["@WRTKey"].Value = vFanSessionActivity.FanKey;
             vSqlCommand.Parameters["@EXCKey"].Value = vFanSessionActivity.ExcKey;
             vSqlCommand.Parameters["@ACTKey"].Value = vFanSessionActivity.ActKey;
             vSqlCommand.Parameters["@FSAResult"].Value = vFanSessionActivity.FsaResult;
             vSqlCommand.ExecuteScalar();
         });
         vSqlCommand.Connection.Close();
     }
 }
示例#11
0
 /// <summary>
 /// Saves the provider suburb.
 /// </summary>
 /// <param name="aFanKey">A user key.</param>
 /// <param name="aXmlArgument">A XML argument.</param>
 /// <returns>A string of XML representing a FanSessionActivityCollection</returns>
 /// <exception cref="System.ArgumentNullException">aXmlArgument of SaveFanSessionActivity</exception>
 public static string SaveFanSessionActivity(FanKey aFanKey, string aXmlArgument)
 {
     if (aXmlArgument == null)
     {
         throw new ArgumentNullException("aXmlArgument of SaveFanSessionActivity");
     }
     FanSessionActivityCollection vFanSessionActivityCollection = new FanSessionActivityCollection();
     vFanSessionActivityCollection = XmlUtils.Deserialize<FanSessionActivityCollection>(aXmlArgument);
     FanSessionActivityBusiness.Save(aFanKey, vFanSessionActivityCollection);
     return XmlUtils.Serialize<FanSessionActivityCollection>(vFanSessionActivityCollection, true);
 }
示例#12
0
 /// <summary>
 /// Add a <see cref="FanSessionActivity" />.
 /// </summary>
 /// <param name="aFanToken">A <see cref="FanToken" /> object used for Access Control.</param>
 /// <param name="aFanSessionActivityCollection">A provider suburb collection.</param>
 public static void SaveFanSessionActivity(FanToken aFanToken, FanSessionActivityCollection aFanSessionActivityCollection)
 {
     FanCallHandler.ServiceCall <FanSessionActivityCollection>(aFanToken, "SaveFanSessionActivity", aFanSessionActivityCollection);
 }
示例#13
0
 /// <summary>
 ///   Gets a specified <see cref="FanSessionActivityCollection"/>.
 /// </summary>
 /// <param name="aFanToken">A <see cref="FanToken"/> object used for Access Control.</param>
 /// <param name="aFanSessionActivityCollection"><see cref="FanSessionActivity"/>Collection object.</param>
 public static void GetFanSessionActivityCollection(FanToken aFanToken, FanSessionActivityCollection aFanSessionActivityCollection)
 {
     FanCallHandler.ServiceCall <FanSessionActivityCollection>(aFanToken, "GetFanSessionActivityCollection", aFanSessionActivityCollection);
 }
示例#14
0
 /// <summary>
 /// Add a <see cref="FanSessionActivity" />.
 /// </summary>
 /// <param name="aFanToken">A <see cref="FanToken" /> object used for Access Control.</param>
 /// <param name="aFanSessionActivityCollection">A provider suburb collection.</param>
 public static void SaveFanSessionActivity(FanToken aFanToken, FanSessionActivityCollection aFanSessionActivityCollection)
 {
     FanCallHandler.ServiceCall<FanSessionActivityCollection>(aFanToken, "SaveFanSessionActivity", aFanSessionActivityCollection);
 }
示例#15
0
 /// <summary>
 ///   Gets a specified <see cref="FanSessionActivityCollection"/>.
 /// </summary>
 /// <param name="aFanToken">A <see cref="FanToken"/> object used for Access Control.</param>
 /// <param name="aFanSessionActivityCollection"><see cref="FanSessionActivity"/>Collection object.</param>
 public static void GetFanSessionActivityCollection(FanToken aFanToken, FanSessionActivityCollection aFanSessionActivityCollection)
 {
     FanCallHandler.ServiceCall<FanSessionActivityCollection>(aFanToken, "GetFanSessionActivityCollection", aFanSessionActivityCollection);
 }