コード例 #1
0
ファイル: BankerController.cs プロジェクト: IBIBank/IBITest
        //
        // GET: /Banker/
        public ActionResult DashBoard()
        {
            string result = (new CommonDAL()).CheckValidation("Banker", this.Session);

            if(result.Equals("LogIn"))
                return RedirectToAction("Login", "CommonBiz");
            else if(result.Equals("Unauthorised"))
                return RedirectToAction("Unauthorised", "CommonBiz");

            BankerDAL bd = new BankerDAL();
            long branchCode;

            if (Session["User"] == null)
                return RedirectToAction("Login", "CommonBiz");
            else
                ViewBag.user = (Session["User"] as UserRole).userID;

            branchCode = (Session["User"] as UserRole).branchCode;

            ViewBag.acctrf = bd.GetNoOfBranchTransferRequests(branchCode);
            ViewBag.loan = bd.GetNoOfLoanRequests(branchCode);
            ViewBag.newacc = bd.GetNoOfNewAccountRequests(branchCode);
            ViewBag.accclo = bd.GetNoOfClosureRequests(branchCode);

            BranchDetailsViewModel bm = bd.GetSelfBranchDetails(ViewBag.user);

            ViewBag.selfbranchname = bm.BranchName;
            ViewBag.selfbranchAdddress = bm.Address;
            ViewBag.selfbranchnameCity = bm.CityName;
            ViewBag.selfbranchnameContactNo = bm.ContactNumber;
            ViewBag.selfbranchMailId = bm.Email;

            return View();
        }
コード例 #2
0
ファイル: BankerController.cs プロジェクト: IBIBank/IBITest
        public ActionResult ApproveRequest(string val)
        {
            int requestID;
            BankerDAL bankerDALObj = new BankerDAL();

            if (val[0] == 'N')
            {
                requestID = Convert.ToInt16(val.Substring(3));

                return Json(bankerDALObj.ApproveNewAccountCreationRequest(requestID));
            }
            else
            {
                requestID = Convert.ToInt16(val.Substring(3));

                return Json(bankerDALObj.ApproveLoanRequest(requestID));
            }
        }
コード例 #3
0
ファイル: BankerController.cs プロジェクト: IBIBank/IBITest
        public ActionResult TransferRequest(string val)
        {
            /*
            string result = (new CommonDAL()).CheckValidation("Banker", this.Session);

            if (result.Equals("LogIn"))
                return RedirectToAction("Login", "CommonBiz");
            else if (result.Equals("Unauthorised"))
                return RedirectToAction("Unauthorised", "CommonBiz");
            */

            int requestID;
            BankerDAL bankerDALObj = new BankerDAL();

            if (val[0] == 'T')
            {
                requestID = Convert.ToInt16(val.Substring(3));

                return Json(bankerDALObj.TransferTransferOfAccountRequest(requestID));
            }
            else
            {
                requestID = Convert.ToInt16(val.Substring(3).ToString());

                return Json(bankerDALObj.TransferClosingOfAccountRequest(requestID));
            }
        }
コード例 #4
0
ファイル: BankerController.cs プロジェクト: IBIBank/IBITest
        public string SetBalance(int accountNumber, decimal amount, char accountType, char CreditOrDebit, string remarks)
        {
            BankerDAL objBankerDAL = new BankerDAL();
            if (accountType == 'S')
            {
                if (CreditOrDebit == 'C')//credit
                {
                    objBankerDAL.CreditSavingsAccountByBanker(accountNumber,amount,remarks);
                    return "Credit Successful";
                }
                else//debit
                {
                    if (amount <= objBankerDAL.GetAccountBalance(accountNumber))
                    {
                        objBankerDAL.DebitSavingsAccountByBanker(accountNumber, amount, remarks);
                        return "Debit successful";
                    }
                    else
                    {
                        return "Amount exceeds available balance";
                    }
                }
            }
            else
            {

                decimal loanBalance = objBankerDAL.GetAccountBalance(accountNumber);
                if (amount == loanBalance)
                {
                    objBankerDAL.CreditLoanAccountByBanker(accountNumber, amount, remarks);
                    objBankerDAL.CloseLoanAccount(accountNumber);
                    return "Credit Successful and Closed account";
                }
                else if (amount > loanBalance)
                {
                    return "Amount exceeds available balance";
                }
                else
                {
                    objBankerDAL.CreditLoanAccountByBanker(accountNumber, amount, remarks);
                    return "Credit Successful";
                }
            }
        }
