public ActionResult userTrack(string id)
        {
            int clientSN = 0;
            int userSN   = 0;

            int.TryParse(AccountModel.getAccountByID(id).SN.ToString(), out clientSN);
            int.TryParse(Session["UserSN"].ToString(), out userSN);

            Vw_UserTrack vw_track = UserTrackModel.getUserTrackBySN(userSN, clientSN);

            if (vw_track != null)
            {
                //delete
                UserTrackModel.Delete(vw_track.trackSN);
                return(Content("false"));
            }
            else
            {
                //insert
                Rio_UserTrack track = new Rio_UserTrack();
                track.AccountSN      = userSN;
                track.TrackAccountSN = clientSN;

                UserTrackModel.Insert(track);
                return(Content("true"));
            }
        }
Exemple #2
0
        private void setDBNotice(int userSN, string upLoadType, string sumCount)
        {
            List <Vw_UserTrack> userTrackList = UserTrackModel.getTrackerListBySN(userSN);
            string type = string.Empty;

            switch (upLoadType)
            {
            case "img":
                type = " 張圖片";
                break;

            case "Doc":
                type = " 件文件";
                break;

            case "Compression":
                type = "個壓縮檔";
                break;
            }

            foreach (var item in userTrackList)
            {
                Rio_Notice notice = new Rio_Notice();
                notice.AccountSN     = userSN;
                notice.TrackSN       = item.AccountSN;
                notice.NoticeContent = "已上傳 " + sumCount + type;
                notice.CreateDate    = DateTime.Now;

                NoticeModel.Insert(notice);
            }
        }
        public ActionResult userTrack(int?page)
        {
            if (Session["UserSN"] != null)
            {
                int SN = 0;
                int.TryParse(Session["UserSN"].ToString(), out SN);
                var data = UserTrackModel.getUserTrackListBySN(SN);

                var pageNumeber = page ?? 1;
                var pageData    = data.ToPagedList(pageNumeber, pageSize);
                ViewBag.userTrackList = pageData;
                return(View(pageData));
            }
            return(View());
        }
Exemple #4
0
        private void setDBNotice(int userSN, string userID, string albumTitle, string action)
        {
            List <Vw_UserTrack> userTrackList = UserTrackModel.getTrackerListBySN(userSN);

            foreach (var item in userTrackList)
            {
                Rio_Notice notice = new Rio_Notice();
                notice.AccountSN     = userSN;
                notice.TrackSN       = item.AccountSN;
                notice.NoticeContent = "已" + action + albumTitle + "相簿";
                notice.CreateDate    = DateTime.Now;

                NoticeModel.Insert(notice);
            }
        }
Exemple #5
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());
        }