Exemplo n.º 1
0
        // GET: Quote
        public ActionResult GenerateQuote()
        {
            QuoteDetails qt = new QuoteDetails();

            qt.custList = _ICustomerDetails.GetCustomerList();
            return(View(qt));
        }
Exemplo n.º 2
0
    private void LoadQuoteDetails(string strQuoteNo)
    {
        QuoteDetailsHandler objQuoteHandler = new QuoteDetailsHandler();
        QuoteDetails        objQuote        = objQuoteHandler.GetQuotesByNumber(strQuoteNo);

        Session["QuoteID"] = objQuote.ID;

        lblEffective.Text  = objQuote.Effective_Date.ToString("dd/MM/yyyy");
        lblQuote.Text      = Convert.ToString(objQuote.QuoteNo);
        lblExpiration.Text = objQuote.Expiration_Date.ToString("dd/MM/yyyy");

        ddlState.SelectedValue = Convert.ToString(objQuote.Home_State_ID);
        txtZip.Text            = Convert.ToString(objQuote.ZipCode);

        string strQuoteMode = Convert.ToString(Session["QuoteMode"]);

        //string strQuoteNo = Convert.ToString(Session["QuoteNo"]);
        if (strQuoteMode == "EDIT")
        {
            int quoteID = Convert.ToInt32(Session["QuoteID"]);
            vwClassDetailsHandler objvwClsHandler = new vwClassDetailsHandler();
            vwClassDetails        objvwCls        = objvwClsHandler.GetClassDetailsByQuoteID(quoteID);
            try
            {
                ddlTerritory.SelectedValue = Convert.ToString(objvwCls.Territory_ID);
            }
            catch
            { }
        }
    }
Exemplo n.º 3
0
        public ListResultDto <QuoteDetailDto> GetQuotes(GetQuoteInput input)
        {
            int Id = Convert.ToInt32(input.Filter);

            var quotes = _quotedetailsrepository.GetAll().Where(p => p.QuoteId == Id && p.tenantid == _abpSession.TenantId && p.IsDeleted.Equals(false) && p.QuoteStatusId == input.StatusId).ToList();

            if (quotes.Count == 0)
            {
                var aa = new QuoteDetails();
                aa.QuoteStatusId = 0;
                aa.IsCompleted   = false;
                aa.QuoteId       = Id;
                aa.QLocation     = "";
                aa.QAction       = "";
                aa.Description   = "";
                aa.Part          = "";
                quotes           = new List <QuoteDetails>();
                quotes.Add(aa);
            }
            var finalquery      = new ListResultDto <QuoteDetailDto>(ObjectMapper.Map <List <QuoteDetailDto> >(quotes));
            var EstimatedValues = _quotemasterrepository.FirstOrDefault(p => p.Id == Id && p.TenantId == _abpSession.TenantId);

            if (EstimatedValues != null)
            {
                finalquery.Items[0].RepairerEstimatedDays = EstimatedValues.RepairerEstimatedDays;
            }
            return(finalquery);
        }
