// GET: Admin/Bank
        public ActionResult Index()
        {
            BankDao         db   = new BankDao();
            List <nganhang> list = db.List();
            nganhang        type = new nganhang();

            ViewData["list"] = list;
            return(View());
        }
Example #2
0
        public ActionResult Bank()
        {
            var userSession = (UserLogin)Session[CommonConstants.USER_SESSION];

            if (userSession != null)
            {
                var userId      = new UserDao().GetByUserName(userSession.UserName).ID;
                var listAccount = new BankDao().ListAccount(userId);
                return(View(listAccount));
            }
            return(View());
        }
 public ActionResult Destroy(int code)
 {
     try
     {
         var type = new BankDao().Destroy(code);
         if (TempData["ModelSuccess"] == null)
         {
             TempData.Add("ModelSuccess", "Xóa thành công.");
         }
         return(RedirectToAction("Index", "Bank"));
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
     }
     if (TempData["ModelErrors"] == null)
     {
         TempData.Add("ModelErrors", "Có lỗi xảy ra! Không thể xóa.");
     }
     return(RedirectToAction("Index", "Bank"));
 }
 public ActionResult Update(nganhang model)
 {
     try
     {
         var type = new BankDao().Update(model);
         if (TempData["ModelSuccess"] == null)
         {
             TempData.Add("ModelSuccess", "Cập nhật thành công.");
         }
         return(RedirectToAction("Index", "Bank"));
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
     }
     if (TempData["ModelErrors"] == null)
     {
         TempData.Add("ModelErrors", "Có lỗi xảy ra! Không thể cập nhật.");
     }
     return(RedirectToAction("Index", "Bank"));
 }
 public ActionResult Store(nganhang model)
 {
     try
     {
         BankDao db = new BankDao();
         db.Insert(model);
         if (TempData["ModelSuccess"] == null)
         {
             TempData.Add("ModelSuccess", "Thêm thành công.");
         }
         return(RedirectToAction("Index", "Bank"));
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
     }
     if (TempData["ModelErrors"] == null)
     {
         TempData.Add("ModelErrors", "Có lỗi xảy ra! Không thể thêm.");
     }
     return(RedirectToAction("Index", "Bank"));
 }
Example #6
0
        public ActionResult UpdateBank(UserBank userBank)
        {
            var tai_khoan = new BankDao().Update(userBank);

            return(Redirect("/tai-khoan-ngan-hang"));
        }
Example #7
0
        public ActionResult AddUserBank(UserBank userBank)
        {
            var tai_khoan = new BankDao().Insert(userBank);

            return(Redirect("/tai-khoan-ngan-hang"));
        }
 public BankManagerImpl(BankManager bankManager)
 {
     this.bankManager = bankManager;
     dao = BankDao.getInstance();
 }
 public BankManagerImpl(AddBank addBank)
 {
     this.addBank = addBank;
     dao          = BankDao.getInstance();
 }
 public BankManagerImpl()
 {
     dao = BankDao.getInstance();
 }
        public ActionResult Edit(int code)
        {
            var type = new BankDao().GetByID(code);

            return(View(type));
        }