public IActionResult Put([FromBody] Pf_fund value) { try{ if (String.IsNullOrEmpty(value.Code)) { return(Ok(new { responseCode = 500, responseDescription = "Kindly Supply Fund Type Code" })); } var getfund = fundtypeService.GetFundTypeByCode(value.Code.Trim()).Result; getfund.Description = value.Description; getfund.startDate = value.startDate; getfund.processingMonth = value.processingMonth; getfund.processingYear = value.processingYear; getfund.interestacct = value.interestacct; getfund.interestacct = value.interestacct; getfund.incomeacct = value.incomeacct; getfund.fundacct = value.fundacct; getfund.trusteeacct = value.trusteeacct; getfund.datecreated = DateTime.Now; getfund.createdby = "Hicad"; fundtypeService.UpdateFundType(getfund); return(Ok(new { responseCode = 200, responseDescription = "Updated Successfully" })); } catch (Exception ex) { return(Ok(new { responseCode = 500, responseDescription = "Failed" })); } }
public IActionResult createFundType([FromBody] Pf_fund value) { try { if (String.IsNullOrEmpty(value.Code)) { return(Ok(new { responseCode = 500, responseDescription = "Kindly Supply Fund Type Code" })); } if (fundtypeService.GetFundTypeByCode(value.Code.Trim()).Result != null) { return(Ok(new { responseCode = 400, responseDescription = "Fund Type Code already Exist" })); } value.datecreated = DateTime.Now; value.createdby = "Hicad"; value.startDate = DateTime.Now; fundtypeService.AddFundType(value); return(Ok(new { responseCode = 200, responseDescription = "Created Successfully" })); } catch (Exception ex) { return(Ok(new { responseCode = 500, responseDescription = "Failed" })); } }
public async Task <bool> UpdateFundType(Pf_fund pf_Fund) { unitOfWork.FundType.Update(pf_Fund); return(await unitOfWork.Done()); }
public void RemoveFundType(Pf_fund pf_Fund) { unitOfWork.FundType.Remove(pf_Fund); unitOfWork.Done(); }
public async Task <bool> AddFundType(Pf_fund fundtype) { unitOfWork.FundType.Create(fundtype); return(await unitOfWork.Done()); }