/// <summary> /// The overloaded Load method that will fill the <c>FanList</c> property a <see cref="FanCollection"/> object as an /// ordered <c>List</c> of <see cref="Fan"/>, filtered by the filter properties of the passed <see cref="FanCollection"/>. /// </summary> /// <param name="aFanCollection">The <see cref="FanCollection"/> object that must be filled.</param> /// <remarks> /// The filter properties of the <see cref="FanCollection"/> must be correctly completed by the calling application. /// </remarks> /// <exception cref="ArgumentNullException">If <c>aFanCollection</c> argument is <c>null</c>.</exception> public static void Load(FanCollection aFanCollection) { if (aFanCollection == null) { throw new ArgumentNullException("aFanCollection"); } using (var vSqlCommand = new SqlCommand() { CommandType = CommandType.Text, Connection = new SqlConnection(Connection.Instance.SqlConnectionString) }) { var vStringBuilder = BuildSQL(false); //if (aFanCollection.IsFiltered) //{ // vStringBuilder.AppendLine("where t1.FAN_WebContact = 'Y'"); //} vStringBuilder.AppendLine("order by t1.FAN_UserID"); vSqlCommand.CommandText = vStringBuilder.ToString(); vSqlCommand.Connection.Open(); using (SqlDataReader vSqlDataReader = vSqlCommand.ExecuteReader()) { while (vSqlDataReader.Read()) { var vFan = new Fan(); DataToObject(vFan, vSqlDataReader, false); aFanCollection.FanList.Add(vFan); } vSqlDataReader.Close(); } vSqlCommand.Connection.Close(); } }
/// <summary> /// The <c>GetFanCollection</c> implementation method deserializes an incoming XML Argument <see cref="string"/> as a new <see cref="FanCollection"/> object. /// It invokes the <c>Insert</c> method of <see cref="FanBusiness"/> with the newly deserialized <see cref="FanCollection"/> object. /// Finally, it returns the collection object as a serialized <see cref="string"/> of XML. /// </summary> /// <param name="aXmlArgument">XML Argument <see cref="string"/>.</param> /// <returns><see cref="FanCollection"/> as XML <see cref="string"/>.</returns> /// <exception cref="ArgumentNullException">If <c>aXmlArgument</c> is <c>null</c>.</exception> public static string GetFanCollection(FanKey aFanKey, string aXmlArgument) { if (aXmlArgument == null) { throw new ArgumentNullException("aXmlArgument of GetFanCollection"); } FanCollection vFanCollection = new FanCollection(); vFanCollection = XmlUtils.Deserialize <FanCollection>(aXmlArgument); FanBusiness.Load(aFanKey, vFanCollection); return(XmlUtils.Serialize <FanCollection>(vFanCollection, true)); }
/// <summary> /// The overloaded Load method that will return a <see cref="FanCollection"/>. /// </summary> /// <param name="aFanKey">A <see cref="FanKey"/> object.</param> /// <param name="aFanCollection">A <see cref="FanCollection"/> object.</param> /// <exception cref="ArgumentNullException">If <c>aFanCollection</c> argument is <c>null</c>.</exception> public static void Load(FanKey aFanKey, FanCollection aFanCollection) { if (aFanCollection == null) { throw new ArgumentNullException("Load Fan Business"); } //if (!FanFunctionAccessData.HasModeAccess(aFanKey, "Fan", AccessMode.List)) //{ // throw new ZpAccessException("Access Denied", String.Format("{0}", aFanKey.FannKey), AccessMode.List, "Fan"); //} FanData.Load(aFanCollection); }
/// <summary> /// The <c>GetFanCollection</c> implementation method deserializes an incoming XML Argument <see cref="string"/> as a new <see cref="FanCollection"/> object. /// It invokes the <c>Insert</c> method of <see cref="FanBusiness"/> with the newly deserialized <see cref="FanCollection"/> object. /// Finally, it returns the collection object as a serialized <see cref="string"/> of XML. /// </summary> /// <param name="aXmlArgument">XML Argument <see cref="string"/>.</param> /// <returns><see cref="FanCollection"/> as XML <see cref="string"/>.</returns> /// <exception cref="ArgumentNullException">If <c>aXmlArgument</c> is <c>null</c>.</exception> public static string GetFanCollection(FanKey aFanKey, string aXmlArgument) { if (aXmlArgument == null) { throw new ArgumentNullException("aXmlArgument of GetFanCollection"); } FanCollection vFanCollection = new FanCollection(); vFanCollection = XmlUtils.Deserialize<FanCollection>(aXmlArgument); FanBusiness.Load(aFanKey, vFanCollection); return XmlUtils.Serialize<FanCollection>(vFanCollection, true); }
/// <summary> /// Gets a FanCollection /// </summary> /// <param name="aFantoken">A fantoken.</param> /// <param name="aFedCollection">A user collection.</param> public static void GetFedCollection(FanToken aFantoken, FanCollection aFedCollection) { FanCallHandler.ServiceCall <FedCollection>(aFantoken, "GetFedCollection", aFedCollection); }
/// <summary> /// Gets a FanCollection /// </summary> /// <param name="aFantoken">A fantoken.</param> /// <param name="aFedCollection">A user collection.</param> public static void GetFedCollection(FanToken aFantoken, FanCollection aFedCollection) { FanCallHandler.ServiceCall<FedCollection>(aFantoken, "GetFedCollection", aFedCollection); }