コード例 #5
0
ファイル: BankerController.cs プロジェクト: IBIBank/IBITest
        public ActionResult Requests()
        {
            string result = (new CommonDAL()).CheckValidation("Banker", this.Session);

            if (result.Equals("LogIn"))
                return RedirectToAction("Login", "CommonBiz");
            else if (result.Equals("Unauthorised"))
                return RedirectToAction("Unauthorised", "CommonBiz");

            BankerDAL obj = new BankerDAL();
            List<RequestViewModel> mdL = new List<RequestViewModel>();
            long branchCode;

            if (Session["User"] == null)
                return RedirectToAction("Login", "CommonBiz");
            else
                ViewBag.user = (Session["User"] as UserRole).userID;

            branchCode = (Session["User"] as UserRole).branchCode;

            mdL = obj.GetAllRequests(branchCode);

            Session["AllRequests"] = mdL;

            return View(mdL);
        }
コード例 #6
0
ファイル: BankerController.cs プロジェクト: IBIBank/IBITest
        public ActionResult RejectRequest(string val)
        {
            int requestID;
            BankerDAL bankerDALObj = new BankerDAL();

            if (val[0] == 'N')
            {
                requestID = Convert.ToInt16(val.Substring(3));

                return Json(bankerDALObj.RejectNewAccountCreationRequest(requestID));
            }
            else if(val[0] == 'A')
            {
                requestID = Convert.ToInt16(val.Substring(3));

                return Json(bankerDALObj.RejectLoanRequest(requestID));
            }
            else if (val[0] == 'T')
            {
                requestID = Convert.ToInt16(val.Substring(3));

                return Json(bankerDALObj.RejectTransferOfAccountRequest(requestID));
            }
            else
            {
                requestID = Convert.ToInt16(val.Substring(3));

                return Json(bankerDALObj.RejectClosingOfAccountRequest(requestID));
            }
        }
コード例 #7
0
ファイル: BankerController.cs プロジェクト: IBIBank/IBITest
        public ActionResult GetRequestsByType(int typeid)
        {
            BankerDAL obj = new BankerDAL();
            List<RequestViewModel> requestListTemp = new List<RequestViewModel>();
            List<RequestViewModel> requestList = new List<RequestViewModel>();

            long branchCode; ;

            if (Session["User"] == null)
                return RedirectToAction("Login", "CommonBiz");
            else
                branchCode = (Session["User"] as UserRole).branchCode;

            switch (typeid)
            {
                case 1:
                    requestListTemp = obj.GetNewAccountRequests(branchCode);

                    if (requestListTemp != null)
                        foreach (var v in requestListTemp)
                            if (v.Status == 'S')
                                requestList.Add(v);

                    break;

                case 2:
                    requestListTemp = obj.GetLoanRequests(branchCode);

                    if (requestListTemp != null)
                        foreach (var v in requestListTemp)
                            if (v.Status == 'S')
                                requestList.Add(v);

                    break;

                case 3:
                    requestListTemp = obj.GetBranchTransferRequests(branchCode);

                    if (requestListTemp != null)
                        foreach (var v in requestListTemp)
                            if (v.Status == 'S')
                                requestList.Add(v);

                    break;

                case 4:
                    requestListTemp = obj.GetClosingRequests(branchCode);

                    if(requestListTemp != null)
                        foreach (var v in requestListTemp)
                            if (v.Status == 'S')
                                requestList.Add(v);

                    break;
            }
            return Json(requestList);
        }