Exemplo n.º 4
0
        /// <summary>
        /// GetNextNumber
        /// Calls [usp_select_Quote_NextNumber]
        /// </summary>
        public override QuoteDetails GetNextNumber(System.Int32?clientNo, System.Int32?updatedBy)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try {
                cn                 = new SqlConnection(this.ConnectionString);
                cmd                = new SqlCommand("usp_select_Quote_NextNumber", cn);
                cmd.CommandType    = CommandType.StoredProcedure;
                cmd.CommandTimeout = 30;
                cmd.Parameters.Add("@ClientNo", SqlDbType.Int).Value      = clientNo;
                cmd.Parameters.Add("@UpdatedBy", SqlDbType.Int).Value     = updatedBy;
                cmd.Parameters.Add("@NewNumber", SqlDbType.Int).Direction = ParameterDirection.Output;
                cn.Open();
                DbDataReader reader = ExecuteReader(cmd, CommandBehavior.SingleRow);
                if (reader.Read())
                {
                    //return GetQuoteFromReader(reader);
                    QuoteDetails obj = new QuoteDetails();
                    obj.QuoteNumber = GetReaderValue_Int32(reader, "QuoteNumber", 0);
                    return(obj);
                }
                else
                {
                    return(null);
                }
            } catch (SqlException sqlex) {
                //LogException(sqlex);
                throw new Exception("Failed to get Quote", sqlex);
            } finally {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
Exemplo n.º 5
0
        public void ThenEnterIntoThePartOfTheForm(Table table)
        {
            webdriverX.CreateQuestionAndAnswers(table.ToQuestionAndAnswers());
            var QnAs = webdriverX._QnAs;

            if (UseQueue != "true")
            {
                quoteDetails = table.CreateInstance <QuoteDetails>();
            }

            webdriverX.FindElement("What's your house number or name?").SendKeys(quoteDetails.WhatsYourHouseNumberOrName);
            webdriverX.FindElement("What's your postcode?").SendKeys(quoteDetails.WhatsYourPostcode);
            webdriverX.Focus("What's your house number or name?");

            quoteDetails.FullAddress = webdriverX.FindElement("What's the address that you'd like to insure?").GetTextFromDDL(1);

            if (webdriverX.DoesElementExist("What's the address that you'd like to insure?"))
            {
                webdriverX.FindElement("What's the address that you'd like to insure?").SelectByIndex(1);
            }

            webdriverX.FindElement("Do you own or rent your home?", QnAs.GetAnswer("Do you own or rent your home?")).Click();
            webdriverX.FindElement("What would you like to insure?", QnAs.GetAnswer("What would you like to insure?")).Click();

            webdriverX.FindElement("What is your day of birth?").SendKeys(quoteDetails.WhatIsYourDateOfBirth.Split('/')[0]);
            webdriverX.FindElement("What is your month of birth?").SendKeys(quoteDetails.WhatIsYourDateOfBirth.Split('/')[1]);
            webdriverX.FindElement("What is your year of birth?").SendKeys(quoteDetails.WhatIsYourDateOfBirth.Split('/')[2]);

            webdriverX.FindElement("Would you like to insure any laptops or bikes?", QnAs.GetAnswer("Would you like to insure any laptops or bikes?")).Click();

            webdriverX.FindElement("Would you like to insure any items worth over £1000 each?", QnAs.GetAnswer("Would you like to insure any items worth over £1000 each?")).Click();
            webdriverX.FindElement("How much would it cost to replace the entire contents of your home?").SendKeys(QnAs.GetAnswer("How much would it cost to replace the entire contents of your home?"));
            webdriverX.FindElement("Would you like to insure any personal possessions you take out with you?", table.Rows[8][1]).Click();
        }
Exemplo n.º 6
0
    private void LoadQuoteDetails(string strQuoteNo)
    {
        QuoteDetailsHandler objQuoteHandler = new QuoteDetailsHandler();
        QuoteDetails        objQuote        = objQuoteHandler.GetQuotesByNumber(strQuoteNo);

        Session["QuoteID"] = objQuote.ID;

        lblEffective.Text  = objQuote.Effective_Date.ToString("dd/MM/yyyy");
        lblQuote.Text      = Convert.ToString(objQuote.QuoteNo);
        lblExpiration.Text = objQuote.Expiration_Date.ToString("dd/MM/yyyy");

        ddlState.SelectedValue = Convert.ToString(objQuote.Home_State_ID);
        txtZip.Text            = Convert.ToString(objQuote.ZipCode);
        txtCity.Text           = Convert.ToString(objQuote.City);
        txtAddress1.Text       = Convert.ToString(objQuote.Mailing_Address1);
        txtAddress2.Text       = Convert.ToString(objQuote.Mailing_Address2);
        ddlState.SelectedValue = Convert.ToString(objQuote.Home_State_ID);
        int quoteID = Convert.ToInt32(Session["QuoteID"]);
        //string strQuoteMode = Convert.ToString(Session["QuoteMode"]);
        //string strQuoteNo = Convert.ToString(Session["QuoteNo"]);
        //if (strQuoteMode == "EDIT")
        //{
        //    vwPropertyHandler objPropertyhandler = new vwPropertyHandler();

        //    vwProperty objvwProperty = objPropertyhandler.GetDetailsByQuoteNo(strQuoteNo);
        //    if (objvwProperty != null)
        //    {

        //    }
        //}
    }
        private decimal calculateMaturityAmount(QuoteDetails quoteDetails)
        {
            decimal factor = 0;

            if (quoteDetails.PensionPlan == PensionPlans.PensionSilver)
            {
                factor = Convert.ToDecimal(0.02);
            }
            else if (quoteDetails.PensionPlan == PensionPlans.PensionGold)
            {
                factor = Convert.ToDecimal(0.04);
            }
            else if (quoteDetails.PensionPlan == PensionPlans.PensionPlatinum)
            {
                factor = Convert.ToDecimal(0.06);
            }

            int currentAge = DateTime.Now.Year - quoteDetails.DateOfBirth.Year;

            if (DateTime.Now.DayOfYear < quoteDetails.DateOfBirth.DayOfYear)
            {
                currentAge = currentAge - 1;
            }

            return(quoteDetails.InvestmentAmount * (1 + factor) * (quoteDetails.RetirementAge - currentAge) / 100);
        }
Exemplo n.º 8
0
        /// <summary>
        /// GetListForSourcingResult
        /// Calls [usp_selectAll_Quote_for_SourcingResult]
        /// </summary>
        public override List <QuoteDetails> GetListForSourcingResult(System.Int32?sourcingResultNo)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try {
                cn                 = new SqlConnection(this.ConnectionString);
                cmd                = new SqlCommand("usp_selectAll_Quote_for_SourcingResult", cn);
                cmd.CommandType    = CommandType.StoredProcedure;
                cmd.CommandTimeout = 30;
                cmd.Parameters.Add("@SourcingResultNo", SqlDbType.Int).Value = sourcingResultNo;
                cn.Open();
                DbDataReader        reader = ExecuteReader(cmd);
                List <QuoteDetails> lst    = new List <QuoteDetails>();
                while (reader.Read())
                {
                    QuoteDetails obj = new QuoteDetails();
                    obj.QuoteId     = GetReaderValue_Int32(reader, "QuoteId", 0);
                    obj.QuoteNumber = GetReaderValue_Int32(reader, "QuoteNumber", 0);
                    lst.Add(obj);
                    obj = null;
                }
                return(lst);
            } catch (SqlException sqlex) {
                //LogException(sqlex);
                throw new Exception("Failed to get Quotes", sqlex);
            } finally {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// GetListForCompany
        /// Calls [usp_selectAll_Quote_for_Company]
        /// </summary>
        public override List <QuoteDetails> GetListForCompany(System.Int32?companyId, System.Boolean?includeClosed)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try {
                cn                 = new SqlConnection(this.ConnectionString);
                cmd                = new SqlCommand("usp_selectAll_Quote_for_Company", cn);
                cmd.CommandType    = CommandType.StoredProcedure;
                cmd.CommandTimeout = 30;
                cmd.Parameters.Add("@CompanyId", SqlDbType.Int).Value     = companyId;
                cmd.Parameters.Add("@IncludeClosed", SqlDbType.Bit).Value = includeClosed;
                cn.Open();
                DbDataReader        reader = ExecuteReader(cmd);
                List <QuoteDetails> lst    = new List <QuoteDetails>();
                while (reader.Read())
                {
                    QuoteDetails obj = new QuoteDetails();
                    obj.QuoteId             = GetReaderValue_Int32(reader, "QuoteId", 0);
                    obj.ClientNo            = GetReaderValue_Int32(reader, "ClientNo", 0);
                    obj.QuoteNumber         = GetReaderValue_Int32(reader, "QuoteNumber", 0);
                    obj.Notes               = GetReaderValue_String(reader, "Notes", "");
                    obj.Instructions        = GetReaderValue_String(reader, "Instructions", "");
                    obj.CompanyNo           = GetReaderValue_Int32(reader, "CompanyNo", 0);
                    obj.ContactNo           = GetReaderValue_Int32(reader, "ContactNo", 0);
                    obj.DateQuoted          = GetReaderValue_DateTime(reader, "DateQuoted", DateTime.MinValue);
                    obj.CurrencyNo          = GetReaderValue_Int32(reader, "CurrencyNo", 0);
                    obj.Salesman            = GetReaderValue_Int32(reader, "Salesman", 0);
                    obj.TermsNo             = GetReaderValue_NullableInt32(reader, "TermsNo", null);
                    obj.DivisionNo          = GetReaderValue_Int32(reader, "DivisionNo", 0);
                    obj.Freight             = GetReaderValue_NullableDouble(reader, "Freight", null);
                    obj.Closed              = GetReaderValue_NullableBoolean(reader, "Closed", null);
                    obj.UpdatedBy           = GetReaderValue_NullableInt32(reader, "UpdatedBy", null);
                    obj.DLUP                = GetReaderValue_DateTime(reader, "DLUP", DateTime.MinValue);
                    obj.IncotermNo          = GetReaderValue_NullableInt32(reader, "IncotermNo", null);
                    obj.CompanyName         = GetReaderValue_String(reader, "CompanyName", "");
                    obj.CompanyOnStop       = GetReaderValue_NullableBoolean(reader, "CompanyOnStop", null);
                    obj.CompanySOApproved   = GetReaderValue_NullableBoolean(reader, "CompanySOApproved", null);
                    obj.ContactName         = GetReaderValue_String(reader, "ContactName", "");
                    obj.CurrencyCode        = GetReaderValue_String(reader, "CurrencyCode", "");
                    obj.CurrencyDescription = GetReaderValue_String(reader, "CurrencyDescription", "");
                    obj.SalesmanName        = GetReaderValue_String(reader, "SalesmanName", "");
                    obj.DivisionName        = GetReaderValue_String(reader, "DivisionName", "");
                    obj.QuoteValue          = GetReaderValue_NullableDouble(reader, "QuoteValue", null);
                    obj.TermsName           = GetReaderValue_String(reader, "TermsName", "");
                    obj.OpenLines           = GetReaderValue_NullableInt32(reader, "OpenLines", null);
                    obj.IncotermName        = GetReaderValue_String(reader, "IncotermName", "");
                    lst.Add(obj);
                    obj = null;
                }
                return(lst);
            } catch (SqlException sqlex) {
                //LogException(sqlex);
                throw new Exception("Failed to get Quotes", sqlex);
            } finally {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
        public async Task <QuoteDetails> PostQuoteDetails(QuoteDetails quoteDetails)
        {
            quoteDetails.MaturityAmount = calculateMaturityAmount(quoteDetails);
            _context.QuoteDetails.Add(quoteDetails);
            await _context.SaveChangesAsync();

            return(quoteDetails);
        }
        public async Task <QuoteDetails> PutQuoteDetails(int id, QuoteDetails quoteDetails)
        {
            quoteDetails.MaturityAmount        = calculateMaturityAmount(quoteDetails);
            _context.Entry(quoteDetails).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(quoteDetails);
        }
        public QuoteDetails CreateQuote(QuoteDetails quoteDetails)
        {
            quoteDetails.MaturityAmount = MaturityCalculation.CalculateMaturityAmount(quoteDetails);
            var quote = _repo.Quote.Insert(quoteDetails);

            _repo.Customer.Save();
            return(quote);
        }
        public QuoteDetails UpdateQuote(QuoteDetails quoteDetails)
        {
            quoteDetails.MaturityAmount = MaturityCalculation.CalculateMaturityAmount(quoteDetails);
            var updatedQuote = _repo.Quote.Update(quoteDetails);

            _repo.Quote.Save();
            return(updatedQuote);
        }
Exemplo n.º 14
0
        public void ThenEnterIntoThePart3Section1OfTheForm(Table table)
        {
            webdriverX.CreateQuestionAndAnswers(table.ToQuestionAndAnswers());
            var QnAs = webdriverX._QnAs;

            if (UseQueue != "true")
            {
                quoteDetails = table.CreateInstance <QuoteDetails>();
            }

            webdriverX.Question("What's your first name?").SendKeys(quoteDetails.WhatsYourFirstName);
            webdriverX.FindElement("And your last name?").SendKeys(quoteDetails.AndYourLastName);
            webdriverX.FindElement("What's your email address?").SendKeys(quoteDetails.WhatsYourEmailAddress);

            webdriverX.Focus("And your last name?");

            if (webdriverX.DoesElementExist("Please confirm your email address"))
            {
                webdriverX.FindElement("Please confirm your email address").SendKeys(quoteDetails.WhatsYourEmailAddress);
            }

            webdriverX.FindElement("Please choose a password").Focus().SendKeys(quoteDetails.PleaseChooseAPassword);

            if (webdriverX.DoesElementExist("Please re-enter your password"))
            {
                webdriverX.FindElement("Please re-enter your password").SendKeys(quoteDetails.PleaseChooseAPassword);
            }

            webDriver.ClickIfElementExist("//*[@id='policyHolder.password']//button[contains(.,'Sign in')]".ToByXpath());

            webDriver.ClickIfElementExist("//input[@type='checkbox'][@class='checkbox__input ng-valid ng-dirty ng-valid-parse ng-touched ng-not-empty']".ToByXpath());
            webDriver.ClickIfElementExist("//input[@type='checkbox'][@class='checkbox__input ng-pristine ng-untouched ng-valid ng-not-empty']".ToByXpath());
            webdriverX.FindElement("What is your gender?", quoteDetails.WhatIsYourGender).Click();
            webdriverX.FindElement("What is your relationship status?", table.Rows[7][1]).Click();
            webdriverX.FindElement("What do you do?", table.Rows[8][1]).Click();
            webdriverX.FindElement("What job do you do?", table.Rows[9][1]).ClearAndSendKeys(table.Rows[9][1]);
            webdriverX.FindElement("Which industry do you work in?").ClearAndSendKeys(table.Rows[10][1]);
            webdriverX.FindElement("Do you do any other work?", table.Rows[11][1]).Click();
            webdriverX.FindElement("Have you lived in the UK since you were born?", table.Rows[12][1]).Click();
            webdriverX.FindElement("Would you like this to be a joint policy?", table.Rows[13][1]).Click();
            webdriverX.FindElement("When would you like the policy to start?").ClickAndSelectByIndex(int.Parse(table.Rows[14][1]));
            webdriverX.FindElement("How do you normally pay for your home insurance?", table.Rows[15][1]).Click();
            webdriverX.FindElement("How many years of no claims discount do you have for buildings insurance?").ClickAndSelectByText(table.Rows[16][1]);
            webdriverX.FindElement("How many years of no claims discount do you have for contents insurance?").ClickAndSelectByText(table.Rows[17][1]);

            if (webdriverX.DoesElementExist("Would you like the two insurance companies with the best prices to contact you to discuss your quote?", table.Rows[18][1]))
            {
                webdriverX.FindElement("Would you like the two insurance companies with the best prices to contact you to discuss your quote?", table.Rows[18][1]).Click();
            }

            if (webdriverX.DoesElementExist("Would you like us to remember you on this device for 13 months?", table.Rows[11][1]))
            {
                webdriverX.FindElement("Would you like us to remember you on this device for 13 months?", table.Rows[11][1]).Click();
            }
        }
Exemplo n.º 15
0
        public async Task <ActionResult <QuoteDetails> > PutQuoteDetails(int id, QuoteDetails quoteDetails)
        {
            if (id != quoteDetails.ClientID)
            {
                return(BadRequest());
            }

            await _service.PutQuoteDetails(id, quoteDetails);

            return(Ok(new { id = quoteDetails.ClientID }));
        }
        public IActionResult Post([FromBody] QuoteDetails quoteDetails)
        {
            if (quoteDetails.StartDate > quoteDetails.EndDate)
            {
                return(BadRequest("Start date cannot be future date"));
            }
            var isCustomerAvailable = _customerService.IsCustomerRegistered(quoteDetails.CustomerId);

            if (isCustomerAvailable)
            {
                var quoteDetail = _quoteService.CreateQuote(quoteDetails);
                return(StatusCode((int)HttpStatusCode.Created, $"Quote has been created succesfully for the customer. Quote Id : {quoteDetail.Id} and Maturity amount : {quoteDetail.MaturityAmount}"));
            }
            return(StatusCode((int)HttpStatusCode.NotFound, $"There is no cutomer available with customer Id : {quoteDetails.CustomerId} to create quote"));
        }
Exemplo n.º 17
0
        public void PricingModule()
        {
            QuoteDetails quote = new QuoteDetails
            {
                DateRequested    = DateTime.Today,
                GallonsRequested = 1500,
                quoteHistory     = 1,
                State            = "TX"
            };

            float actual = 2610.0f;

            PricingModule p     = new PricingModule();
            Price         price = p.GetPrice(quote);

            Assert.Equal(price.TotalAmount, actual);
        }
Exemplo n.º 18
0
        /// <summary>
        /// GetForPage
        /// Calls [usp_select_Quote_for_Page]
        /// </summary>
        public override QuoteDetails GetForPage(System.Int32?quoteId)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try {
                cn                 = new SqlConnection(this.ConnectionString);
                cmd                = new SqlCommand("usp_select_Quote_for_Page", cn);
                cmd.CommandType    = CommandType.StoredProcedure;
                cmd.CommandTimeout = 30;
                cmd.Parameters.Add("@QuoteId", SqlDbType.Int).Value = quoteId;
                cn.Open();
                DbDataReader reader = ExecuteReader(cmd, CommandBehavior.SingleRow);
                if (reader.Read())
                {
                    //return GetQuoteFromReader(reader);
                    QuoteDetails obj = new QuoteDetails();
                    obj.QuoteId         = GetReaderValue_Int32(reader, "QuoteId", 0);
                    obj.ClientNo        = GetReaderValue_Int32(reader, "ClientNo", 0);
                    obj.QuoteNumber     = GetReaderValue_Int32(reader, "QuoteNumber", 0);
                    obj.CompanyNo       = GetReaderValue_Int32(reader, "CompanyNo", 0);
                    obj.Closed          = GetReaderValue_NullableBoolean(reader, "Closed", null);
                    obj.CompanyName     = GetReaderValue_String(reader, "CompanyName", "");
                    obj.TeamNo          = GetReaderValue_Int32(reader, "TeamNo", 0);
                    obj.DivisionNo      = GetReaderValue_Int32(reader, "DivisionNo", 0);
                    obj.Salesman        = GetReaderValue_Int32(reader, "Salesman", 0);
                    obj.QuoteStatusName = GetReaderValue_String(reader, "QuoteStatusName", "");
                    return(obj);
                }
                else
                {
                    return(null);
                }
            } catch (SqlException sqlex) {
                //LogException(sqlex);
                throw new Exception("Failed to get Quote", sqlex);
            } finally {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
        public IActionResult Put([FromBody] QuoteDetails quoteDetails)
        {
            if (quoteDetails.StartDate > quoteDetails.EndDate)
            {
                return(BadRequest("Start date cannot be future date"));
            }
            var isCustomerAvailable = _customerService.IsCustomerRegistered(quoteDetails.CustomerId);

            if (isCustomerAvailable)
            {
                var isQuoteAvailable = _quoteService.IsQuoteExists(quoteDetails.Id);
                if (isQuoteAvailable)
                {
                    var quoteDetail = _quoteService.UpdateQuote(quoteDetails);
                    return(StatusCode((int)HttpStatusCode.Created, $"Quote id: {quoteDetail.Id} has been updated succesfully with Maturity amount : {quoteDetail.MaturityAmount}"));
                }
                return(StatusCode((int)HttpStatusCode.NotFound, $"The cutomer - {quoteDetails.CustomerId} doesnt have quote id : {quoteDetails.Id} linked"));
            }
            return(StatusCode((int)HttpStatusCode.NotFound, $"There is no cutomer available with customer Id : {quoteDetails.CustomerId}"));
        }
Exemplo n.º 20
0
        public Price GetPrice(QuoteViewModel quote)
        {
            int usrID = _FuelQuoteRepo.GetUserID(User.Identity.Name);

            Client client = new Client();

            client = JsonConvert.DeserializeObject <Client>(HttpContext.Session.GetString("ClientDetails"));
            QuoteDetails quoteInfo = new QuoteDetails
            {
                DateRequested    = quote.DateRequested,
                GallonsRequested = quote.GallonsRequested,
                State            = client.State,
                quoteHistory     = _FuelQuoteRepo.GetQuoteHistoryCount(usrID)
            };

            PricingModule getPrice = new PricingModule();
            Price         price    = getPrice.GetPrice(quoteInfo);


            return(price);
        }
Exemplo n.º 21
0
        /// <summary>
        /// GetListRecentForLogin
        /// Calls [usp_selectAll_Quote_recent_for_Login]
        /// </summary>
        public override List <QuoteDetails> GetListRecentForLogin(System.Int32?loginId, System.Int32?topToSelect)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try {
                cn                 = new SqlConnection(this.ConnectionString);
                cmd                = new SqlCommand("usp_selectAll_Quote_recent_for_Login", cn);
                cmd.CommandType    = CommandType.StoredProcedure;
                cmd.CommandTimeout = 30;
                cmd.Parameters.Add("@LoginId", SqlDbType.Int).Value     = loginId;
                cmd.Parameters.Add("@TopToSelect", SqlDbType.Int).Value = topToSelect;
                cn.Open();
                DbDataReader        reader = ExecuteReader(cmd);
                List <QuoteDetails> lst    = new List <QuoteDetails>();
                while (reader.Read())
                {
                    QuoteDetails obj = new QuoteDetails();
                    obj.QuoteId     = GetReaderValue_Int32(reader, "QuoteId", 0);
                    obj.QuoteNumber = GetReaderValue_Int32(reader, "QuoteNumber", 0);
                    obj.CompanyNo   = GetReaderValue_Int32(reader, "CompanyNo", 0);
                    obj.DateQuoted  = GetReaderValue_DateTime(reader, "DateQuoted", DateTime.MinValue);
                    obj.Salesman    = GetReaderValue_Int32(reader, "Salesman", 0);
                    obj.CompanyName = GetReaderValue_String(reader, "CompanyName", "");
                    obj.CreditLimit = GetReaderValue_NullableDouble(reader, "CreditLimit", null);
                    obj.Balance     = GetReaderValue_NullableDouble(reader, "Balance", null);
                    obj.IsImportant = GetReaderValue_NullableBoolean(reader, "IsImportant", false);
                    lst.Add(obj);
                    obj = null;
                }
                return(lst);
            } catch (SqlException sqlex) {
                //LogException(sqlex);
                throw new Exception("Failed to get Quotes", sqlex);
            } finally {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
Exemplo n.º 22
0
        private static Quote PopulateFromDBDetailsObject(QuoteDetails obj)
        {
            Quote objNew = new Quote();

            objNew.QuoteId             = obj.QuoteId;
            objNew.ClientNo            = obj.ClientNo;
            objNew.QuoteNumber         = obj.QuoteNumber;
            objNew.Notes               = obj.Notes;
            objNew.Instructions        = obj.Instructions;
            objNew.CompanyNo           = obj.CompanyNo;
            objNew.ContactNo           = obj.ContactNo;
            objNew.DateQuoted          = obj.DateQuoted;
            objNew.CurrencyNo          = obj.CurrencyNo;
            objNew.Salesman            = obj.Salesman;
            objNew.TermsNo             = obj.TermsNo;
            objNew.DivisionNo          = obj.DivisionNo;
            objNew.Freight             = obj.Freight;
            objNew.Closed              = obj.Closed;
            objNew.UpdatedBy           = obj.UpdatedBy;
            objNew.DLUP                = obj.DLUP;
            objNew.IncotermNo          = obj.IncotermNo;
            objNew.CompanyName         = obj.CompanyName;
            objNew.CompanyOnStop       = obj.CompanyOnStop;
            objNew.CompanySOApproved   = obj.CompanySOApproved;
            objNew.ContactName         = obj.ContactName;
            objNew.CurrencyCode        = obj.CurrencyCode;
            objNew.CurrencyDescription = obj.CurrencyDescription;
            objNew.SalesmanName        = obj.SalesmanName;
            objNew.DivisionName        = obj.DivisionName;
            objNew.QuoteValue          = obj.QuoteValue;
            objNew.TermsName           = obj.TermsName;
            objNew.OpenLines           = obj.OpenLines;
            objNew.IncotermName        = obj.IncotermName;
            objNew.ContactEmail        = obj.ContactEmail;
            objNew.CreditLimit         = obj.CreditLimit;
            objNew.Balance             = obj.Balance;
            return(objNew);
        }
Exemplo n.º 23
0
 public static ValidationResult HasValidMaturityAmountValidation(QuoteDetails quoteDetails)
 {
     if (quoteDetails.PensionPlan == PensionPlans.PensionSilver)
     {
         if (quoteDetails.RetirementAge >= 65 && quoteDetails.InvestmentAmount >= 100000)
         {
             return(ValidationResult.Success);
         }
         else
         {
             return(new ValidationResult("Pension Silver should have minimum retirement age is 65 and investment amount is 100000"));
         }
     }
     else if (quoteDetails.PensionPlan == PensionPlans.PensionGold)
     {
         if (quoteDetails.RetirementAge >= 63 && quoteDetails.InvestmentAmount >= 300000)
         {
             return(ValidationResult.Success);
         }
         else
         {
             return(new ValidationResult("Pension Gold should have minimum retirement age is 63 and investment amount is 300000"));
         }
     }
     else if (quoteDetails.PensionPlan == PensionPlans.PensionPlatinum)
     {
         if (quoteDetails.RetirementAge >= 60 && quoteDetails.InvestmentAmount >= 500000)
         {
             return(ValidationResult.Success);
         }
         else
         {
             return(new ValidationResult("Pension Platinum should have minimum retirement age is 60 and investment amount is 500000"));
         }
     }
     return(ValidationResult.Success);
 }
Exemplo n.º 24
0
 public string SaveQuote(QuoteDetails quoteDetails)
 {
     return("Product Added Successfully");
 }
Exemplo n.º 25
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        UserMaster objUSer = new UserMaster();

        objUSer = (UserMaster)Session["User"];
        string strQuoteMode = Convert.ToString(Session["QuoteMode"]);

        if (strQuoteMode == "EDIT")
        {
            int          quoteId  = Convert.ToInt32(Session["QuoteID"]);
            QuoteDetails objQuote = new QuoteDetails();
            objQuote.ID                         = quoteId;
            objQuote.Insured_Name               = Convert.ToString(txtInsuredName.Text);
            objQuote.Mailing_Address1           = Convert.ToString(txtAddress1.Text);
            objQuote.Mailing_Address2           = Convert.ToString(txtAddress2.Text);
            objQuote.ZipCode                    = Convert.ToInt32(txtZipCode.Text);
            objQuote.City                       = Convert.ToString(txtCity.Text);
            objQuote.Home_State_ID              = Convert.ToInt32(ddlHomeState.SelectedValue);
            objQuote.Insured_State_ID           = Convert.ToInt32(ddlInsureState.SelectedValue);
            objQuote.Is_new_business            = chkIsNewBusiness.Checked;
            objQuote.LOB_BuilderRisk            = chkBldrRisk.Checked;
            objQuote.LOB_ContractorsEquipment   = chkContractorsEquipment.Checked;
            objQuote.LOB_Crime                  = chkCrime.Checked;
            objQuote.LOB_Garage                 = chkGarage.Checked;
            objQuote.LOB_GeneralLiability       = chkGeneralLiability.Checked;
            objQuote.LOB_InlandMarine           = chkInlandMarine.Checked;
            objQuote.LOB_MotorTruck             = chkMotorTruck.Checked;
            objQuote.LOB_Owners                 = chkOwners.Checked;
            objQuote.LOB_Property               = chkProperty.Checked;
            objQuote.LOB_SpecialEvent           = chkSpecialEvent.Checked;
            objQuote.LOB_VacantBuildingGL       = chkVacantBuildingGL.Checked;
            objQuote.LOB_VacantBuildingProperty = chkVacantBuildingProperty.Checked;
            objQuote.Years_Without_Loss         = Convert.ToInt32(txtYears.Text);
            //objQuote.Effective_Date = Convert.ToDateTime(txtEffectiveDate.Text);
            //objQuote.Expiration_Date = Convert.ToDateTime(txtExpirationDate.Text);
            objQuote.Effective_Date  = DateTime.ParseExact(txtEffectiveDate.Text, "MM/dd/yyyy", null);
            objQuote.Expiration_Date = DateTime.ParseExact(txtExpirationDate.Text, "MM/dd/yyyy", null);

            objQuote.UserID = objUSer.ID;

            objQuote.QuoteNo     = Convert.ToString(Session["QuoteNo"]);
            objQuote.QuoteStatus = "Quoted";


            QuoteDetailsHandler quoteHandler = new QuoteDetailsHandler();
            quoteHandler.Update(objQuote);

            Response.Redirect("GenLiability.aspx");
            //Response.Redirect("GeneralLiability.aspx");
        }
        else
        {
            Random rnd     = new Random();
            int    quoteNo = rnd.Next(1000000, 9999999);

            QuoteDetails objQuote = new QuoteDetails();
            objQuote.Insured_Name               = Convert.ToString(txtInsuredName.Text);
            objQuote.Mailing_Address1           = Convert.ToString(txtAddress1.Text);
            objQuote.Mailing_Address2           = Convert.ToString(txtAddress2.Text);
            objQuote.ZipCode                    = Convert.ToInt32(txtZipCode.Text);
            objQuote.City                       = Convert.ToString(txtCity.Text);
            objQuote.Home_State_ID              = Convert.ToInt32(ddlHomeState.SelectedValue);
            objQuote.Insured_State_ID           = Convert.ToInt32(ddlInsureState.SelectedValue);
            objQuote.Is_new_business            = chkIsNewBusiness.Checked;
            objQuote.LOB_BuilderRisk            = chkBldrRisk.Checked;
            objQuote.LOB_ContractorsEquipment   = chkContractorsEquipment.Checked;
            objQuote.LOB_Crime                  = chkCrime.Checked;
            objQuote.LOB_Garage                 = chkGarage.Checked;
            objQuote.LOB_GeneralLiability       = chkGeneralLiability.Checked;
            objQuote.LOB_InlandMarine           = chkInlandMarine.Checked;
            objQuote.LOB_MotorTruck             = chkMotorTruck.Checked;
            objQuote.LOB_Owners                 = chkOwners.Checked;
            objQuote.LOB_Property               = chkProperty.Checked;
            objQuote.LOB_SpecialEvent           = chkSpecialEvent.Checked;
            objQuote.LOB_VacantBuildingGL       = chkVacantBuildingGL.Checked;
            objQuote.LOB_VacantBuildingProperty = chkVacantBuildingProperty.Checked;
            objQuote.Years_Without_Loss         = Convert.ToInt32(txtYears.Text);
            //objQuote.Effective_Date = Convert.ToDateTime(txtEffectiveDate.Text);
            //objQuote.Expiration_Date = Convert.ToDateTime(txtExpirationDate.Text);
            objQuote.Effective_Date  = DateTime.ParseExact(txtEffectiveDate.Text, "MM/dd/yyyy", null);
            objQuote.Expiration_Date = DateTime.ParseExact(txtExpirationDate.Text, "MM/dd/yyyy", null);

            objQuote.UserID = objUSer.ID;

            objQuote.QuoteNo     = Convert.ToString(quoteNo);
            objQuote.QuoteStatus = "Quoted";


            QuoteDetailsHandler quoteHandler = new QuoteDetailsHandler();
            quoteHandler.AddNew(objQuote);

            Session["QuoteNo"] = objQuote.QuoteNo;
            Response.Redirect("GenLiability.aspx");
            //Response.Redirect("GeneralLiability.aspx");
            //if (quoteHandler.AddNew(objQuote) == true)
            //{
            //    Response.Redirect("QuoteHome.aspx");
            //}
        }
    }
Exemplo n.º 26
0
 public bool AddNew(QuoteDetails objQuote)
 {
     return(quoteDetails.AddNew(objQuote));
 }
Exemplo n.º 27
0
 public bool Update(QuoteDetails objQuote)
 {
     return(quoteDetails.Update(objQuote));
 }
Exemplo n.º 28
0
 public MoneySuperMarketSteps()
 {
     quotesRepository = new EfRepository <Quote>(new hlfContext());
     quoteDetails     = ScenarioContextService.GetValue <QuoteDetails>("quoteData");
     UseQueue         = ConfigurationManager.AppSettings.Get("UseQueue").ToLower();
 }
Exemplo n.º 29
0
        public void ThenEnterIntoThePartSectionOfTheForm(Table table)
        {
            webdriverX.CreateQuestionAndAnswers(table.ToQuestionAndAnswers());
            var QnAs = webdriverX._QnAs;

            if (UseQueue != "true")
            {
                quoteDetails = table.CreateInstance <QuoteDetails>();
            }

            bool PleaseCheckTheFollowingDetailsAreCorrect = webDriver.FindElement("//h3//span[contains(.,'Please check the following details are correct.')]".ToByXpath()).Displayed;

            if (!PleaseCheckTheFollowingDetailsAreCorrect)
            {
                webdriverX.FindElement("Which type of lock do you have on your main door?", table.Rows[0][1]).Click();
                webdriverX.FindElement("Does your home have patio doors?", table.Rows[1][1]).Click();
                webdriverX.FindElement("Are there any other doors that lead outside?", table.Rows[2][1]).Click();
                webdriverX.FindElement("Do your windows have key-operated locks on them?", table.Rows[3][1]).Click();
                webdriverX.FindElement("Do you have a working burglar alarm?", table.Rows[4][1]).Click();
                webdriverX.FindElement("Do you have a fixed and lockable safe?", table.Rows[5][1]).Click();
                webdriverX.FindElement("How many working smoke alarms do you have?", table.Rows[6][1]).Click();
                webdriverX.FindElement("Is there a local neighbourhood watch?", table.Rows[7][1]).Click();
                webdriverX.FindElement("What kind of home do you live in?", quoteDetails.WhatKindOfHomeDoYouLiveIn).Click();
                webdriverX.FindElement("What kind of house is it?", quoteDetails.WhatKindOfHouseIsIt).Click();
                webdriverX.FindElement("What percentage of your roof is flat?", table.Rows[11][1]).Click();
                webdriverX.FindElement("Bedrooms").ClearAndSendKeys(quoteDetails.Bedrooms);
                webdriverX.FindElement("Reception rooms").ClearAndSendKeys(table.Rows[13][1]);
                webdriverX.FindElement("Bathrooms").ClearAndSendKeys(table.Rows[14][1]);
                webdriverX.FindElement("Other rooms").ClearAndSendKeys(table.Rows[15][1]);
            }

            if (webdriverX.IsElementVisible(webdriverX.GetBy("Are the statements above correct?", "Yes")))
            {
                webdriverX.FindElement("Are the statements above correct?", "Yes").Click();
            }

            if (webdriverX.IsElementVisible(webdriverX.GetBy("Roughly when was your home built?")))
            {
                webdriverX.FindElement("Roughly when was your home built?").SendKeys(table.Rows[10][1]);
            }

            webdriverX.FindElement("What's the current market value of your property?").SendKeys(table.Rows[16][1]);
            webdriverX.FindElement("How much would it cost to rebuild your home today?").ClearAndSendKeys(quoteDetails.HowMuchWouldItCostToRebuildYourHomeToday);

            if (!PleaseCheckTheFollowingDetailsAreCorrect)
            {
                webdriverX.FindElement("Are there any trees within 5 metres of your home?", table.Rows[18][1]).Click();
            }

            webdriverX.FindElement("Did you buy your home?", table.Rows[19][1]).Click();
            webdriverX.FindElement("When did you buy your home? Month").ClickAndSelectByText(table.Rows[20][1].Split('/')[0]);
            webdriverX.FindElement("When did you buy your home? Year").ClickAndSelectByText(table.Rows[20][1].Split('/')[1]);
            webdriverX.FindElement("Who lives in your home?", table.Rows[21][1]).Click();
            webdriverX.FindElement("Do you have a mortgage?", table.Rows[22][1]).Click();
            webdriverX.FindElement("How many adults live there?").ClickAndSelectByText(quoteDetails.HowManyAdultsLiveThere);
            webdriverX.FindElement("And how many children?", table.Rows[24][1]).ClickAndSelectByText(quoteDetails.AndHowManyChildren);
            webdriverX.FindElement("In general, when are there people at home?", table.Rows[25][1]).Click();
            webdriverX.FindElement("Is your home ever left empty for more than 30 days in a row?", table.Rows[26][1]).Click();
            webdriverX.FindElement("Does anyone living in your home smoke?", table.Rows[27][1]).Click();
            webdriverX.FindElement("Is your place ever used for business?", table.Rows[28][1]).Click();

            webdriverX.ClickIfElementExist("Have you had any incidents at home, or made any home insurance claims in the last 5 years?", table.Rows[29][1]);

            webdriverX.ClickIfElementExist("Have you made any home insurance claims or suffered any losses in the last 5 years", table.Rows[30][1]);
        }
Exemplo n.º 30
0
        public async Task <ActionResult <QuoteDetails> > PostQuoteDetails(QuoteDetails quoteDetails)
        {
            await _service.PostQuoteDetails(quoteDetails);

            return(CreatedAtAction("PostQuoteDetails", new { id = quoteDetails.ClientID }, quoteDetails));
        }