public ActionResult Step8(Fees fees)
        {
            if (userData.RoleId >= 3)
            {
                return RedirectToAction("UserLogin", "Login", new { lbl = "You are not Allowed." });
            }
            StepAccess step = new StepAccess();

            if (fees.AdvanceDue == "Vehicle Payoff")
            {
                fees.AdvanceDueDate = "VP";
            }
            if (fees.AdvanceDue == "Time of Advance")
            {
                fees.AdvanceDueDate = "ToA";
            }

            //if (fees.IsAdvanceFeeCompleteEmailReminder == false)
            //{
            //    fees.AdvanceFeeDealerEmail = "";
            //    fees.AdvanceFeeDealerEmailRemindPeriod = 0;
            //}
            //if (fees.IsLoanFeeCompleteEmailReminder == false)
            //{
            //    fees.MonthlyLoanFeeDealerEmail = "";
            //    fees.MonthlyLoanFeeDealerEmailRemindPeriod = 0;
            //}
            //if (fees.IsLotFeeCompleteEmailReminder == false)
            //{
            //    fees.LotInspectionFeeDealerEmail = "";
            //    fees.LotInspectionFeeDealerEmailRemindPeriod = 0;
            //}
            if (fees.IsAdvanceFeeDueEmailReminder == false)
            {
                fees.AdvanceDueEmail = "";
                fees.AdvanceDueEmailRemindPeriod = 0;
            }
            if (fees.IsLoanFeeDueEmailReminder == false)
            {
                fees.MonthlyLoanDueEmail = "";
                fees.MonthlyLoanDueEmailRemindPeriod = 0;
            }
            if (fees.IsLotFeeDueEmailReminder == false)
            {
                fees.LotInspectionDueEmail = "";
                fees.LotInspectionDueEmailRemindPeriod = 0;
            }
            fees.LoanId = loanData.loanId;

            // after hide the due methods

            fees.MonthlyLoanDue = "Once a Month";
            fees.LotInspectionDue = "Monthly";

            if (step.InsertFeesDetails(fees))
            {
                var userId = userData.UserId;
                var branchId = loanData.loanId;

                if (fees.isEdit == true)
                {
                    return RedirectToAction("Step9");
                }
                else if (step.UpdateLoanSetupStep(userData.UserId, loanData.CompanyId, loanData.BranchId, loanData.nonRegisteredBranchId, loanData.loanId, 4))
                {

                    if (loanData.stepId < 4)
                    {
                        loanData.stepId = 4;
                        Log log = new Log(userData.UserId, userData.Company_Id, loanData.BranchId, fees.LoanId, "Fees", "Inserted fees details of loan : " + fees.LoanId, DateTime.Now);

                        int islog = (new LogAccess()).InsertLog(log);
                    }
                    else
                    {
                        Log log = new Log(userData.UserId, userData.Company_Id, loanData.BranchId, fees.LoanId, "Fees", "Edited fees details of loan : " + fees.LoanId, DateTime.Now);

                        int islog = (new LogAccess()).InsertLog(log);
                    }
                    Session["loanStep"] = loanData;
                    return RedirectToAction("Step9");
                }
                else
                {
                    return RedirectToAction("Step8");
                }
            }
            else
            {
                return RedirectToAction("Step8");
            }

        }