コード例 #1
0
        public ActionResult EditLoanEntry(int Id)
        {
            Session["LoanEntryId"] = Id;
            bool blnIsAgent = false;
            NewLoanEntryDTO objNewLoanEntryDTO = new NewLoanEntryDTO();
            NewLoanEntry objNewLoanEntry = _NewLoanService.getLoanDetail(Id);
            objNewLoanEntryDTO = Mapper.Map<Data.NewLoanEntry, NewLoanEntryDTO>(objNewLoanEntry);
            var productType = _registration.getProductTypes();
            var loanType = _registration.getLoanType();
            if (Convert.ToInt32(SessionHelper.GetStringValue("UserRole")) == 4)
            {
                blnIsAgent = true;
                var lstUserCompanyDetail = _MyProfileService.getCustomerCompany(Convert.ToInt32(objNewLoanEntry.LoanOwner));
                objNewLoanEntryDTO.lstCompanyDetail = SMEHelper.GetDropDownList<UserCompanyDetail>(lstUserCompanyDetail, "CompanyName", "Id", "", "--Select--");

                var lstCust = _MyProfileService.getAgentCustomers(Convert.ToInt32(SessionHelper.GetStringValue("UserId")));
                objNewLoanEntryDTO.lstCustDetail = SMEHelper.GetDropDownList<AgentCustomerDetail>(lstCust, "AgentCustomerName", "Id", "", "--Select--");
            }
            else
            {
                var lstUserCompanyDetail = _MyProfileService.getUserCompany(Convert.ToInt32(SessionHelper.GetStringValue("UserId")), blnIsAgent);
                objNewLoanEntryDTO.lstCompanyDetail = SMEHelper.GetDropDownList<UserCompanyDetail>(lstUserCompanyDetail, "CompanyName", "Id", "", "--Select--");

                var lstCust = _MyProfileService.getAgentCustomers(Convert.ToInt32(0));
                objNewLoanEntryDTO.lstCustDetail = SMEHelper.GetDropDownList<AgentCustomerDetail>(lstCust, "AgentCustomerName", "Id", "", "--Select--");
            }
               // var lstUserCompanyDetail = _MyProfileService.getUserCompany(Convert.ToInt32(SessionHelper.GetStringValue("UserId")), blnIsAgent);
               // objNewLoanEntryDTO.lstCompanyDetail = SMEHelper.GetDropDownList<UserCompanyDetail>(lstUserCompanyDetail, "CompanyName", "Id", "", "--Select--");
            objNewLoanEntryDTO.lstProductType = SMEHelper.GetDropDownList<ProductType>(productType, "ProductTypeName", "Id", "", "--Select--");
            objNewLoanEntryDTO.lstLoanType = SMEHelper.GetDropDownList<LoanType>(loanType, "LoanTypeName", "Id", "", "--Select--");
            return View("NewLoanEntry", objNewLoanEntryDTO);
        }
コード例 #2
0
        private NewLoanEntryDTO LoadNewLoanEntry(NewLoanEntryDTO objNewLoanEntryDTO)
        {
            ModelState.AddModelError(string.Empty, "Error while saving Loan entry.");
            var productType = _registration.getProductTypes();
            var loanType = _registration.getLoanType();

            objNewLoanEntryDTO.lstProductType = SMEHelper.GetDropDownList<ProductType>(productType, "ProductTypeName", "Id", Convert.ToString(objNewLoanEntryDTO.ProductTypeId), "--Select--");
            objNewLoanEntryDTO.lstLoanType = SMEHelper.GetDropDownList<LoanType>(loanType, "LoanTypeName", "Id", Convert.ToString(objNewLoanEntryDTO.LoanTypeId), "--Select--");
            return objNewLoanEntryDTO;
        }
