Exemplo n.º 1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string UserID = string.Empty;

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

            if (context.Request.QueryString["s"] != null && context.Request.QueryString["t"] != null)
            {
                int    SN    = 0;
                int    picSN = 0;
                string type  = string.Empty;
                SN   = AccountModel.getAccountByID(UserID).SN;
                type = context.Request.QueryString["t"].ToString();
                int.TryParse(context.Request.QueryString["s"], out picSN);

                if (type.Equals("Account"))
                {
                    Rio_Account Account = AccountModel.getAccountByID(UserID);
                    Account.PicSN = picSN;
                    AccountModel.Update(Account);
                }
                else if (type.Equals("Index"))
                {
                    Rio_UserIndexSetting userSetting = UserIndexSettingMode.getUserIndexSettingBySN(SN);
                    userSetting.CoverSN = picSN;
                    UserIndexSettingMode.Update(userSetting);
                }
            }
        }
Exemplo n.º 2
0
        //[ValidateAntiForgeryToken]
        #region 使用者自行設定個人資料
        public ActionResult UserSetting()
        {
            if (Session["UserID"] != null)
            {
                string UserID           = string.Empty;
                string accountCoverPath = string.Empty;
                string indexCoverPath   = string.Empty;

                UserID = Session["UserID"].ToString();
                #region  人資料設定
                Vw_Account Account = AccountModel.getVwAccountByID(UserID);
                Account.Password = string.Empty;

                if (Account.CoverSN == 0)
                {
                    accountCoverPath = "../Content/img/icon/questionMark.png";
                }
                else
                {
                    accountCoverPath = Account.PicPath + "/Scaling/" + @Account.PicName;
                }

                ViewBag.accountCoverPath = accountCoverPath;
                ViewBag.Account          = Account;
                #endregion

                #region 首頁資料設定
                int SN = AccountModel.getAccountByID(UserID).SN;
                if (UserIndexSettingMode.getUserIndexSettingBySN(SN) == null)
                {
                    Rio_UserIndexSetting userSetting = new Rio_UserIndexSetting();
                    userSetting.AccountSN = SN;
                    userSetting.Title     = UserID;
                    userSetting.SubTitle  = "Index";
                    userSetting.CoverSN   = 0;

                    UserIndexSettingMode.Insert(userSetting);
                }
                Vw_UserIndexSetting indexSetting = UserIndexSettingMode.getVwUserIndexSettingBySN(SN);

                if (indexSetting.CoverSN == 0)
                {
                    indexCoverPath = "../Content/img/Froncover/indexcover.png";
                }
                else
                {
                    indexCoverPath = indexSetting.CoverPicPath + "/" + indexSetting.CoverName;
                }

                ViewBag.indexCoverPath = indexCoverPath;
                ViewBag.IndexSetting   = indexSetting;
                #endregion
                return(View());
            }

            return(RedirectToAction("Login"));
        }
Exemplo n.º 3
0
        //[ValidateAntiForgeryToken]
        public ActionResult IndexSetting(string Title, string SubTitle)
        {
            string UserID = string.Empty;

            if (Session["UserID"] != null)
            {
                UserID = Session["UserID"].ToString();
            }
            int SN = AccountModel.getAccountByID(UserID).SN;
            Rio_UserIndexSetting userSetting = UserIndexSettingMode.getUserIndexSettingBySN(SN);

            userSetting.Title    = Title;
            userSetting.SubTitle = SubTitle;
            UserIndexSettingMode.Update(userSetting);

            return(RedirectToAction("UserSetting"));
        }
Exemplo n.º 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());
        }
Exemplo n.º 5
0
        public ActionResult SelectCover(string type, int SN)
        {
            int accountSN = 0;

            int.TryParse(Session["UserSN"].ToString(), out accountSN);
            string userID = Session["UserID"].ToString() ?? string.Empty;

            if (type.Equals("Account"))
            {
                Rio_Account Account = AccountModel.getAccountByID(userID);
                Account.PicSN = SN;
                AccountModel.Update(Account);
            }
            else if (type.Equals("Index"))
            {
                Rio_UserIndexSetting userSetting = UserIndexSettingMode.getUserIndexSettingBySN(accountSN);
                userSetting.CoverSN = SN;
                UserIndexSettingMode.Update(userSetting);
            }
            return(Content("Save Success"));
        }