예제 #1
0
        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
        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
        public ActionResult SelectCover()
        {
            string UserID = string.Empty;

            if (Session["UserID"] != null)
            {
                UserID = Session["UserID"].ToString();
            }
            ViewBag.Pic = PicModel.getUserPicEnableByID(UserID);

            return(View());
        }
예제 #4
0
        public ActionResult Index()
        {
            int    SN     = 0;
            string userID = string.Empty;

            if (Request.QueryString.Get("vid") != null)
            {
                userID = Request.QueryString.Get("vid").ToString();
            }
            Vw_Account rioAccount = AccountModel.getVwAccountByID(userID);

            if (rioAccount != null)
            {
                int.TryParse(rioAccount.SN.ToString(), out SN);

                //使用者設定
                ViewBag.userSetting       = UserIndexSettingMode.getVwUserIndexSettingBySN(SN);
                ViewBag.indexAccountCover = rioAccount.PicPath + rioAccount.PicName;

                //系統相簿、圖片、文件總數
                ViewBag.albumCount = AlbumModel.getUsertVwAlbumEnableListByID(userID).Where(o => o.IsEnable == true).Count();
                ViewBag.picCount   = PicModel.getUserPicEnableByID(userID).Count();
                ViewBag.docCount   = DocModel.getUserDocEnableListByID(userID).Count();

                //系統預覽
                ViewBag.preViewAlbum = AlbumModel.getPreViewAlbumListByID(userID);
                ViewBag.preViewPic   = PicModel.getPreViewPicListByID(userID);
                ViewBag.preViewDoc   = DocModel.getPreviewDocListByID(userID);

                if (Session["UserSN"] != null)
                {
                    int userSN = 0;
                    int.TryParse(Session["UserSN"].ToString(), out userSN);

                    //是否Track
                    ViewBag.userTrack = UserTrackModel.getUserTrackBySN(userSN, SN);

                    //未閱讀通知數量
                    Session["notReadNoticeCount"] = NoticeModel.getNotReadNoticeCountByTrackSN(userSN);
                }
            }
            return(View());
        }