Exemple #1
0
        public ActionResult FilteredList(string DropDownListAccounts, string InitialDate, string EndDate, string Movement, string InitialAmount, string EndAmount)
        {
            ViewBag.Transactions = TransactionsSearchedBL.GetAllMovements(DropDownListAccounts, InitialDate, EndDate, Movement, InitialAmount, EndAmount);
            SentencesBL obj = new SentencesBL();

            ViewBag.Account  = Convert.ToInt32(DropDownListAccounts);
            ViewBag.Movement = Movement;
            return(View());
        }
Exemple #2
0
        // GET: TransactionsSearched
        public ActionResult Searcher()
        {
            if (Session["User"] != null)
            {
                List <BankAccount> lst = TransactionsSearchedBL.Searcher(Session["DNI"].ToString());
                TempData["Accounts"] = lst.ConvertAll(ac =>
                {
                    return(new SelectListItem
                    {
                        Text = ac.Code,
                        Value = ac.Id.ToString()
                    });
                });
            }

            return(View());
        }
Exemple #3
0
        public ActionResult Searcher(string DropDownListAccounts, string InitialDate, string EndDate, string Movement, string InitialAmount, string EndAmount)
        {
            List <BankAccount> lst = TransactionsSearchedBL.Searcher(Session["DNI"].ToString());

            TempData["Accounts"] = lst.ConvertAll(ac =>
            {
                return(new SelectListItem()
                {
                    Text = ac.Code,
                    Value = ac.Id.ToString()
                });
            });

            try
            {
                if (DropDownListAccounts != "")
                {
                    return(RedirectToAction("FilteredList", new RouteValueDictionary(new
                    {
                        Controller = "TransactionsSearched",
                        Action = "FilteredList",
                        DropDownListAccounts = DropDownListAccounts,
                        InitialDate = InitialDate,
                        EndDate = EndDate,
                        Movement = Movement,
                        InitialAmount = InitialAmount,
                        EndAmount = EndAmount
                    })));
                }
                else
                {
                    throw new Exception("Debe elegir una cuenta");
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                return(View());
            }
        }