亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? issueattachment.cs

?? BugNET is an issue tracking and project issue management solution built using the ASP.NET web applic
?? CS
字號:
using System;
using System.Data;
using System.Collections.Generic;
using BugNET.DataAccessLayer;
using System.IO;
using log4net;
using log4net.Config;

namespace BugNET.BusinessLogicLayer
{
	/// <summary>
	/// Summary description for IssueAttachment.
	/// </summary>
	public class IssueAttachment
	{
		#region Private Variables
            private int _Id;
            private int _IssueId;
            private string _CreatorUserName;
            private string _CreatorDisplayName;
            private DateTime _DateCreated;
            private string _FileName;
            private string _ContentType;
			private string _Description;
			private int _Size;
            private Byte[] _Attachment;
            private static readonly ILog Log = LogManager.GetLogger(typeof(IssueAttachment));
		#endregion

		#region Constructors

            /// <summary>
            /// Initializes a new instance of the <see cref="IssueAttachment"/> class.
            /// </summary>
            /// <param name="fileName">Name of the file.</param>
            /// <param name="contentType">Type of the content.</param>
            /// <param name="attachment">The attachment.</param>
            public IssueAttachment(string fileName, string contentType, byte[] attachment)
                : this(Globals.NewId, Globals.NewId, String.Empty, String.Empty, Globals.GetDateTimeMinValue(), fileName, contentType, attachment, 0)
            { }


            /// <summary>
            /// Initializes a new instance of the <see cref="IssueAttachment"/> class.
            /// </summary>
            /// <param name="issueId">The issue id.</param>
            /// <param name="creatorUserName">Name of the creator user.</param>
            /// <param name="fileName">Name of the file.</param>
            /// <param name="contentType">Type of the content.</param>
            /// <param name="attachment">The attachment.</param>
            public IssueAttachment(int issueId, string creatorUserName, string fileName, string contentType, byte[] attachment, int size)
                : this(Globals.NewId, issueId, creatorUserName, String.Empty, Globals.GetDateTimeMinValue(), fileName, contentType, attachment, size)
            { }


            /// <summary>
            /// Initializes a new instance of the <see cref="IssueAttachment"/> class.
            /// </summary>
            /// <param name="attachmentId">The attachment id.</param>
            /// <param name="issueId">The issue id.</param>
            /// <param name="creatorUserName">Name of the creator user.</param>
            /// <param name="creatorDisplayName">Display name of the creator.</param>
            /// <param name="created">The created.</param>
            /// <param name="fileName">Name of the file.</param>
            public IssueAttachment(int attachmentId, int issueId, string creatorUserName, string creatorDisplayName, DateTime created, string fileName, int size)
                : this(attachmentId, issueId, creatorUserName, creatorDisplayName, created, fileName, String.Empty, null,size)
            { }

            /// <summary>
            /// Initializes a new instance of the <see cref="IssueAttachment"/> class.
            /// </summary>
            /// <param name="attachmentId">The attachment id.</param>
            /// <param name="issueId">The issue id.</param>
            /// <param name="creatorUserName">Name of the creator user.</param>
            /// <param name="creatorDisplayName">Display name of the creator.</param>
            /// <param name="created">The created.</param>
            /// <param name="fileName">Name of the file.</param>
            /// <param name="contentType">Type of the content.</param>
            /// <param name="attachment">The attachment.</param>
            public IssueAttachment(int attachmentId, int issueId, string creatorUserName, string creatorDisplayName, DateTime created, string fileName, string contentType, byte[] attachment, int size)
            {

                _Id = attachmentId;
                _IssueId = issueId;
                _CreatorUserName = creatorUserName;
                _CreatorDisplayName = creatorDisplayName;
                _DateCreated = created;
                _FileName = fileName;
                _ContentType = contentType;
                _Attachment = attachment;
                _Size = size;
            }
		#endregion

		#region Properties
            /// <summary>
            /// Gets the id.
            /// </summary>
            /// <value>The id.</value>
            public int Id
            {
                get { return _Id; }
            }


