Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5939949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:53:59+00:00 2026-05-22T15:53:59+00:00

What would be the best way to implement a simple quote system to determine

  • 0

What would be the best way to implement a simple quote system to determine a job cost based on two attributes type and value.

The job cost would determined what range the value falls into for it’s type.

For example:

Job type A would cost

  • $ 80 for value between $ 0-150
  • $100 for value between $150-300
  • $120 for value > $300

Job type B would cost

  • $ 50 for value between $ 0-120
  • $100 for value between $120-250
  • $120 for value between $120-500
  • $150 for value > $500

The band range should be configurable and each job type can have different range of bands.

The band ranges and costs may change and would ultimately be stored in a SQL server database accessed through a repository pattern so I could implement mock repository for TDD.

My initial development led me to having a lightweight class below representing the bands

public class JobCostBand
{
    public int ID { get; set; }
    public string Type { get; set; }
    public float ValueLowerBand { get; set; }
    public float ValueUpperBand { get; set; }
    public float Cost { get; set; }
}

I had a mock repository using LINQ to select from a in memory list of these objects to return the costs. This class would map easily enough to a SQL table whereby I could use LINQ to SQL find the cost in my final DB repository.

My problem was what to do with last band for a given job type. I started off using float.MaxValue for the upper band but that didn’t sit well with me. I then thought about using either a upper or lower value to specify the band in the JobCostClass but again this didn’t sit well. Am I thinking too much about this or have I missed a real simple way of modelling this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:54:00+00:00Added an answer on May 22, 2026 at 3:54 pm

    The job you’re trying to do is map an input value to a band. How you represent it is a secondary matter. So you should really be concentrating on an object that is able to return the correct band for a given input value.

    I’d stick with representing only an upper or lower band for each JobCostBand. Also have a nullable value for upper band in case the given band’s upper value is lower than the next band’s lower value. Have a ‘manager’ object which keeps the collection of bands, and which is able to query them in response to a value and decide which is the most appropriate. I would store these in a sorted list (ordered by lower band threshold), and iterate through the array in order until the band matches.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What would be the best way to implement a simple crash / error reporting
What would be the best way to implement, store, and render spherical worlds, such
What would be the best way to determine if an object equals number zero
In Java, what would the best way be to have a constantly listening port
What would be the best way to have a list of items with a
What would be the best way to fill a C# struct from a byte[]
What would be the best way to calculate someone's age in years, months, and
What would be the best way to expose certain functionality in a Dotnet VSTO
What would be the best way to port an existing Drupal site to a
What would be the best way to fill an array from user input? Would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.