Esempio n. 1
0
        public ActionResult SignTop(int pi = 1)
        {
            PublicUserModel loginUser = this.GetLoginUser();
            int             totalSize = 0;
            int             ps        = 10;

            pi = pi > 0 ? pi : 1;
            List <UserSignTop> topList = userBll.GetTodayUserSignTop(pi, ps, ref totalSize);

            ViewBag.PageCount = (totalSize / ps) + ((totalSize % ps) == 0 ? 0 : 1);
            ViewBag.PageIndex = pi;
            //右侧统计数据
            SignRightStat rightStat = userBll.GetSignRightStat(loginUser.UserID);

            ViewBag.RightStat = rightStat;
            ViewBag.UserName  = loginUser.Name;
            ViewBag.Portrait  = loginUser.Portrait;
            return(View(topList));
        }
Esempio n. 2
0
        public SignRightStat GetSignRightStat(int userId)
        {
            DbCommand cmd = GetStoredProcCommand("P_UserSignRightStat");

            AddInParameter(cmd, "@userId", DbType.Int32, userId);
            DataSet       ds       = ExecuteDataSet(cmd);
            SignRightStat signStat = new SignRightStat();

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                signStat = new SignRightStat()
                {
                    MySignCount        = To <int>(ds.Tables[0].Rows[0], "MySignCount"),
                    TodaySignCount     = To <int>(ds.Tables[0].Rows[0], "TodaySignCount"),
                    YesterdaySignCount = To <int>(ds.Tables[0].Rows[0], "YesterdaySignCount")
                };
            }
            return(signStat);
        }