            /// <summary>
            /// Gets or sets the issue id.
            /// </summary>
            /// <value>The issue id.</value>
            public int IssueId
            {
                get { return _IssueId; }
                set
                {
                    if (value <= Globals.NewId)
                        throw (new ArgumentOutOfRangeException("value"));
                    _IssueId = value;
                }
            }


            /// <summary>
            /// Gets the creator username.
            /// </summary>
            /// <value>The creator username.</value>
            public string CreatorUserName
            {
                get
                {
                    if (_CreatorUserName == null || _CreatorUserName.Length == 0)
                        return string.Empty;
                    else
                        return _CreatorUserName;
                }
            }


            /// <summary>
            /// Gets the display name of the creator.
            /// </summary>
            /// <value>The display name of the creator.</value>
            public string CreatorDisplayName
            {
                get
                {
                    if (_CreatorDisplayName == null || _CreatorDisplayName.Length == 0)
                        return string.Empty;
                    else
                        return _CreatorDisplayName;
                }
            }

            /// <summary>
            /// Gets the date created.
            /// </summary>
            /// <value>The date created.</value>
            public DateTime DateCreated
            {
                get { return _DateCreated; }
            }


            /// <summary>
            /// Gets the name of the file.
            /// </summary>
            /// <value>The name of the file.</value>
            public string FileName
            {
                get
                {
                    if (_FileName == null || _FileName.Length == 0)
                        return string.Empty;
                    else
                        return _FileName;
                }
            }



            /// <summary>
            /// Gets the type of the content.
            /// </summary>
            /// <value>The type of the content.</value>
            public string ContentType
            {
                get
                {
                    if (_ContentType == null || _ContentType.Length == 0)
                        return string.Empty;
                    else
                        return _ContentType;
                }
            }


            /// <summary>
            /// Gets the attachment.
            /// </summary>
            /// <value>The attachment.</value>
            public Byte[] Attachment
            {
                get { return _Attachment; }
            }

    
            ///<summary>
            /// Gets the size.
            /// </summary>
            /// <value>The size.</value>
			public int Size 
			{
				get{return _Size;}
			}
            /// <summary>
            /// Gets the description.
            /// </summary>
            /// <value>The description.</value>
			public string Description
			{
				get{return _Description;}
			}

            

		#endregion

		#region Instance Methods
            /// <summary>
            /// Saves this instance.
            /// </summary>
            /// <returns></returns>
			public bool Save() 
			{
				

				if (Id <= Globals.NewId) 
				{
					int TempId = DataProviderManager.Provider.CreateNewIssueAttachment(this);
					if (TempId>0) 
					{
						_Id = TempId;
						return true;
					} 
					else
						return false;
				} 
				return false;
			}
		#endregion

		#region Static Methods
			/// <summary>
			/// Gets all IssueAttachments for a bug
			/// </summary>
			/// <param name="bugId"></param>
			/// <returns></returns>
			public static List<IssueAttachment> GetIssueAttachmentsByIssueId(int issueId)
			{
                // validate input
                if (issueId <= Globals.NewId)
                    throw (new ArgumentOutOfRangeException("issueId"));

				return DataProviderManager.Provider.GetIssueAttachmentsByIssueId(issueId);
			}

            /// <summary>
            /// Gets an IssueAttachment by id
            /// </summary>
            /// <param name="IssueAttachmentId">The IssueAttachment id.</param>
            /// <returns></returns>
			public static IssueAttachment GetIssueAttachmentById(int attachmentId)
			{
                // validate input
                if (attachmentId <= Globals.NewId)
                    throw (new ArgumentOutOfRangeException("attachmentId"));

                return DataProviderManager.Provider.GetIssueAttachmentById(attachmentId);
			}

