public IActionResult updateInvestRegister([FromBody] Pf_InvestRegister value)
        {
            try
            {
                if (String.IsNullOrEmpty(value.IssuanceBankId.ToString()))
                {
                    return(Ok(new { responseCode = 500, responseDescription = "Kindly enter the IssuanceBank" }));
                }

                var getbal = services.GetinvestRegisterById(value.Id).Result;
                getbal.IssuanceBankId  = value.IssuanceBankId;
                getbal.Date            = value.Date;
                getbal.DueDate         = value.DueDate;
                getbal.Amount          = value.Amount;
                getbal.closecode       = value.closecode;
                getbal.createdby       = value.createdby;
                getbal.datecreated     = value.datecreated;
                getbal.Description     = value.Description;
                getbal.InvestmentType  = value.InvestmentType;
                getbal.maturedamt      = value.maturedamt;
                getbal.Voucher         = value.Voucher;
                getbal.Tenure          = value.Tenure;
                getbal.Maturingdate    = value.Maturingdate;
                getbal.interest        = value.interest;
                getbal.chequeno        = value.chequeno;
                getbal.receivingBankId = value.receivingBankId;

                services.UpdateInvestRegister(getbal);
                return(Ok(new { responseCode = 200, responseDescription = "Updated Successfully" }));
            }
            catch (Exception ex)
            {
                return(Ok(new { responseCode = 500, responseDescription = "Failed" }));
            }
        }
        public IActionResult updateInvestCapitalMarket([FromBody] Pf_InvestRegister value)
        {
            try
            {
                if (String.IsNullOrEmpty(value.company.ToString()))
                {
                    return(Ok(new { responseCode = 500, responseDescription = "Kindly enter the company" }));
                }

                var getbal = services.GetinvestRegisterById(value.Id).Result;
                getbal.company        = value.company;
                getbal.IssuanceBankId = value.IssuanceBankId;
                getbal.Date           = value.Date;
                getbal.Amount         = value.Amount;
                getbal.closecode      = value.closecode;
                getbal.createdby      = value.createdby;
                getbal.datecreated    = value.datecreated;
                getbal.Description    = value.Description;
                getbal.InvestmentType = value.InvestmentType;
                getbal.Voucher        = value.Voucher;
                getbal.chequeno       = value.chequeno;
                getbal.unit           = value.unit;

                services.UpdateInvestRegister(getbal);
                return(Ok(new { responseCode = 200, responseDescription = "Updated Successfully" }));
            }
            catch (Exception ex)
            {
                return(Ok(new { responseCode = 500, responseDescription = "Failed" }));
            }
        }
        public IActionResult createInvestRegister([FromBody] Pf_InvestRegister value)
        {
            try
            {
                if (value.IssuanceBankId == null)
                {
                    return(Ok(new { responseCode = 400, responseDescription = "IssuanceBank can not be Null" }));
                }
                value.InvestmentType = "Money Market";
                services.AddInvestRegister(value);

                return(Ok(new { responseCode = 200, responseDescription = "Created Successfully" }));
            }
            catch (Exception ex)
            {
                return(Ok(new { responseCode = 500, responseDescription = "Failed" }));
            }
        }
        public IActionResult createInvestCapitalMarket([FromBody] Pf_InvestRegister value)
        {
            try
            {
                if (value.company == null)
                {
                    return(Ok(new { responseCode = 400, responseDescription = "company already Exist" }));
                }
                value.InvestmentType = "Capital Market";
                services.AddInvestRegister(value);

                return(Ok(new { responseCode = 200, responseDescription = "Created Successfully" }));
            }
            catch (Exception ex)
            {
                return(Ok(new { responseCode = 500, responseDescription = "Failed" }));
            }
        }
 public async Task <bool> UpdateInvestRegister(Pf_InvestRegister register)
 {
     unitOfWork.register.Update(register);
     return(await unitOfWork.Done());
 }