public IActionResult updatepFundRate([FromBody] Pf_fundRate value)
        {
            try
            {
                if (String.IsNullOrEmpty(value.FundCode))
                {
                    return(Ok(new { responseCode = 500, responseDescription = "Kindly Supply  Code" }));
                }

                var getbal = pFundRateService.GetFundRateTypeById(value.Id).Result;
                getbal.FundCode    = value.FundCode;
                getbal.Interest    = value.Interest;
                getbal.datecreated = value.datecreated;
                getbal.createdby   = value.createdby;
                getbal.Period      = value.Period;
                getbal.Rate        = value.Rate;

                pFundRateService.UpdateFundType(getbal);
                return(Ok(new { responseCode = 200, responseDescription = "Updated Successfully" }));
            }
            catch (Exception ex)
            {
                return(Ok(new { responseCode = 500, responseDescription = "Failed" }));
            }
        }
        public IActionResult createPfFunRate([FromBody] Pf_fundRate value)
        {
            try
            {
                if (pFundRateService.GetFundRateTypeByCode(value.FundCode.Trim()).Result != null)
                {
                    return(Ok(new { responseCode = 400, responseDescription = "function type code already Exist" }));
                }
                pFundRateService.AddFundType(value);

                return(Ok(new { responseCode = 200, responseDescription = "Created Successfully" }));
            }
            catch (Exception ex)
            {
                return(Ok(new { responseCode = 500, responseDescription = "Failed" }));
            }
        }
Exemple #3
0
 public async Task <bool> UpdateFundType(Pf_fundRate pf_Fundrate)
 {
     unitOfWork.pfundrate.Update(pf_Fundrate);
     return(await unitOfWork.Done());
 }