예제 #1
0
        public void ProcessRequest(HttpContext context)
        {
            int usrID = 0;
            int pID = 0;
            string rtnFilePath = string.Empty;

            DocumentDA objDocDA = new DocumentDA();
            if (context.Request["ID"] != null)
                usrID = Convert.ToInt32(context.Request["ID"]);
            else if (context.Request["pID"] != null)
                pID = Convert.ToInt32(context.Request["pID"]);

            context.Response.ContentType = "image/jpeg";
            if (pID != 0)
                rtnFilePath = objDocDA.GetPresenterProfileImage(pID);
            else
                rtnFilePath = objDocDA.GetUserProfileImage(usrID);

            if (rtnFilePath != string.Empty)
            {
                if (File.Exists(Constant.DocRepoClient + rtnFilePath))
                    context.Response.WriteFile(Constant.DocRepoClient + rtnFilePath);
                else
                    context.Response.WriteFile(Constant.DocRepRoot + "profileImgMissing.png");
            }
            else
                context.Response.WriteFile(Constant.DocRepRoot + "profileImg.png");
        }
예제 #2
0
 public void ProcessRequest(HttpContext context)
 {
     DocumentDA objDocDA = new DocumentDA();
     string rtnFilePath = objDocDA.GetUserProfileImage(Convert.ToInt32(context.Session[""]));
     if (rtnFilePath != "")
     {
         if (File.Exists(Constant.DocRepRoot + rtnFilePath))
         {
             context.Response.ContentType = "image/jpeg";
             context.Response.WriteFile(Constant.DocRepRoot + rtnFilePath);
         }
         else
             throw new HttpException(404, "Invalid photo name.");
     }
 }
예제 #3
0
 public string getUserProfileImagePath(int UserID)
 {
     DocumentDA objDocumentDA = new DocumentDA();
     return objDocumentDA.GetUserProfileImage(UserID);
 }