Пример #1
0
 public IActionResult AddLoan([FromBody] NewLoan newLoan)
 {
     Console.WriteLine("received loan POST: " + newLoan.ToString());
     if (ModelState.IsValid)
     {
         var targetItem = db.Item.SingleOrDefault(i => i.Id.ToString() == newLoan.id);
         var loan       = new Loan();
         loan.Item = targetItem;
         targetItem.IsAvailable = false;
         db.Item.Update(targetItem);
         var identity = User.Identity as ClaimsIdentity;
         loan.UserId = Guid.Parse(identity.Claims.FirstOrDefault(c => c.Type == "id")?.Value);
         // TODO: Save a user object to this
         loan.User      = identity.Claims.FirstOrDefault(c => c.Type == "sub")?.Value;
         loan.StartDate = DateTime.Today;
         loan.EndDate   = loan.StartDate + new TimeSpan(14, 0, 0, 0);
         loan.Active    = true;
         db.Loans.Add(loan);
         db.SaveChanges();
         return(CreatedAtAction(nameof(GetLoanById), new { id = loan.Id }, loan));
     }
     else
     {
         return(BadRequest());
     }
 }
Пример #2
0
        public void AddNewLoan()
        {
            // Arrange
            var newLoan = new NewLoan
            {
                BorrowerName    = "TestNew Loan",
                FundingAmount   = 500,
                RepaymentAmount = 600
            };

            var addedLoan = new Loan
            {
                Id              = 2,
                BorrowerName    = "TestNew Loan",
                FundingAmount   = 500,
                RepaymentAmount = 600,
                Deleted         = false
            };

            _repo.Setup(x => x.AddNewLoan(It.IsAny <Loan>()))
            .Callback((Loan loan) => _loans.Add(loan))
            .Returns(Task.FromResult(addedLoan));

            var loan = _service.AddNewLoan(newLoan).Result;

            _repo.Verify(x => x.AddNewLoan(It.IsAny <Loan>()), Times.Once);

            Assert.Equal(newLoan.BorrowerName, loan.BorrowerName);
            Assert.Equal(2, loan.Id);
        }
Пример #3
0
Файл: Loan.cs Проект: igprog/kup
    NewLoan ReadData(SqlDataReader reader)
    {
        NewLoan x = new NewLoan();

        x.id                     = reader.GetValue(0) == DBNull.Value ? null : reader.GetString(0);
        x.user                   = new User.NewUser();
        x.user.id                = reader.GetValue(1) == DBNull.Value ? null : reader.GetString(1);
        x.user                   = U.GetUserData(x.user.id, null);
        x.loan                   = reader.GetValue(2) == DBNull.Value ? 0 : Convert.ToDouble(reader.GetString(2));
        x.loanDate               = reader.GetValue(3) == DBNull.Value ? null : reader.GetString(3);
        x.repayment              = reader.GetValue(4) == DBNull.Value ? 0 : Convert.ToDouble(reader.GetString(4));
        x.manipulativeCosts      = reader.GetValue(5) == DBNull.Value ? 0 : Convert.ToDouble(reader.GetString(5));
        x.manipulativeCostsCoeff = s.Data().manipulativeCostsCoeff;
        x.actualLoan             = x.loan - x.manipulativeCosts;
        x.withdraw               = reader.GetValue(6) == DBNull.Value ? 0 : Convert.ToDouble(reader.GetString(6));
        x.lastLoanToRepaid       = x.actualLoan - x.withdraw;
        User u = new User();

        x.restToRepayment          = GetTotalLoan(x) - GetTotalLoanRepayed(x); // TOOD: provjeriti
        x.dedline                  = reader.GetValue(7) == DBNull.Value ? s.Data().defaultDedline : Convert.ToDouble(reader.GetString(7));
        x.isRepaid                 = reader.GetValue(8) == DBNull.Value ? 0 : reader.GetInt32(8);
        x.note                     = reader.GetValue(9) == DBNull.Value ? null : reader.GetString(9);
        x.user.firstName           = reader.GetValue(10) == DBNull.Value ? null : reader.GetString(10);
        x.user.lastName            = reader.GetValue(11) == DBNull.Value ? null : reader.GetString(11);
        x.user.buisinessUnit       = new BuisinessUnit.NewUnit();
        x.user.buisinessUnit.code  = reader.GetValue(12) == DBNull.Value ? null : reader.GetString(12);
        x.user.buisinessUnit.title = reader.GetValue(13) == DBNull.Value ? null : reader.GetString(13);
        return(x);
    }
