コード例 #1
0
 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" }));
     }
 }
コード例 #2
0
        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" }));
            }
        }
コード例 #3
0
 public async Task <bool> UpdateFundType(Pf_fund pf_Fund)
 {
     unitOfWork.FundType.Update(pf_Fund);
     return(await unitOfWork.Done());
 }
コード例 #4
0
 public void RemoveFundType(Pf_fund pf_Fund)
 {
     unitOfWork.FundType.Remove(pf_Fund);
     unitOfWork.Done();
 }
コード例 #5
0
 public async Task <bool> AddFundType(Pf_fund fundtype)
 {
     unitOfWork.FundType.Create(fundtype);
     return(await unitOfWork.Done());
 }