internal void LoadArray(object[] dataArray)
 {
     if (dataArray.Length != 7)
     {
         throw new ArgumentException("转换成此InnerMailInfo_Query对象的数据数组长度必须是7,传入数组为" + dataArray.Length + "。" + string.Join(", ", dataArray), "dataArray");
     }
     MailId     = (string)dataArray[0];
     Title      = (string)dataArray[1];
     SendTime   = (DateTime)dataArray[2];
     ActionTime = (DateTime)dataArray[3];
     SenderId   = (string)dataArray[4];
     UpdateTime = (DateTime)dataArray[5];
     if (dataArray[6] == null || dataArray[6] == DBNull.Value)
     {
         HandleType = InnerMailHandleType.UnRead;
     }
     else
     {
         HandleType = (InnerMailHandleType)dataArray[6];
     }
 }
Beispiel #2
0
 ///// <summary>
 ///// 查询已读和未读站内信
 ///// </summary>
 //public InnerMailInfo_QueryCollection QueryUnReadInnerMailListByReceiver(string userId, int pageIndex, int pageSize, InnerMailHandleType handleType)
 //{
 //    try
 //    {
 //        return new SiteMessageControllBusiness().QueryUnReadInnerMailListByReceiver(userId, pageIndex, pageSize, handleType);
 //    }
 //    catch (Exception ex)
 //    {
 //        throw new Exception(ex.Message, ex);
 //    }
 //}
 /// <summary>
 /// 查询已读和未读站内信
 /// </summary>
 public SiteMessageInnerMailListNew_Collection QueryUnReadInnerMailListByReceiver(string userId, int pageIndex, int pageSize, InnerMailHandleType handleType)
 {
     try
     {
         return(new SiteMessageControllBusiness().QueryUnReadInnerMailListByReceiver(userId, pageIndex, pageSize, handleType));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message, ex);
     }
 }
        //public InnerMailInfo_QueryCollection QueryUnReadInnerMailListByReceiver(string userId, int pageIndex, int pageSize, InnerMailHandleType handleType)
        //{
        //    using (var manager = new InnerMailManager())
        //    {
        //        var result = new InnerMailInfo_QueryCollection();
        //        int totalCount;
        //        var list = manager.QueryUnReadInnerMailList_ByReceiverId(userId, pageIndex, pageSize, Convert.ToInt32(handleType), out totalCount);

        //        result.LoadList(list);
        //        if (result != null && result.InnerMailList != null)
        //        {
        //            result.TotalCount = totalCount;
        //            //var tempResult = result.InnerMailList.Where(s => s.HandleType == handleType);
        //            //if (tempResult != null && tempResult.Count() > 0)
        //            //{
        //            //    result.TotalCount = tempResult.Count();
        //            //    result.InnerMailList = tempResult.Skip(pageIndex * pageSize).Take(pageSize).ToList();
        //            //}
        //        }
        //        return result;
        //    }
        //}

        public SiteMessageInnerMailListNew_Collection QueryUnReadInnerMailListByReceiver(string userId, int pageIndex, int pageSize, InnerMailHandleType handleType)
        {
            using (var manager = new InnerMailManager())
            {
                var result = new SiteMessageInnerMailListNew_Collection();
                return(manager.QueryUnReadInnerMailList_ByReceiverId(userId, pageIndex, pageSize, Convert.ToInt32(handleType)));
            }
        }