コード例 #1
0
ファイル: Attachments.cs プロジェクト: terryxym/DiscuzNT
        //public static List<AttachmentInfo> GetAttachmentListByUid(int uid)
        //{
        //    List<AttachmentInfo> attachmentlist = new List<AttachmentInfo>();

        //    IDataReader reader = DatabaseProvider.GetInstance().GetUnusedAttachmentListByUid(uid);

        //    while (reader.Read())
        //    {
        //        AttachmentInfo info = new AttachmentInfo();

        //        info.Attachment = reader["attachment"].ToString().Trim();
        //        info.Aid = TypeConverter.ObjectToInt(reader["aid"]);
        //        info.Filetype = reader["filetype"].ToString();
        //        info.Readperm = TypeConverter.ObjectToInt(reader["readperm"]);
        //        info.Attachprice = TypeConverter.ObjectToInt(reader["attachprice"]);
        //        info.Width = TypeConverter.ObjectToInt(reader["width"]);
        //        info.Height = TypeConverter.ObjectToInt(reader["height"]);
        //        attachmentlist.Add(info);
        //    }
        //    reader.Close();
        //    return attachmentlist;
        //}

        /// <summary>
        /// 获取附件类型列表
        /// </summary>
        /// <returns>附件类型列表</returns>
        public static List <AttachmentType> AttachTypeList()
        {
            List <AttachmentType> list = new List <AttachmentType>();

            foreach (AttachmentType act in MyAttachmentsTypeConfigs.GetConfig().AttachmentType)
            {
                AttachmentType MyAttachmentType = new AttachmentType();
                MyAttachmentType.TypeId   = act.TypeId;
                MyAttachmentType.TypeName = act.TypeName;
                MyAttachmentType.ExtName  = act.ExtName;
                list.Add(MyAttachmentType);
            }

            return(list);
        }
コード例 #2
0
ファイル: Attachments.cs プロジェクト: object8421/ichari
 /// <summary>
 /// 获取我的附件类型信息
 /// </summary>
 /// <returns>我的附件类型信息</returns>
 public static AttachmentType[] GetAttach()
 {
     return(MyAttachmentsTypeConfigs.GetConfig().AttachmentType);
 }