コード例 #1
0
ファイル: Rio_AlbumController.cs プロジェクト: racedstar/R-S
        public ActionResult CreateAlbum(int?s, int?aSN)
        {
            string ID      = string.Empty;
            int    status  = s ?? 0;
            int    albumSN = aSN ?? 0;

            if (Session["UserID"] != null)
            {
                ID = Session["UserID"].ToString();

                if (status == 0)//建立相簿時取得圖片
                {
                    ViewBag.getNotJoinPic = PicModel.getUserPicEnableByID(ID);
                }

                if (status == 1 && albumSN != 0)                                                  //編輯相簿時取得圖片
                {
                    List <Vw_AlbumJoinPic> joinPic = AlbumJoinPicModel.getUpdateJoinPic(albumSN); //已加入相簿的圖片

                    ViewBag.VwAlbum       = AlbumModel.getVwAlbum(albumSN);                       //相簿資料
                    ViewBag.getJoinPic    = joinPic;
                    ViewBag.joinPicCount  = joinPic.Count();
                    ViewBag.getNotJoinPic = AlbumJoinPicModel.getUpdateNotJoinPic(albumSN, ID).OrderByDescending(o => o.CreateDate);//未加入相簿的圖片
                }

                ViewBag.picAllCount = PicModel.getUserAllPicByID(ID).Count();
            }

            ViewBag.aSN = albumSN;
            return(View());
        }
コード例 #2
0
ファイル: Rio_PicController.cs プロジェクト: racedstar/R-S
        public ActionResult RioPicView(int?page)
        {
            string ID     = string.Empty;
            string title  = "PicView";
            string mode   = "V";
            bool   isUser = false;

            if (Request.QueryString.Get("m") != null)
            {
                if (Request.QueryString.Get("m").Equals("E"))
                {
                    title = "PicEdit";
                    mode  = "E";
                }
            }
            ViewBag.title = title;

            ClassNameModel cn = ClassNameModel.getClassName("pic");

            ViewBag.className = cn;

            #region getData
            List <Rio_Pic> data = new List <Rio_Pic>();
            if (Session["UserID"] != null)
            {
                ID   = Session["UserID"].ToString();
                data = PicModel.getUserAllPicByID(ID);
            }

            if (Request.QueryString.Get("vid") != null)
            {
                ID   = Request.QueryString.Get("vid");
                data = PicModel.getUserPicEnableByID(ID);
            }

            if (Session["UserID"] != null && Request.QueryString.Get("vid") != null)
            {
                if (Session["UserID"].ToString().Equals(Request.QueryString.Get("vid")))
                {
                    ID     = Session["UserID"].ToString();
                    isUser = true;
                    data   = PicModel.getUserAllPicByID(ID);
                }
            }

            if (Session["UserID"] == null && Request.QueryString.Get("vid") == null)
            {
                return(RedirectToAction("Login", "Rio_Account", null));
            }

            var pageNumeber = page ?? 1;
            var pageData    = data.ToPagedList(pageNumeber, pageSize);
            ViewBag.vid    = ID;
            ViewBag.mode   = mode;
            ViewBag.isUser = isUser;
            #endregion

            return(View(pageData));
        }
コード例 #3
0
ファイル: Rio_PicController.cs プロジェクト: racedstar/R-S
 public ActionResult ReScaling()//重製縮圖
 {
     if (Session["UserID"] != null)
     {
         string ID = Session["UserID"].ToString();
         if (PicModel.getUserAllPicByID(ID) != null)
         {
             string Message = App_Code.ImageTools.ReScaling(PicModel.getUserAllPicByID(ID));
             Response.Write(App_Code.JS.Alert(Message));
         }
     }
     return(RedirectToAction("RioPicView", "Rio_Pic", new { m = "E" }));
 }