Exemple #1
0
        public ActionResult Simulator(CustomerBankList user)
        {
            BankEntities usersEntities = new BankEntities();
            int?         userId        = usersEntities.VALIDATE_USER(user.Name.card_no.ToString(), user.Name.card_pin.ToString()).FirstOrDefault();
            string       card_number   = user.Name.card_no;
            int          branch        = (int)user.Bnk.b_branch_id;
            string       message       = string.Empty;

            switch (userId.Value)
            {
            case -1:
            {
                message       = "Card Number or PIN is incorrect";
                user.BankList = db.Banks.ToList();
                break;
            }

            case 0:

                FormsAuthentication.SetAuthCookie(user.Name.card_no, user.RememberMe);
                return(RedirectToAction("Welcome", "Simulator", new { card_no = user.Name.card_no, branch1 = user.Bnk.b_branch_id }));
            }
            ViewBag.Message = message;
            return(View(user));
        }