コード例 #8
0
ファイル: BankerController.cs プロジェクト: IBIBank/IBITest
        public ActionResult GetBase64Image(string val)
        {
            int requestID;
            BankerDAL bankerDALObj = new BankerDAL();

            if (val[0] == 'N')
            {
                requestID = Convert.ToInt16(val.Substring(3));

                string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Images\\NewAccountCreation") + "\\" +  "NAC" + requestID.ToString()  +".jpg";

                FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read);
                byte[] data = new byte[(int)fileStream.Length];
                fileStream.Read(data, 0, data.Length);

                return Json(new { base64imgage = Convert.ToBase64String(data) }, JsonRequestBehavior.AllowGet);

            }
            else
            {
                requestID = Convert.ToInt16(val.Substring(3));

                string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Images\\ApplyForLoan") + "\\" + "AFL_SP_" + requestID.ToString() + ".jpg";

                FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read);
                byte[] data = new byte[(int)fileStream.Length];
                fileStream.Read(data, 0, data.Length);

                return Json(new { base64imgage = Convert.ToBase64String(data) }, JsonRequestBehavior.AllowGet);

            }
        }
コード例 #9
0
ファイル: BankerController.cs プロジェクト: IBIBank/IBITest
        public ActionResult GetProofImage(string val)
        {
            int requestID;
            BankerDAL bankerDALObj = new BankerDAL();

            if (val[0] == 'N')
            {
                requestID = Convert.ToInt16(val.Substring(3));
                byte[] image = bankerDALObj.GetProofImageByNewAccountRequestID(requestID);

                return Json(new { base64imgage = Convert.ToBase64String(image) }, JsonRequestBehavior.AllowGet);
            }
            else
            {
                requestID = Convert.ToInt16(val.Substring(3));
                Byte[] image = bankerDALObj.GetProofImageByNewAccountRequestID(requestID);

                return Json(new { base64imgage = Convert.ToBase64String(image) });
            }
        }
コード例 #10
0
ファイル: BankerController.cs プロジェクト: IBIBank/IBITest
 public JsonResult GetCustomerWithLockedUserID()
 {
     BankerDAL objBankerDal = new BankerDAL();
     long branchCode = (Session["User"] as UserRole).branchCode;
     return Json(objBankerDal.GetLockedCustomers());
 }
コード例 #11
0
ファイル: BankerController.cs プロジェクト: IBIBank/IBITest
 public JsonResult GetCustomersWithLoan()
 {
     BankerDAL objBankerDal = new BankerDAL();
     long branchCode = (Session["User"] as UserRole).branchCode;
     return Json(objBankerDal.GetCustomersHavingLoan(branchCode));
 }
コード例 #12
0
ファイル: BankerController.cs プロジェクト: IBIBank/IBITest
 public JsonResult GetCustomersByName(string queryName)
 {
     BankerDAL objBankerDal = new BankerDAL();
     long branchCode = (Session["User"] as UserRole).branchCode;
     return Json(objBankerDal.GetCustomerByName(queryName,branchCode));
 }
コード例 #13
0
ファイル: BankerController.cs プロジェクト: IBIBank/IBITest
 public JsonResult GetCustomerByAccountNo(int accountNo)
 {
     BankerDAL objBankerDal = new BankerDAL();
     long branchCode = (Session["User"] as UserRole).branchCode;
     return Json(objBankerDal.GetCustomerByAccountNumber(accountNo, branchCode));
 }