コード例 #3
0
        // GET: Dashboard
        public ActionResult SaveLoan(NewLoanEntryDTO objNewLoanEntryDTO)
        {
            if (ModelState.IsValid)
            {
                if (Convert.ToString(Session["UserRole"]) == "3")
                {
                    objNewLoanEntryDTO.LoanOwner = Convert.ToInt32(Session["UserId"]);
                }
               NewLoanEntry objNewLoanEntry = new Data.NewLoanEntry();
               objNewLoanEntry = Mapper.Map<NewLoanEntryDTO,Data.NewLoanEntry>(objNewLoanEntryDTO);
               objNewLoanEntry.CreatedBy = Convert.ToInt32(SessionHelper.GetStringValue("UserId"));
               if (objNewLoanEntryDTO.Id > 0)
               {
                   objNewLoanEntry.ModifiedBy =Convert.ToInt32(SessionHelper.GetStringValue("UserId"));
                  if(_NewLoanService.updateLoanentry(objNewLoanEntry))
                  {
                      if (objNewLoanEntryDTO.IsSaveNContinue== 0)
                      {
                          return RedirectToAction("index");
                      }
                      else
                      {
                          Session["LoanEntryId"] = objNewLoanEntry.Id;
                          return RedirectToAction("TaxHeadEntry");
                      }

                  }
                  else
                  {
                     objNewLoanEntryDTO= LoadNewLoanEntry(objNewLoanEntryDTO);
                      return View("NewLoanEntry", objNewLoanEntryDTO);
                  }
               }
               else if( _NewLoanService.saveNewLoanentry(objNewLoanEntry))
              {
                  Session["LoanEntryId"] = objNewLoanEntry.Id;
                  if (objNewLoanEntryDTO.IsSaveNContinue == 0)
                  {
                      return RedirectToAction("index");
                  }
                  else
                  {
                      return RedirectToAction("TaxHeadEntry");
                  }
              }
              else
              {
                objNewLoanEntryDTO=LoadNewLoanEntry(objNewLoanEntryDTO);
                  return View("NewLoanEntry", objNewLoanEntryDTO);
              }
            }
            else
            {
                return RedirectToAction("NewLoanEntry");
            }
        }
コード例 #4
0
        // GET: Dashboard
        public ActionResult NewLoanEntry()
        {
            bool blnIsAgent = false;
            NewLoanEntryDTO objNewLoanEntryDTO = new NewLoanEntryDTO();
            if (Convert.ToInt32(SessionHelper.GetStringValue("UserRole")) == 4)
            {
                blnIsAgent = true;
                var lstUserCompanyDetail = _MyProfileService.getUserCompany(Convert.ToInt32(0), blnIsAgent);
                objNewLoanEntryDTO.lstCompanyDetail = SMEHelper.GetDropDownList<UserCompanyDetail>(lstUserCompanyDetail, "CompanyName", "Id", "", "--Select--");

                var lstCust = _MyProfileService.getAgentCustomers(Convert.ToInt32(SessionHelper.GetStringValue("UserId")));
                objNewLoanEntryDTO.lstCustDetail = SMEHelper.GetDropDownList<AgentCustomerDetail>(lstCust, "AgentCustomerName", "Id", "", "--Select--");
            }
            else
            {
                var lstUserCompanyDetail = _MyProfileService.getUserCompany(Convert.ToInt32(SessionHelper.GetStringValue("UserId")), blnIsAgent);
                objNewLoanEntryDTO.lstCompanyDetail = SMEHelper.GetDropDownList<UserCompanyDetail>(lstUserCompanyDetail, "CompanyName", "Id", "", "--Select--");

                var lstCust = _MyProfileService.getAgentCustomers(Convert.ToInt32(0));
                objNewLoanEntryDTO.lstCustDetail = SMEHelper.GetDropDownList<AgentCustomerDetail>(lstCust, "AgentCustomerName", "Id", "", "--Select--");
            }

            var productType = _registration.getProductTypes();
            var loanType = _registration.getLoanType();

            objNewLoanEntryDTO.lstProductType = SMEHelper.GetDropDownList<ProductType>(productType, "ProductTypeName", "Id", "", "--Select--");
            objNewLoanEntryDTO.lstLoanType = SMEHelper.GetDropDownList<LoanType>(loanType, "LoanTypeName", "Id", "", "--Select--");

            return View("NewLoanEntry", objNewLoanEntryDTO);
        }
コード例 #5
0
 public ActionResult LoanHistory()
 {
     List<Data.NewLoanEntry> _newLoanEntry = _NewLoanService.getNewLoanDetails(Convert.ToInt32(SessionHelper.GetStringValue("UserId")), true);
     NewLoanEntryDTO objNewLoanEntryDTO = new NewLoanEntryDTO();
     objNewLoanEntryDTO.lstNewLoanEntryDTO = _newLoanEntry;
     return View("LoanHistory", objNewLoanEntryDTO);
 }
コード例 #6
0
 // GET: Dashboard
 public ActionResult Index()
 {
     List<Data.NewLoanEntry> _newLoanEntry =  _NewLoanService.getNewLoanDetails(Convert.ToInt32(SessionHelper.GetStringValue("UserId")), false);
      List<NewLoanEntryDTO> lstNewLoanEntryDTO = Mapper.Map<List<Data.NewLoanEntry>, List<NewLoanEntryDTO>>(_newLoanEntry);
      NewLoanEntryDTO objNewLoanEntryDTO = new NewLoanEntryDTO();
      objNewLoanEntryDTO.lstNewLoanEntryDTO = _newLoanEntry;
      return View("Dashboard", objNewLoanEntryDTO);
 }