Esempio n. 1
0
        public PartialViewResult IndexPtv(int?kind, string reciever, int?userId, string userName, float?totalFrom, float?totalTo, DateTime?fromDate, DateTime?toDate, int?currentPageIndex)
        {
            if (string.IsNullOrEmpty(userName))
            {
                userName = string.Empty;
                userId   = 0;
            }
            var          ctx      = new SmsContext();
            var          expenses = ctx.SP_GET_EXPENSES(Convert.ToInt32(kind), reciever, userId, userName, totalFrom, totalTo, fromDate, toDate).Take(SystemConstant.MAX_ROWS).ToList <SP_GET_EXPENSES_Result>();
            ExpenesModel model    = new ExpenesModel();

            model.Count = expenses.Count;
            int pageSize  = SystemConstant.ROWS;
            int pageIndex = currentPageIndex == null ? 1 : (int)currentPageIndex;

            model.ResultList  = expenses.ToPagedList(pageIndex, pageSize);
            ViewBag.Kind      = kind;
            ViewBag.Reciever  = reciever;
            ViewBag.UserId    = userId;
            ViewBag.UserName  = userName;
            ViewBag.TotalFrom = totalFrom;
            ViewBag.ToTalTo   = totalTo;
            ViewBag.FromDate  = fromDate;
            ViewBag.ToDate    = toDate;
            ctx.Dispose();
            return(PartialView("IndexPtv", model));
        }
Esempio n. 2
0
        public ActionResult Index(string message, string inforMessage)
        {
            ExpenesModel model = new ExpenesModel();

            ViewBag.Message      = message;
            ViewBag.InForMessage = inforMessage;
            model.Kind           = 0;
            return(View(model));
        }