Пример #1
0
        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);
        }