Пример #4
0
Файл: Loan.cs Проект: igprog/kup
 public string Get(string id)
 {
     try {
         db.Loan();
         string  sql = string.Format(@"SELECT l.id, l.userId, l.loan, l.loanDate, l.repayment, l.manipulativeCosts, l.withdraw, l.dedline, l.isRepaid, l.note, u.firstName, u.lastName, b.code, b.title FROM Loan l
                     LEFT OUTER JOIN Users u
                     ON l.userId = u.id
                     LEFT OUTER JOIN BuisinessUnit b
                     ON u.buisinessUnitCode = b.code WHERE l.id = '{0}'", id);
         NewLoan x   = new NewLoan();
         using (SqlConnection connection = new SqlConnection(g.connectionString)) {
             connection.Open();
             using (SqlCommand command = new SqlCommand(sql, connection)) {
                 using (SqlDataReader reader = command.ExecuteReader()) {
                     while (reader.Read())
                     {
                         x = ReadData(reader);
                     }
                 }
             }
             connection.Close();
         }
         return(JsonConvert.SerializeObject(x, Formatting.None));
     } catch (Exception e) {
         return(JsonConvert.SerializeObject(e.Message, Formatting.None));
     }
 }
Пример #5
0
        public async Task <IActionResult> Create([FromBody] NewLoan newLoan)
        {
            var loan = await _loanManager.AddNewLoan(newLoan);

            if (loan == null)
            {
                return(BadRequest());
            }
            return(Ok(loan));
        }
Пример #6
0
Файл: Loan.cs Проект: igprog/kup
    public string Save(NewLoan x)
    {
        try {
            db.Loan();
            db.Account();
            bool   isNewLoan           = false;
            string manipulativeCostsId = Guid.NewGuid().ToString();
            string withdrawId          = Guid.NewGuid().ToString();
            if (string.IsNullOrEmpty(x.id))
            {
                x.id      = Guid.NewGuid().ToString();
                isNewLoan = true;
            }

            if (isNewLoan && x.restToRepayment > 0 && x.repaidOldDebt) // x.repaidOldDebt je za slucaj ako se greskom uplati na neciji žiro racun iako nije trazio pozajmicu, u tom slucaju treba biti false
            {
                UpdateActiveLoan(x);                                   //********** Ako postoji pozajmica koja nije otplacena onda se ona otplacuje sa dijelom nove pozajmice.
            }

            string sql = string.Format(@"BEGIN TRAN
                                        IF EXISTS (SELECT * from Loan WITH (updlock,serializable) WHERE id = '{0}')
                                            BEGIN
                                                UPDATE Loan SET userId = '{1}', loan = '{2}', loanDate = '{3}', repayment = '{4}', manipulativeCosts = '{5}', withdraw = '{6}', dedline = '{7}', isRepaid = '{8}', note = '{9}' WHERE id = '{0}';
                                                UPDATE Account SET userId = '{1}', amount = '{5}', recordDate = '{3}', mo = '{10}', yr = '{11}', note = 'Manipulativni troškovi' WHERE loanId = '{0}' AND recordType = 'manipulativeCosts';
                                                UPDATE Account SET userId = '{1}', amount = '{6}', recordDate = '{3}', mo = '{10}', yr = '{11}', note = 'Isplata pozajmice' WHERE loanId = '{0}' AND recordType = 'withdraw';
                                                UPDATE Account SET userId = '{1}', recordDate = '{3}', mo = '{10}', yr = '{11}' WHERE loanId = '{0}' AND recordType = 'loan';
                                            END
                                        ELSE
                                            BEGIN
                                                INSERT INTO Loan (id, userId, loan, loanDate, repayment, manipulativeCosts, withdraw, dedline, isRepaid, note)
                                                VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', '{9}')

                                                INSERT INTO Account (id, userId, amount, recordDate, mo, yr, recordType, loanId, note)
                                                VALUES ('{12}', '{1}', '{5}', '{3}', '{10}', '{11}', 'manipulativeCosts', '{0}', 'Manipulativni troškovi')

                                                INSERT INTO Account (id, userId, amount, recordDate, mo, yr, recordType, loanId, note)
                                                VALUES ('{13}', '{1}', '{6}', '{3}', '{10}', '{11}',  'withdraw', '{0}', 'Isplata pozajmice')
                                            END
                                    COMMIT TRAN", x.id, x.user.id, x.loan, x.loanDate, x.repayment, x.manipulativeCosts, x.withdraw, x.dedline, x.isRepaid, x.note, g.GetMonth(x.loanDate), g.GetYear(x.loanDate), manipulativeCostsId, withdrawId);
            using (SqlConnection connection = new SqlConnection(g.connectionString)) {
                connection.Open();
                using (SqlCommand command = new SqlCommand(sql, connection)) {
                    command.ExecuteNonQuery();
                }
                connection.Close();
            }
            return(JsonConvert.SerializeObject(x, Formatting.None));
        } catch (Exception e) {
            return(JsonConvert.SerializeObject("Error: " + e.Message, Formatting.None));
        }
    }
Пример #7
0
        public void DirectConvRefinance()
        //public void _01_PipelineCreateNew(IDictionary<string, string> data)

        {
            AttachToProcess(Processes.Encompass, 5);

            LaunchApplication(DesktopApps.Encompass); Launcher.Initialize().cmb_EnvironmentID_SelectByText(EnvironmentID).btn_Login_Click(); AttachToProcess(Processes.Encompass, 5);

            Login.Initialize().Login_Username_SendKeys(LoanOfficer);

            Pipeline.Initialize().btn_NewLoan_Click(); NewLoan.Initialize().SelectItem_DirectConvRefinance();

            FormsTab.Initialize().OpenFormsTab();
        }
Пример #8
0
        public async Task <Loan> AddNewLoan(NewLoan newloan)
        {
            newloan.RepaymentAmount = Math.Round(newloan.FundingAmount * (decimal)1.2, 3);

            var loan = new Loan
            {
                BorrowerName    = newloan.BorrowerName,
                FundingAmount   = newloan.FundingAmount,
                RepaymentAmount = newloan.RepaymentAmount,
                Deleted         = false
            };

            return(await _loanRepository.AddNewLoan(loan));
        }
Пример #9
0
        public async Task CreateNewLoan()
        {
            var newLoan = new NewLoan
            {
                BorrowerName    = "Test New Loan",
                FundingAmount   = 500,
                RepaymentAmount = 600
            };

            var result = await _controller.Create(newLoan) as ObjectResult;

            var actualResult = (Loan)result.Value;

            _repo.Verify(x => x.AddNewLoan(It.IsAny <Loan>()), Times.Once);

            Assert.IsType <OkObjectResult>(result);
            Assert.Equal(newLoan.BorrowerName, actualResult.BorrowerName);
        }
Пример #10
0
Файл: Loan.cs Проект: igprog/kup
    private void UpdateActiveLoan(NewLoan x)
    {
        //Provjeri dali postoji aktivna pozajmica
        string sql    = null;
        string loanId = null;

        sql = string.Format(@"SELECT id FROM Loan WHERE userId = '{0}' AND isRepaid = 0", x.user.id);
        using (SqlConnection connection = new SqlConnection(g.connectionString)) {
            connection.Open();
            using (SqlCommand command = new SqlCommand(sql, connection)) {
                using (SqlDataReader reader = command.ExecuteReader()) {
                    while (reader.Read())
                    {
                        loanId = reader.GetValue(0) == DBNull.Value ? null : reader.GetString(0);
                    }
                }
            }
            connection.Close();
        }

        //sql = string.Format(@"BEGIN TRAN
        //                        BEGIN
        //                            INSERT INTO Account (id, userId, amount, recordDate, mo, yr, recordType, loanId, note)
        //                            VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}')
        //                            UPDATE Loan SET isRepaid = 1 WHERE id = '{9}'
        //                        END
        //                    COMMIT TRAN", Guid.NewGuid().ToString(), x.user.id, x.user.restToRepayment, x.loanDate, g.GetMonth(x.loanDate), g.GetYear(x.loanDate), g.loan, x.id, "Otplata novom pozajmicom", loanId);

        sql = string.Format(@"BEGIN TRAN
                                BEGIN
                                    INSERT INTO Account (id, userId, amount, recordDate, mo, yr, recordType, loanId, note)
                                    VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}')
                                    UPDATE Loan SET isRepaid = 1 WHERE id = '{9}'
                                END
                            COMMIT TRAN", Guid.NewGuid().ToString(), x.user.id, x.restToRepayment, x.loanDate, g.GetMonth(x.loanDate), g.GetYear(x.loanDate), g.loan, x.id, "Otplata novom pozajmicom", loanId);

        using (SqlConnection connection = new SqlConnection(g.connectionString)) {
            connection.Open();
            using (SqlCommand command = new SqlCommand(sql, connection)) {
                command.ExecuteNonQuery();
            }
            connection.Close();
        }
    }
Пример #11
0
Файл: Loan.cs Проект: igprog/kup
    public Loans LoadData(int?month, int year, string buisinessUnitCode, string search)
    {
        db.Loan();
        string sql = string.Format(@"SELECT l.id, l.userId, l.loan, l.loanDate, l.repayment, l.manipulativeCosts, l.withdraw, l.dedline, l.isRepaid, l.note, u.firstName, u.lastName, b.code, b.title FROM Loan l
                    LEFT OUTER JOIN Users u
                    ON l.userId = u.id
                    LEFT OUTER JOIN BuisinessUnit b
                    ON u.buisinessUnitCode = b.code
                    WHERE {0} {1} {2}"
                                   , string.Format("CONVERT(datetime, l.loanDate) >= '{0}' AND CONVERT(datetime, l.loanDate) < '{1}'", g.ReffDate(month == null ? 1 : month, year), g.ReffDate(month == null ? 12 : month + 1, year))
                                   , string.IsNullOrEmpty(buisinessUnitCode) ? "" : string.Format("AND u.buisinessUnitCode = '{0}'", buisinessUnitCode)
                                   , string.IsNullOrEmpty(search) ? "" : string.Format("AND u.id LIKE '%{0}%' OR u.firstName LIKE N'{0}%' OR u.lastName LIKE N'{0}%'", search));
        Loans xx = new Loans();

        xx.data = new List <NewLoan>();
        using (SqlConnection connection = new SqlConnection(g.connectionString)) {
            connection.Open();
            using (SqlCommand command = new SqlCommand(sql, connection)) {
                using (SqlDataReader reader = command.ExecuteReader()) {
                    while (reader.Read())
                    {
                        NewLoan x = ReadData(reader);
                        xx.data.Add(x);
                    }
                }
            }
            connection.Close();
        }

        xx.data                    = xx.data.OrderBy(a => a.user.lastName).ToList();
        xx.total                   = new Total();
        xx.total.loan              = xx.data.Sum(a => a.loan);
        xx.total.repayment         = xx.data.Sum(a => a.repayment);
        xx.total.manipulativeCosts = xx.data.Sum(a => a.manipulativeCosts);
        xx.total.actualLoan        = xx.data.Sum(a => a.actualLoan);
        xx.total.withdraw          = xx.data.Sum(a => a.withdraw);
        xx.total.lastLoanToRepaid  = xx.total.actualLoan - xx.total.withdraw;
        xx.total.restToRepayment   = xx.data.Sum(a => a.restToRepayment);
        xx.monthlyTotal            = new List <MonthlyTotal>();
        xx.monthlyTotal            = GetMonthlyTotal(xx.data);
        return(xx);
    }
Пример #12
0
Файл: Loan.cs Проект: igprog/kup
    public double GetTotalLoan(NewLoan x)
    {
        string sql = string.Format(@"SELECT SUM(CONVERT(decimal, l.loan)) FROM Loan l WHERE CONVERT(datetime, l.loanDate) <= CONVERT(datetime, '{0}') AND l.userId = '{1}'"
                                   , x.loanDate, x.user.id);
        double amount = 0;

        using (SqlConnection connection = new SqlConnection(g.connectionString)) {
            connection.Open();
            using (SqlCommand command = new SqlCommand(sql, connection)) {
                using (SqlDataReader reader = command.ExecuteReader()) {
                    while (reader.Read())
                    {
                        amount = reader.GetValue(0) == DBNull.Value ? 0 : Convert.ToDouble(reader.GetDecimal(0));
                    }
                }
            }
            connection.Close();
        }
        return(amount);
    }
Пример #13
0
Файл: Loan.cs Проект: igprog/kup
    public double GetTotalLoanRepayed(NewLoan x)
    {
        string sql = string.Format(@"SELECT SUM(CONVERT(decimal, a.amount)) FROM Account a LEFT OUTER JOIN Loan l ON l.id = a.loanId
                                    WHERE CONVERT(datetime, l.loanDate) <= CONVERT(datetime, '{0}') AND (a.recordType = '{1}' OR a.recordType = '{2}') AND a.userId = '{3}'"
                                   , x.loanDate, g.repayment, g.loan, x.user.id);
        double amount = 0;

        using (SqlConnection connection = new SqlConnection(g.connectionString)) {
            connection.Open();
            using (SqlCommand command = new SqlCommand(sql, connection)) {
                using (SqlDataReader reader = command.ExecuteReader()) {
                    while (reader.Read())
                    {
                        amount = reader.GetValue(0) == DBNull.Value ? 0 : Convert.ToDouble(reader.GetDecimal(0));
                    }
                }
            }
            connection.Close();
        }
        return(amount);
    }
Пример #14
0
Файл: Loan.cs Проект: igprog/kup
    public string Init()
    {
        NewLoan x = new NewLoan();

        x.id                = null; // Guid.NewGuid().ToString();
        x.user              = new User.NewUser();
        x.loan              = 0;
        x.loanDate          = null; // g.Date(DateTime.Now);
        x.repayment         = 0;
        x.manipulativeCosts = 0;
        //x.actualLoan = 0;
        x.withdraw                 = 0;
        x.dedline                  = s.Data().defaultDedline;
        x.restToRepayment          = 0;
        x.isRepaid                 = 0;
        x.note                     = null;
        x.manipulativeCostsCoeff   = s.Data().manipulativeCostsCoeff;
        x.includeManipulativeCosts = true;
        x.repaidOldDebt            = true;
        x.buisinessUnit            = new BuisinessUnit.NewUnit();
        return(JsonConvert.SerializeObject(x, Formatting.None));
    }
        public void Loan_Creation(IDictionary <string, string> data)
        {
            MasterData     = new objMasterData(data);
            className      = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name;
            testMethodName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            //MasterData.TestResultPathStem = string.Format(FileUtilities.DefaultTestResultDirectory, className);
            MasterData.TestResultPathStem = string.Format("{0}\\{1}\\{2}\\{3} - {4}", FileUtilities.DefaultTestResultDirectory_ShareDrive, className, testMethodName, Environment.UserName, runTime);
            path = string.Format("{0}\\{1}.html", MasterData.TestResultPathStem, TestReportName);

            if (!Directory.Exists(string.Format("{0}", MasterData.TestResultPathStem)))
            {
                Directory.CreateDirectory(string.Format("{0}", MasterData.TestResultPathStem));
            }

            if (BaseTest.HtmlReport == null)
            {
                InitializeExtentReports(path, TestReportName);
            }

            BaseTest.extentTest = ExtentReport.CreateTest(runTime);

            string StepDetails = string.Format("Smoke Test");
            bool   StepStatus  = true;
            string MethodName  = System.Reflection.MethodBase.GetCurrentMethod().Name;

            try
            {
                LaunchApplication(DesktopApps.Encompass);

                Launcher
                .Initialize()
                .cmb_EnvironmentID_SelectByText(MasterData.EnvironmentID)
                .btn_Login_Click();

                extentTest.Pass("Launched Encompass environment " + MasterData.EnvironmentID, MediaEntityBuilder.CreateScreenCaptureFromPath(Screenshot.TakeScreenShot(Screenshot.TakeSS_FullDesktop(), string.Format(MasterData.TestID + "_Launch"), true)).Build());

                AttachToProcess(Processes.Encompass, 5);

                Login
                .Initialize()
                .txt_Username_SendKeys("test_qa_lo")
                .txt_Password_SendKeys("P@ramount1")
                .btn_Login_Click();

                extentTest.Pass("Logged in as Loan Officer, test_qa_lo", MediaEntityBuilder.CreateScreenCaptureFromPath(Screenshot.TakeScreenShot(Screenshot.TakeSS_FullDesktop(), string.Format(MasterData.TestID + "_Login"), true)).Build());

                Thread.Sleep(10000); EncompassMain.Initialize().Resize().tab_Pipeline_Select(); Pipeline.Initialize().btn_NewLoan_Click();

                NewLoan
                .Initialize()
                .cmb_LoanTemplateFolder_SelectByText("PEM Direct")
                .SelectItem_DirectConvRefinance();

                extentTest.Pass("Created new Direct Conventional Refinance loan from Pipeline", MediaEntityBuilder.CreateScreenCaptureFromPath(Screenshot.TakeScreenShot(Screenshot.TakeSS_FullDesktop(), string.Format(MasterData.TestID + "_LoanTemplate"), true)).Build());

                FormsTab.Initialize().chk_Show_Check(true).chk_ShowInAlpha_Check(true);

                TestConsole.OpenForm_FromFormsTab().btn_CreateNewLoan_Click(MasterData.LoanCreator); EncompassDialog.Initialize().btn_OK_Click();

                CreditReport.Initialize().lstbx_Provider_Select("Equifax Mortgage Solutions").btn_Submit_Click();

                CreditReportRequest
                .Initialize()
                .txt_UserName_SendKeys("PARAMOUNTIT")
                .txt_Password_SendKeys("P@ramount2")
                .chk_SaveLoginInformation_Check(true)
                .chk_Equifax_Check(true)
                .chk_Experian_Check(true)
                .chk_TransUnion_Check(true)
                .btn_Finish_Click();

                EncompassMain.Initialize().tab_ServicesView_Select(); extentTest.Pass("Credit Report successfully generated", MediaEntityBuilder.CreateScreenCaptureFromPath(Screenshot.TakeScreenShot(Screenshot.TakeSS_FullDesktop(), string.Format(MasterData.TestID + "_CreditReport"), true)).Build()); Thread.Sleep(500); EncompassMain.Initialize().tab_Loan_Select();

                TestConsole
                .Initialize()
                .rdb_NoCashOutRefi_Select()
                .rdb_Direct_Select()
                .txt_BorrowerEmail_SendKeys(MasterData.BorrowerEmail);

                TestConsole.Initialize().btn_BLSCertification_Click(); QuickEntryBankerLoanSubmission.Initialize().ScrollDown().btn_BankerCertificationBLS_Click(); extentTest.Pass("Banker Loan Submission Form certified", MediaEntityBuilder.CreateScreenCaptureFromPath(Screenshot.TakeScreenShot(Screenshot.TakeSS_FullDesktop(), string.Format(MasterData.TestID + "_BLS"), true)).Build()); QuickEntryBankerLoanSubmission.Initialize().btn_Close_Click();

                TestConsole
                .Initialize()
                .txt_SubjectProperty_Address_SendKeys(MasterData.Address)
                .txt_SubjectProperty_City_SendKeys(MasterData.City)
                .txt_SubjectProperty_State_SendKeys(MasterData.State)
                .txt_SubjectProperty_County_SendKeys(MasterData.County)
                .txt_SubjectProperty_ZipCode_SendKeys(MasterData.Zip);

                BorrowerSummary.OpenForm_FromFormsTab(); Thread.Sleep(500); extentTest.Pass("Borrower Summary successfully completed with Borrower email address " + MasterData.BorrowerEmail, MediaEntityBuilder.CreateScreenCaptureFromPath(Screenshot.TakeScreenShot(Screenshot.TakeSS_FullDesktop(), string.Format(MasterData.TestID + "_BorrowerSummary"), true)).Build());

                URLA_Page1.OpenForm_FromFormsTab(); Thread.Sleep(2000); extentTest.Pass("1003 Page 1 successfully completed with address " + MasterData.Address + ", " + MasterData.City + ", " + MasterData.State + ", " + MasterData.Zip + " (" + MasterData.County + " County)", MediaEntityBuilder.CreateScreenCaptureFromPath(Screenshot.TakeScreenShot(Screenshot.TakeSS_FullDesktop(), string.Format(MasterData.TestID + "_1003Page1"), true)).Build());

                URLA_Page2.OpenForm_FromFormsTab(); Thread.Sleep(2000); extentTest.Pass("1003 Page 2 successfully completed", MediaEntityBuilder.CreateScreenCaptureFromPath(Screenshot.TakeScreenShot(Screenshot.TakeSS_FullDesktop(), string.Format(MasterData.TestID + "_1003Page2"), true)).Build());

                URLA_Page3.OpenForm_FromFormsTab(); Thread.Sleep(2000); extentTest.Pass("1003 Page 3 successfully completed", MediaEntityBuilder.CreateScreenCaptureFromPath(Screenshot.TakeScreenShot(Screenshot.TakeSS_FullDesktop(), string.Format(MasterData.TestID + "_1003Page3"), true)).Build());

                FormsTab.Initialize().lstbx_Forms_SelectForm("VOE"); Thread.Sleep(1000); extentTest.Pass("Verification of Employment successfully completed", MediaEntityBuilder.CreateScreenCaptureFromPath(Screenshot.TakeScreenShot(Screenshot.TakeSS_FullDesktop(), string.Format(MasterData.TestID + "_VOE"), true)).Build());

                FormsTab.Initialize().lstbx_Forms_SelectForm("VOD"); Thread.Sleep(1000); extentTest.Pass("Verification of Depository successfully completed", MediaEntityBuilder.CreateScreenCaptureFromPath(Screenshot.TakeScreenShot(Screenshot.TakeSS_FullDesktop(), string.Format(MasterData.TestID + "_VOD"), true)).Build());

                TransmittalSummary.OpenForm_FromFormsTab(); Thread.Sleep(1000); extentTest.Pass("Transmittal Summary successfully completed", MediaEntityBuilder.CreateScreenCaptureFromPath(Screenshot.TakeScreenShot(Screenshot.TakeSS_FullDesktop(), string.Format(MasterData.TestID + "_TransmittalSum"), true)).Build());

                #region eConsent

                eConsentNotYetReceived.Open_FromAlertsandMessagesTab().btn_Request_eConsent_Click();

                SendConsent
                .Initialize()
                .chk_BorrowerConsent_Check(true)
                .chk_NotifyWhenBorrowerReceives_Check(true)
                .btn_Send_Click();

                BaseSeleniumPage.CreateDriver(BaseSeleniumPage.WebDrivers.Chrome); BaseSeleniumPage.NavigateToURL(@"https://www.mortgage-application.net/myaccount/accountlogin.aspx");

                BorrowerLoanCenterLogIn.Initialize()
                .txt_Email_SendKeys("*****@*****.**")
                .txt_Password_SendKeys("P@ramount1")
                .btn_Login_Click();

                CheckLoanStatus.Initialize().fn_SelectFirstRow();

                //LoanDetail.Initialize().btn_View_Click();

                AgreeToReceiveDisclosuresElectronically.Initialize().btn_Agree_Click(); BaseSeleniumPage.CloseDriver();

                eConsentNotYetReceived.Initialize().btn_View_eConsent_Click();

                extentTest.Pass("eConsent accepted", MediaEntityBuilder.CreateScreenCaptureFromPath(Screenshot.TakeScreenShot(Screenshot.TakeSS_FullDesktop(), string.Format(MasterData.TestID + "_eConsentAccepted"), true)).Build());

                #endregion eConsent

                #region Product and Pricing

                OB_ProductandPricing.OpenFrom_MainMenu().lstbx_Provider_Select("Optimal Blue - Enhanced").btn_Submit_Click();

                OB_Login
                .Initialize()
                .txt_LoginName_SendKeys(MasterData.OB_Login)
                .txt_Password_SendKeys(MasterData.OB_Password)
                .chk_SaveLoginInformation_Check(true)
                .chk_UpdateUpfrontMIdataforFHAloans_Check(true)
                .btn_Continue_Click();

                OB_ProductSearch.Initialize().btn_Submit_Click(); extentTest.Pass("Loan is ready to execute pricing through Optimal Blue", MediaEntityBuilder.CreateScreenCaptureFromPath(Screenshot.TakeScreenShot(Screenshot.TakeSS_FullDesktop(), string.Format(MasterData.TestID + "_Pricing"), true)).Build());

                #endregion Run Product and Pricing
            }

            catch (Exception ex)
            {
                StepStatus = false;
                BaseTest.ExtentFailStep(ex, StepDetails, "ErrorOccured");
                //step.ModalText = ex.ToString();
                //step.Status = "Fail";
                //step.ScreenShotLocation = Screenshot.TakeScreenShot(Screenshot.TakeSS_FullDesktop(), string.Format("Failure\\{0}", System.Reflection.MethodBase.GetCurrentMethod().Name));
                Assert.Fail(ex.ToString());
            }
            finally
            {
                if (StepStatus)
                {
                    extentTest.Pass("Test Passed - reached the end of script");
                }
                //Report.addStep(step);
            }
        }