Exemplo n.º 1
0
 /// <summary>
 /// Copies the elements of the specified <see cref="PrivateMessageInfo">PrivateMessageInfo</see> array to the end of the collection.
 /// </summary>
 /// <param name="value">An array of type <see cref="PrivateMessageInfo">PrivateMessageInfo</see> containing the Components to add to the collection.</param>
 public void AddRange(PrivateMessageInfo[] value)
 {
     for (int i = 0;	(i < value.Length); i = (i + 1))
     {
         this.Add(value[i]);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 创建短消息
        /// </summary>
        /// <param name="privatemessageinfo">短消息内容</param>
        /// <param name="savetosentbox">设置短消息是否在发件箱保留(0为不保留, 1为保留)</param>
        /// <returns>短消息在数据库中的pmid</returns>
        public static int CreatePrivateMessage(PrivateMessageInfo privatemessageinfo, int savetosentbox)
        {
            int pmid = DatabaseProvider.GetInstance().CreatePrivateMessage(privatemessageinfo, savetosentbox);

            if (Users.appDBCache && Users.IUserService != null)
            {
                UserInfo userInfo = Users.IUserService.GetUserInfo(privatemessageinfo.Msgtoid);
                if (userInfo != null)
                {
                    userInfo.Newpmcount = userInfo.Newpmcount + 1;
                    userInfo.Newpm = 1;
                    Users.IUserService.UpdateUser(userInfo);
                }
            }
            return pmid;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Gets a value indicating whether the collection contains the specified <see cref="PrivateMessageInfoCollection">PrivateMessageInfoCollection</see>.
 /// </summary>
 /// <param name="value">The <see cref="PrivateMessageInfoCollection">PrivateMessageInfoCollection</see> to search for in the collection.</param>
 /// <returns><b>true</b> if the collection contains the specified object; otherwise, <b>false</b>.</returns>
 public bool Contains(PrivateMessageInfo value)
 {
     return this.List.Contains(value);
 }
Exemplo n.º 4
0
 public int Add(PrivateMessageInfo value)
 {
     return this.List.Add(value);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PrivateMessageInfoCollection">PrivateMessageInfoCollection</see> class containing the specified array of <see cref="PrivateMessageInfo">PrivateMessageInfo</see> Components.
 /// </summary>
 /// <param name="value">An array of <see cref="PrivateMessageInfo">PrivateMessageInfo</see> Components with which to initialize the collection. </param>
 public PrivateMessageInfoCollection(PrivateMessageInfo[] value)
 {
     this.AddRange(value);
 }
Exemplo n.º 6
0
 public void Remove(PrivateMessageInfo value)
 {
     List.Remove(value);
 }
Exemplo n.º 7
0
 public void Insert(int index, PrivateMessageInfo value)
 {
     List.Insert(index, value);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Gets the index in the collection of the specified <see cref="PrivateMessageInfoCollection">PrivateMessageInfoCollection</see>, if it exists in the collection.
 /// </summary>
 /// <param name="value">The <see cref="PrivateMessageInfoCollection">PrivateMessageInfoCollection</see> to locate in the collection.</param>
 /// <returns>The index in the collection of the specified object, if found; otherwise, -1.</returns>
 public int IndexOf(PrivateMessageInfo value)
 {
     return this.List.IndexOf(value);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Copies the collection Components to a one-dimensional <see cref="T:System.Array">Array</see> instance beginning at the specified index.
 /// </summary>
 /// <param name="array">The one-dimensional <see cref="T:System.Array">Array</see> that is the destination of the values copied from the collection.</param>
 /// <param name="index">The index of the array at which to begin inserting.</param>
 public void CopyTo(PrivateMessageInfo[] array, int index)
 {
     this.List.CopyTo(array, index);
 }
Exemplo n.º 10
0
 /// <summary>
 /// 加载单个短消息对象
 /// </summary>
 /// <param name="reader"></param>
 /// <returns></returns>
 private static PrivateMessageInfo LoadSinglePrivateMessage(IDataReader reader)
 {
     PrivateMessageInfo info = new PrivateMessageInfo();
     info.Pmid = TypeConverter.StrToInt(reader["pmid"].ToString());
     info.Msgfrom = reader["msgfrom"].ToString();
     info.Msgfromid = TypeConverter.StrToInt(reader["msgfromid"].ToString());
     info.Msgto = reader["msgto"].ToString();
     info.Msgtoid = TypeConverter.StrToInt(reader["msgtoid"].ToString());
     info.Folder = TypeConverter.StrToInt(reader["folder"].ToString());
     info.New = TypeConverter.StrToInt(reader["new"].ToString());
     info.Subject = reader["subject"].ToString();
     info.Postdatetime = reader["postdatetime"].ToString();
     info.Message = reader["message"].ToString();
     return info;
 }
Exemplo n.º 11
0
 /// <summary>
 /// 创建短消息
 /// </summary>
 /// <param name="__privatemessageinfo">短消息内容</param>
 /// <param name="savetosentbox">设置短消息是否在发件箱保留(0为不保留, 1为保留)</param>
 /// <returns>短消息在数据库中的pmid</returns>
 public int CreatePrivateMessage(PrivateMessageInfo privateMessageInfo, int saveToSentBox)
 {
     DbParameter[] parms = {
                                DbHelper.MakeInParam("@pmid",(DbType)SqlDbType.Int,4,privateMessageInfo.Pmid),
                                DbHelper.MakeInParam("@msgfrom",(DbType)SqlDbType.NVarChar,20,privateMessageInfo.Msgfrom),
                                DbHelper.MakeInParam("@msgfromid",(DbType)SqlDbType.Int,4,privateMessageInfo.Msgfromid),
                                DbHelper.MakeInParam("@msgto",(DbType)SqlDbType.NVarChar,20,privateMessageInfo.Msgto),
                                DbHelper.MakeInParam("@msgtoid",(DbType)SqlDbType.Int,4,privateMessageInfo.Msgtoid),
                                DbHelper.MakeInParam("@folder",(DbType)SqlDbType.SmallInt,2,privateMessageInfo.Folder),
                                DbHelper.MakeInParam("@new",(DbType)SqlDbType.Int,4,privateMessageInfo.New),
                                DbHelper.MakeInParam("@subject",(DbType)SqlDbType.NVarChar,80,privateMessageInfo.Subject),
                                DbHelper.MakeInParam("@postdatetime",(DbType)SqlDbType.DateTime,8,DateTime.Parse(privateMessageInfo.Postdatetime)),
                                DbHelper.MakeInParam("@message",(DbType)SqlDbType.NText,0,privateMessageInfo.Message),
                                DbHelper.MakeInParam("@savetosentbox",(DbType)SqlDbType.Int,4,saveToSentBox)
                            };
     return TypeConverter.ObjectToInt(
                          DbHelper.ExecuteScalar(CommandType.StoredProcedure,
                                                 string.Format("{0}createpm", BaseConfigs.GetTablePrefix), parms), -1);
 }