コード例 #14
0
ファイル: BankerController.cs プロジェクト: IBIBank/IBITest
        public ActionResult GenerateToken(GenerateTokenViewModel model)
        {
            if (!ModelState.IsValid)
                return View(model);

            BankerDAL obj = new BankerDAL();
            TokenInfo tf = new TokenInfo();

            tf = obj.GenerateToken(model);

            ViewBag.CustomerID = String.Format("Customer ID : {0}", tf.CustomerID);
            ViewBag.token = String.Format("Token : {0}", tf.Token);

            ModelState.Clear();
            return View(new GenerateTokenViewModel());
        }
コード例 #15
0
ファイル: BankerController.cs プロジェクト: IBIBank/IBITest
        public ActionResult GetRequestsByStatus(int typeid)
        {
            BankerDAL obj = new BankerDAL();
            List<RequestViewModel> md = new List<RequestViewModel>();
            List<RequestViewModel> mdSorted = new List<RequestViewModel>();

            long branchCode; ;

            if (Session["User"] == null)
                return RedirectToAction("Login", "CommonBiz");
            else
                branchCode = (Session["User"] as UserRole).branchCode;

            md = (Session["AllRequests"] as List<RequestViewModel>);

            if(md != null)
                switch (typeid)
                {
                    case 1:
                        return Json(md);

                    case 2:
                        foreach (var v in md)
                        {
                            if (v.Status == 'S')
                                mdSorted.Add(v);
                        }

                        break;

                    case 3:

                        foreach (var v in md)
                        {
                            if (v.Status == 'A')
                                mdSorted.Add(v);
                        }
                        break;

                    case 4:
                        foreach (var v in md)
                        {
                            if (v.Status == 'R')
                                mdSorted.Add(v);
                        }
                        break;

                    case 5:
                        foreach (var v in md)
                        {
                            if (v.Status == 'T')
                                mdSorted.Add(v);
                        }
                        break;

                }

            return Json(mdSorted);
        }
コード例 #16
0
ファイル: CustomerController.cs プロジェクト: IBIBank/IBITest
 public ActionResult TransferFunds(FundTransferViewModel model)
 {
     long customerID = (Session["User"] as UserRole).customerID;
     BankerDAL objBDAL = new BankerDAL();
     CustomerDAL objCDAL = new CustomerDAL();
     ViewBag.savingsAccountList = objCDAL.GetAllSavingsAccountByCustomerID(customerID);
     ViewBag.payeeAccounts = objCDAL.GetAllPayeeAccountByCustomerID(customerID);
     string message="";
     if (model.Amount <= 0)
     {
         //ModelState.AddModelError("", "Source and Dest cant be same");
         message =  "Amount must be positive";
         @ViewBag.message = message;
         return View(model);
     }
     if (model.FromAccount == model.ToAccount)
     {
         //ModelState.AddModelError("", "Source and Dest cant be same");
         message =  "Source and Destination account can't be same";
         @ViewBag.message = message;
         return View(model);
     }
     if (model.Amount > objBDAL.GetAccountBalance(model.FromAccount))
     {
         message =  "Insufficient funds. Please check balance";
         @ViewBag.message = message;
         return View(model);
     }
     if (objCDAL.ValidateTransactionPassword(customerID, model.TransactionPassword) == false)
     {
         message =  "Password is not valid";
         @ViewBag.message = message;
         return View(model);
     }
     if (objBDAL.GetAccountType(model.ToAccount) == 'L')
     {
         if (model.Amount > objBDAL.GetAccountBalance(model.ToAccount))
         {
             message =  "Invalid transaction";
             @ViewBag.message = message;
             return View(model);
         }
     }
     objCDAL.DoFundTransfer(model);
     message =  "Transaction Successful";
     @ViewBag.message = message;
     return View(model);
 }
コード例 #17
0
ファイル: BankerController.cs プロジェクト: IBIBank/IBITest
 public char GetAccountType(int accountNumber)
 {
     BankerDAL objBankerDal = new BankerDAL();
     char accountType = objBankerDal.GetAccountType(accountNumber);
     ViewBag.accountType = accountType;
     return accountType;
 }