public IActionResult createLoanType([FromBody] Pf_loanType value)
        {
            try
            {
                if (String.IsNullOrEmpty(value.Code))
                {
                    return(Ok(new { responseCode = 500, responseDescription = "Kindly Supply loan Type Code" }));
                }
                if (loantypeService.GetLoanTypeByCode(value.Code.Trim()) != null)
                {
                    return(Ok(new { responseCode = 400, responseDescription = "Loan Type Code already Exist" }));
                }

                value.datecreated = DateTime.Now;
                value.createdby   = User.Identity.Name;

                loantypeService.AddLoanType(value);

                return(Ok(new { responseCode = 200, responseDescription = "Created Successfully" }));
            }
            catch (Exception ex)
            {
                return(Ok(new { responseCode = 500, responseDescription = "Failed" }));
            }
        }
 public IActionResult Put([FromBody] Pf_loanType value)
 {
     try
     {
         if (String.IsNullOrEmpty(value.Code))
         {
             return(Ok(new { responseCode = 500, responseDescription = "Kindly Supply Fund Type Code" }));
         }
         var getloan = loantypeService.GetLoanTypeByCode(value.Code.Trim());
         getloan.Description   = value.Description;
         getloan.Tenure        = value.Tenure;
         getloan.FundTypeID    = value.FundTypeID;
         getloan.Interest      = value.Interest;
         getloan.liabilityacct = value.liabilityacct;
         getloan.interestacct  = value.interestacct;
         getloan.incomeacct    = value.incomeacct;
         getloan.loanacct      = value.loanacct;
         getloan.trusteeacct   = value.trusteeacct;
         getloan.datecreated   = DateTime.Now;
         getloan.createdby     = User.Identity.Name;
         loantypeService.UpdateLoanType(getloan);
         return(Ok(new { responseCode = 200, responseDescription = "Updated Successfully" }));
     }
     catch (Exception ex)
     {
         return(Ok(new { responseCode = 500, responseDescription = "Failed" }));
     }
 }
 public void RemoveLoanType(Pf_loanType pf_LoanType)
 {
     unitOfWork.loanType.Remove(pf_LoanType);
     unitOfWork.Done();
 }
 public async Task <bool> UpdateLoanType(Pf_loanType Pf_loanType)
 {
     unitOfWork.loanType.Update(Pf_loanType);
     return(await unitOfWork.Done());
 }
 public async Task <bool> AddLoanType(Pf_loanType loantype)
 {
     unitOfWork.loanType.Create(loantype);
     return(await unitOfWork.Done());
 }