            /// <summary>
            /// Deletes the IssueAttachment.
            /// </summary>
            /// <param name="IssueAttachmentId">The IssueAttachment id.</param>
            /// <returns></returns>
            public static bool DeleteIssueAttachment(int IssueAttachmentId)
            {
                
                
                IssueAttachment att = IssueAttachment.GetIssueAttachmentById(IssueAttachmentId);
                //TODO: The upload path for the project should really be apart of 
                //IssueAttachment class when gotten from the database
                Issue b = Issue.GetIssueById(att.IssueId);
                Project p = Project.GetProjectById(b.ProjectId);


                if (DataProviderManager.Provider.DeleteIssueAttachment(IssueAttachmentId))
                {
                    //delete IssueAttachment from file system.
                    try
                    {
                        File.Delete(System.Web.HttpContext.Current.Server.MapPath(string.Format("~\\Uploads\\{0}\\{1}",p.UploadPath,att.FileName)));   
                    }
                    catch (Exception ex)
                    {
                        //set user to log4net context, so we can use %X{user} in the appenders
                        if (System.Web.HttpContext.Current.User != null && System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
                            MDC.Set("user", System.Web.HttpContext.Current.User.Identity.Name);
 
                        if(Log.IsErrorEnabled)
                            Log.Error(String.Format("Error Deleting IssueAttachment - {0}",string.Format("{0}\\{1}",p.UploadPath,att.FileName)), ex);

                        //TODO: Get this from a resource string.
                        throw new ApplicationException("An error has occured deleing an IssueAttachment", ex);
                    }
                }
                return true;
               
            }
		
		#endregion

	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品女同一区二区三区| 国产精品色在线观看| 精品日韩在线观看| 欧美国产视频在线| 日本一不卡视频| 色国产综合视频| 国产欧美精品一区aⅴ影院 | 欧美午夜精品理论片a级按摩| 日韩三级免费观看| 亚洲精品视频免费看| 国产69精品久久777的优势| 91精品久久久久久久99蜜桃| 一区在线观看视频| 狠狠久久亚洲欧美| 日韩一级成人av| 日韩精品电影一区亚洲| 91久久精品日日躁夜夜躁欧美| 国产欧美日韩麻豆91| 国产精品自在欧美一区| 欧美成人伊人久久综合网| 日韩不卡一区二区三区| 欧美日韩精品福利| 亚洲第一福利视频在线| 91免费视频大全| 亚洲精品欧美专区| 成人免费毛片高清视频| 欧美激情一区二区三区蜜桃视频| 久久精品99久久久| 精品国产乱码久久| 国产一区二区女| 欧美国产一区在线| 成人免费观看av| 亚洲色图在线播放| 在线影院国内精品| 亚洲午夜精品在线| 欧美一区二区三区四区在线观看| 天天亚洲美女在线视频| 日韩一区二区三区视频在线| 蜜臀99久久精品久久久久久软件| 欧美性猛交xxxxxxxx| 亚洲va国产天堂va久久en| 666欧美在线视频| 人禽交欧美网站| 亚洲精品在线免费观看视频| 国产91清纯白嫩初高中在线观看 | 视频一区二区三区在线| 91精品中文字幕一区二区三区| 天堂va蜜桃一区二区三区| 欧美一级专区免费大片| 久久精工是国产品牌吗| 日本一区二区成人| 色噜噜狠狠成人中文综合 | 日本一区二区三区高清不卡 | 免费精品视频在线| 久久久美女艺术照精彩视频福利播放| 国产一区视频网站| 亚洲色图欧美偷拍| 91精品国产综合久久香蕉麻豆| 看片的网站亚洲| 国产精品国产三级国产普通话三级 | 色婷婷综合在线| 丝袜美腿亚洲一区二区图片| 精品国产1区2区3区| 91丨九色丨国产丨porny| 免费在线观看精品| ●精品国产综合乱码久久久久| 欧美日韩精品一区二区在线播放| 国产自产高清不卡| 亚洲人成精品久久久久久| 日韩欧美中文字幕一区| 99久久亚洲一区二区三区青草| 天堂成人国产精品一区| 18欧美乱大交hd1984| 日韩写真欧美这视频| 97久久精品人人做人人爽 | 欧美一区二区福利视频| 成人综合激情网| 日本不卡一区二区| 日韩伦理电影网| 久久精品一区二区三区不卡| 欧美影院午夜播放| 成人免费视频播放| 韩日欧美一区二区三区| 午夜精品久久久久久久| 日韩一区中文字幕| 久久久国际精品| 欧美一区二区三区系列电影| 一本色道久久综合亚洲aⅴ蜜桃| 国产毛片一区二区| 久久国产婷婷国产香蕉| 亚洲国产视频直播| 亚洲欧美另类久久久精品2019| 久久综合色婷婷| 91精品免费在线观看| 色8久久人人97超碰香蕉987| 成人天堂资源www在线| 国产主播一区二区三区| 日本少妇一区二区| 亚洲第一福利视频在线| 亚洲美女视频在线观看| 国产精品另类一区| 久久久久久久久久久99999| 欧美成va人片在线观看| 欧美一区二区三区婷婷月色| 欧美精品一级二级三级| 色中色一区二区| 99在线视频精品| 波多野结衣中文字幕一区二区三区| 国产最新精品精品你懂的| 久久精品国产秦先生| 久久精品久久久精品美女| 视频在线观看91| 日韩激情av在线| 日韩高清在线观看| 日产精品久久久久久久性色| 偷拍日韩校园综合在线| 午夜伦理一区二区| 肉色丝袜一区二区| 日韩国产一二三区| 久久精品国产一区二区三| 久久爱www久久做| 国产一区免费电影| 粉嫩aⅴ一区二区三区四区 | 91精品视频网| 欧美一级片在线看| 久久综合狠狠综合| 国产日韩精品久久久| 国产精品久久久久精k8| 一区二区三区91| 日韩电影免费在线观看网站| 久久精品99国产国产精| 成人精品一区二区三区中文字幕 | 国产不卡视频在线播放| av电影在线观看完整版一区二区| 一本色道久久综合亚洲精品按摩 | 99久久精品情趣| 欧美亚洲图片小说| 日韩午夜小视频| 久久精品一区二区三区不卡牛牛| 国产精品色在线观看| 亚洲综合久久av| 久久福利视频一区二区| 丁香婷婷综合激情五月色| 在线观看日韩国产| 日韩精品一区二区三区在线播放| 久久久欧美精品sm网站| 亚洲综合色成人| 韩国成人在线视频| 日本精品一级二级| 精品国产污网站| 亚洲欧美另类综合偷拍| 日韩主播视频在线| 成人免费视频免费观看| 777欧美精品| 国产精品美女久久久久久| 午夜不卡av在线| 国产成人av影院| 欧美性大战久久| 国产视频一区二区在线观看| 婷婷成人激情在线网| 国产福利一区二区三区视频在线 | 91啦中文在线观看| 精品乱码亚洲一区二区不卡| 亚洲色图制服诱惑| 国产乱人伦偷精品视频免下载| 色av综合在线| 久久精品亚洲精品国产欧美| 亚洲二区视频在线| 成人精品国产免费网站| 精品久久久久久久久久久久久久久久久 | 久久精品国产99国产| 91传媒视频在线播放| 久久久精品天堂| 美女尤物国产一区| 欧美在线观看你懂的| 国产精品久久久久久亚洲毛片| 蜜臀av一区二区在线观看| 在线精品视频一区二区三四| 日本一区二区三区四区在线视频 | fc2成人免费人成在线观看播放| 日韩丝袜情趣美女图片| 亚洲精品久久7777| 成人黄色综合网站| 国产肉丝袜一区二区| 久久精品国产一区二区| 欧美一区二区三区视频| 香蕉加勒比综合久久| 色综合一个色综合| 中文字幕日韩一区| 不卡一区在线观看| 国产亚洲精久久久久久| 国产美女在线观看一区| 日韩女优毛片在线| 麻豆精品蜜桃视频网站| 在线不卡一区二区| 亚洲6080在线| 欧美精品亚洲一区二区在线播放| 亚洲丰满少妇videoshd| 欧美日韩国产在线观看| 亚洲成a人片综合在线|