public Npf_ClaimRegister process(string serviceno, string fundtype)
        {
            var     getperson   = unitOfWork.person.GetPersonBySVC_No(x => x.SVC_NO == serviceno);
            decimal amount      = 0M;
            decimal outstandAmt = 0M;
            decimal amountDue   = 0M;
            decimal amt         = 0M;

            //if (services.fundtypeDesc(fundtype).ToUpper() == "NAVIP")
            //{
            //    amount = services.GetNavipAmount(getperson.PersonID.ToString(), fundtype, out amt);
            //    outstandAmt = services.OutstandingLoanServices(getperson.PersonID.ToString());
            //    amountDue = amount - outstandAmt;
            //}

            if (services.fundtypeDesc(fundtype).ToUpper() == "DEPENDANT FUND")
            {
                amount    = services.GetDependentAmount(getperson.PersonID.ToString(), fundtype);
                amountDue = amount;
            }

            Npf_ClaimRegister val = new Npf_ClaimRegister();

            val.svcno             = serviceno;
            val.TotalContribution = amount;
            val.amountPaid        = amt;
            val.amountReceived    = outstandAmt;
            val.AmountDue         = amountDue;
            val.FundTypeID        = fundtype;


            return(val);
        }
Esempio n. 2
0
        public async Task <ActionResult> Index3(Npf_ClaimRegister model)
        {
            var result  = claimTypeService.GetSingleBatchno(model.BatchNo);
            var result2 = new List <Npf_ClaimRegister>();
            var result3 = new List <Npf_ClaimRegister>();

            if (result.Count > 0)
            {
                foreach (var j in result)
                {
                    using (SqlConnection sqls = new SqlConnection(_connectionstring))
                    {
                        using (SqlCommand cmd = new SqlCommand("npf_update_claim", sqls))
                        {
                            cmd.CommandTimeout = 1200;
                            cmd.CommandType    = System.Data.CommandType.StoredProcedure;
                            cmd.Parameters.Add(new SqlParameter("@globaluser", User.Identity.Name));
                            cmd.Parameters.Add(new SqlParameter("@claimtype", j.FundTypeID));
                            cmd.Parameters.Add(new SqlParameter("@fundtype", HttpContext.Session.GetInt32("fundtypeid")));
                            cmd.Parameters.Add(new SqlParameter("@bankcode", model.Beneficiary));
                            cmd.Parameters.Add(new SqlParameter("@persid", j.PersonID));


                            try
                            {
                                await sqls.OpenAsync();

                                await cmd.ExecuteNonQueryAsync();

                                result3.Add(j);
                            }
                            catch
                            {
                                result2.Add(j);
                            }
                        }
                    }
                }

                TempData["message"] = result3.Count.ToString() + " successfully approved";
            }
            else
            {
                TempData["message"] = "batch no does not exist";
            }

            return(RedirectToAction("Index3", "ClaimType"));
        }
        public ActionResult Put([FromBody] Npf_ClaimRegister value)
        {
            try
            {
                if (String.IsNullOrEmpty(value.Id.ToString()))
                {
                    return(Ok(new { responseCode = 500, responseDescription = "Kindly Supply claim register" }));
                }
                var getbal = services.GetClaimRegisterById(value.Id).Result;

                getbal.appdate = value.appdate;
                services.UpdateNpfClaimRegister(getbal);

                return(Ok(new { responseCode = 200, responseDescription = "Updated Successfully" }));
            }
            catch (Exception ex)
            {
                return(Ok(new { responseCode = 500, responseDescription = "Failed" }));
            }
        }
