Example #1
0
 public string UpdaeLoanRequest(LoanRequestDto loanRequestDto)
 {
     try
     {
         Guid id = loanRequestDto.Id;
         LoanRequestRepository repository  = new LoanRequestRepository();
         LoanRequest           loanRequest =
             repository.ActiveContext.LoanRequests.Where(lr => lr.Id == id).FirstOrDefault();
         if (loanRequest == null)
         {
             return("request is not there ");
         }
         loanRequest.InjectFrom <UnflatLoopValueInjection>(loanRequestDto);
         repository.Update(loanRequest);
         return("updated successfully");
     }
     catch (Exception exception)
     {
         return(exception.Message);
     }
 }
 public string AddLoanRequest(LoanRequestDto loanRequestDto)
 {
     try
     {
         LoanRequestRepository repository = new LoanRequestRepository();
         loanRequestDto.ReqNo = MakeReqNo(repository, loanRequestDto.Date);
         LoanRequest loanRequest = new LoanRequest();
         loanRequest.LoanRequestOkyAsistant = new LoanRequestOkyAssistant();
         Account account =
             repository.ActiveContext.BankAccounts.OfType<Account>()
                       .FirstOrDefault(a => a.Code == loanRequestDto.AccountCode);
         loanRequestDto.Id = Guid.NewGuid();
         loanRequest.InjectFrom<UnflatLoopValueInjection>(loanRequestDto);
         loanRequest.Account = account;
         repository.Add(loanRequest);
         return "request added successfully";
     }
     catch (Exception exception)
     {
         return exception.Message;
     }
 }
Example #3
0
 public string AddLoanRequest(LoanRequestDto loanRequestDto)
 {
     try
     {
         LoanRequestRepository repository = new LoanRequestRepository();
         loanRequestDto.ReqNo = MakeReqNo(repository, loanRequestDto.Date);
         LoanRequest loanRequest = new LoanRequest();
         loanRequest.LoanRequestOkyAsistant = new LoanRequestOkyAssistant();
         Account account =
             repository.ActiveContext.BankAccounts.OfType <Account>()
             .FirstOrDefault(a => a.Code == loanRequestDto.AccountCode);
         loanRequestDto.Id = Guid.NewGuid();
         loanRequest.InjectFrom <UnflatLoopValueInjection>(loanRequestDto);
         loanRequest.Account = account;
         repository.Add(loanRequest);
         return("request added successfully");
     }
     catch (Exception exception)
     {
         return(exception.Message);
     }
 }
 public string UpdaeLoanRequest(LoanRequestDto loanRequestDto)
 {
     try
     {
         Guid id = loanRequestDto.Id;
         LoanRequestRepository repository = new LoanRequestRepository();
         LoanRequest loanRequest =
             repository.ActiveContext.LoanRequests.Where(lr => lr.Id == id).FirstOrDefault();
         if (loanRequest == null) return "request is not there ";
         loanRequest.InjectFrom<UnflatLoopValueInjection>(loanRequestDto);
         repository.Update(loanRequest);
         return "updated successfully";
     }
     catch (Exception exception)
     {
         return exception.Message;
     }
 }
Example #5
0
 public void Creat_Request()
 {
     LoanRequestDto loanRequestDto = new LoanRequestDto {Id = Guid.NewGuid() , AccountCode = "1/0/0",Amount = 1000,Date = 13911102,Description = "vam" };
     PersonAccountService ps = new PersonAccountService();
     string str = ps.AddLoanRequest(loanRequestDto);
 }