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" })); } }
private void OnUpdateExecute() { _service.UpdateLoanType(new DataService.LoanType(LoanTypeItem.Id, LoanTypeItem.TypeName)); _eventAggregator.GetEvent <AfterUpdateLoanTypeDetailViewEvent>().Publish( new AfterUpdateLoanTypeDetailViewEventArgs { Id = LoanTypeItem.Id, TypeName = LoanTypeItem.TypeName }); }
public async Task <IActionResult> Update([Bind("Id,Name,Description,GeneralInformation,MinLoanSum,MaxLoanSum,InterestRate,LoanSummary,MonthlyFee,MinTerm,MaxTerm,PaymentForAccidentInsurance,FeeForInsuranceLoan,FreeForServicesUponReciptCash,CurrencyId")] LoanType loanType) { if (ModelState.IsValid) { await _loanTypeService.UpdateLoanType(loanType); return(RedirectToAction(nameof(Index))); } ViewData["CurrencyId"] = new SelectList(await _currencyService.GetAll(), "Id", "Name"); return(View(loanType)); }
public async Task <IActionResult> UpdateLoanType(int LoanTypeId, LoanType loanType) { try { var res = await _service.UpdateLoanType(LoanTypeId, loanType); if (res != null) { return(Ok(res)); } return(StatusCode(StatusCodes.Status204NoContent)); } catch (Exception ex) { throw; } }