Esempio n. 4
0
        public IActionResult Index(string serviceNo, string fundtypeCode)
        {
            decimal amount      = 0M;
            decimal outstandAmt = 0M;
            decimal amountDue   = 0M;
            decimal amt         = 0M;

            if (services.fundtypeDesc(fundtypeCode).ToUpper() == "NAVIP")
            {
                amount      = services.GetNavipAmount(serviceNo, fundtypeCode, out amt);
                outstandAmt = services.OutstandingLoanServices(serviceNo);
                amountDue   = amount - outstandAmt;
            }

            if (services.fundtypeDesc(fundtypeCode).ToUpper() == "DEPENDANT FUND")
            {
                amount    = services.GetDependentAmount(serviceNo, fundtypeCode);
                amountDue = amount;
            }

            Npf_ClaimRegister val = new Npf_ClaimRegister();

            val.PersonID          = Convert.ToInt32(serviceNo);
            val.TotalContribution = amount;
            val.amountPaid        = amt;
            val.amountReceived    = outstandAmt;
            val.AmountDue         = amountDue;
            val.FundTypeID        = fundtypeCode;
            val.bank        = 0;
            val.acctno      = "";
            val.Beneficiary = "";


            return(Ok(new { responseCode = 200, responseDescription = "Created Successfully", val }));
            //return Ok(val);
        }
Esempio n. 5
0
 public async Task <bool> UpdateNpfClaimRegister(Npf_ClaimRegister bl_sheet)
 {
     unitOfWork.claimregister.Update(bl_sheet);
     return(await unitOfWork.Done());
 }
        public async Task <IActionResult> CreateClaim([FromBody] Npf_ClaimRegister value)
        {
            try
            {
                var getperson  = unitofWork.person.GetPersonBySVC_No(x => x.PersonID == value.PersonID);
                var kp         = claimRegisterService.GetClaimRegisterByCode2(getperson.SVC_NO.Trim(), value.FundTypeID).Result;
                var getperrank = unitofWork.rank.GetRankbyName(x => x.Id == getperson.rank);
                //  var fn = services.GetClaimRegisterByCode(value.FundTypeID.Trim());
                if (kp != null && kp.status == "Pending")
                {
                    kp.TotalContribution = value.TotalContribution;
                    kp.AmountDue         = value.AmountDue;
                    kp.interest          = value.amountPaid;
                    kp.statusdate        = DateTime.Now;
                    kp.loan        = value.amountReceived;
                    kp.Beneficiary = value.Beneficiary;
                    kp.bank        = value.bank;
                    kp.acctno      = value.acctno;
                    kp.Remark      = "Dependant For Late " + getperrank.Description + " " + getperson.LastName + " " + getperson.FirstName + " " + getperson.SVC_NO;
                    kp.status      = "Pending";
                    kp.appdate     = DateTime.Now;


                    await claimRegisterService.UpdateNpfClaimRegister(kp);

                    //var getclaim2 = claimRegisterService.GetclaimBysvcNo(kp.svcno).ToList();

                    //return await generatePdf.GetPdf("Views/ClaimRegister/ReportPage2.cshtml", getclaim2);

                    return(Ok(new { responseCode = 200, responseDescription = "update Successfully" }));
                }
                else if (kp == null)
                {
                    var fg = new Npf_ClaimRegister
                    {
                        PersonID          = getperson.PersonID,
                        svcno             = getperson.SVC_NO,
                        appdate           = DateTime.Now,
                        TotalContribution = value.TotalContribution,
                        FundTypeID        = value.FundTypeID,
                        statusdate        = DateTime.Now,
                        AmountDue         = value.AmountDue,
                        interest          = value.amountPaid,
                        loan        = value.amountReceived,
                        Beneficiary = value.Beneficiary,
                        bank        = value.bank,
                        acctno      = value.acctno,
                        Remark      = "Dependant For Late " + getperrank.Description + " " + getperson.LastName + " " + getperson.FirstName + " " + getperson.SVC_NO,
                        status      = "Pending"
                    };
                    await claimRegisterService.AddNpfClaimRegister(fg);

                    return(Ok(new { responseCode = 200, responseDescription = "Created Successfully" }));
                }
                else
                {
                    return(Ok(new
                    {
                        responseCode = 200,
                        responseDescription = "Claim has been approved" +
                                              "do you want to do reversal?"
                    }));
                }
            }
            catch (Exception ex)
            {
                return(Ok(new { responseCode = 500, responseDescription = "Failed" }));
            }
        }