コード例 #1
0
        public ChildHistoryTabPage()
        {
            InitializeComponent();

            vm             = new AdminTransactionViewModel();
            BindingContext = vm;
        }
コード例 #2
0
 public TransactionsOne(AdminTransactionViewModel vm)
 {
     InitializeComponent();
     BindingContext = vm;
 }
コード例 #3
0
        public ActionResult SearchTransaction(string option, string searchString, string currentFilter, int?page, AdminTransactionViewModel admin)
        {
            if (searchString != null)
            {
                page = 1;
            }
            else
            {
                searchString = currentFilter;
            }
            ViewBag.CurrentFilter = searchString;

            List <AdminTransactionViewModel> model = new List <AdminTransactionViewModel>();

            model = new TransactionService().RetrieveTransactionList().Where(tra => tra.TransactionState == TransactionState.Delivered && tra.SpendComment == null && tra.SpentDate == null)
                    .OrderByDescending(tr => tr.EffectiveDate).ThenBy(tr => tr.TransactionId).Select(trans =>
                                                                                                     new AdminTransactionViewModel()
            {
                Recipient     = trans.Recipient.DisplayName,
                Sender        = trans.Sender.DisplayName,
                EffectiveDate = trans.EffectiveDate,
                IsAnonymous   = trans.IsAnonymous,
                Comment       = trans.Comment,
                TransactionId = trans.TransactionId,
                CoinNumber    = trans.GritCoin.CoinNumber,
                SenderId      = trans.Sender.EmployeeId,
                RecipientId   = trans.Recipient.EmployeeId,
                SpendNote     = trans.SpendComment,
                SpentDate     = trans.SpentDate
            }).ToList();



            if (admin.Option == 0 && searchString != null)
            {
                return(PartialView("~/Views/Admin/_SearchTransaction.cshtml", model.Where(x => x.CoinNumber.ToString() == searchString || searchString == null).ToPagedList(page ?? 1, 10)));
            }
            else if (admin.Option == 1 && searchString != null || searchString == currentFilter && searchString != null)
            {
                ViewBag.SearchString = searchString;

                return(PartialView("~/Views/Admin/_SearchTransaction.cshtml", model.Where(x => x.Recipient.ToLower().Contains(searchString.ToLower())).ToPagedList(page ?? 1, 10)));
            }

            else
            {
                ViewBag.SearchString = searchString;
                return(PartialView("~/Views/Admin/_SearchTransaction.cshtml", model.ToPagedList(page ?? 1, 10)));
            }
        }