예제 #1
0
        /// <summary>
        /// ActionLog 首页
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="keyWord"></param>
        /// <returns></returns>
        public ActionResult Index(int pageIndex = 1, int pageSize = 20, string keyWord = "", int userId = 0)
        {
            int    totalSize           = 0;
            string userName            = string.Empty;
            ActionLogTopStatReq parame = new ActionLogTopStatReq()
            {
                keyword = keyWord,
                pi      = pageIndex,
                ps      = pageSize,
                userId  = userId
            };

            if (userId > 0)
            {
                PublicUserModel user = userBll.GetUserById(userId);
                if (user.IsNoNull())
                {
                    userName = user.Name;
                }
            }
            List <ControllerActionMapModel> stateList = actionLogBll.ActionLogTopStat(parame, ref totalSize);

            ViewBag.Count     = totalSize;
            ViewBag.PageIndex = pageIndex;
            ViewBag.PageSize  = pageSize;
            ViewBag.KeyWord   = keyWord;
            ViewBag.UserId    = userId;
            ViewBag.UserName  = userName;
            ViewBag.PageTotal = (int)Math.Ceiling((double)ViewBag.Count / pageSize);
            return(View(stateList));
        }
예제 #2
0
        public List <ControllerActionMapModel> ActionLogTopStat(ActionLogTopStatReq parame, ref int totalSize)
        {
            DbCommand cmd = GetStoredProcCommand("P_ActionLog_StateList");

            AddInParameter(cmd, "@pi", DbType.Int32, parame.pi);
            AddInParameter(cmd, "@ps", DbType.Int32, parame.ps);
            AddInParameter(cmd, "@userId", DbType.Int32, parame.userId);
            AddInParameter(cmd, "@keyword", DbType.String, parame.keyword);
            AddOutParameter(cmd, "@totalSize", DbType.Int32, 4);
            DataSet ds = ExecuteDataSet(cmd);

            int.TryParse(cmd.Parameters["@totalSize"].Value.ToString(), out totalSize);
            List <ControllerActionMapModel> topList = new List <ControllerActionMapModel>();

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                topList = BuildToModelList(ds.Tables[0].Select());
            }
            return(topList);
        }
예제 #3
0
 public List <ControllerActionMapModel> ActionLogTopStat(ActionLogTopStatReq parame, ref int totalSize)
 {
     return(actionLogDal.ActionLogTopStat(parame, ref totalSize));
 }