locked
How to create a POS Application (webmatrix) RRS feed

  • Question

  • User-1557173817 posted

    hello please am trying to create a POS Application (Point of sale) but dont know how to go about it.

    Monday, August 31, 2015 8:04 AM

Answers

  • User281315223 posted

    You might consider looking through a tutorial or considering an open-source option out there to help get you started. Depending on your needs, a basic one that you can find and download might have 90% of the functionality that you need and anything else could be custom-built :

    It's important to remember that depending on the needs of your system, you might be limited within a web application. For instance if you needed to interact with any hardware components, you would need some way of communicating with those, which can be difficult or impossible to do with a web application alone.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 31, 2015 8:25 AM
  • User281315223 posted

    Ok..I just need something simple that can display all item and price  with a checkbox, so the user selects the item he needs and those item selected will sum automatically and total bill send to the database.

    That's probably quite a bit simpler than a Point of Sale system, or at least a POS system would likely be overkill for something like that. A simple HTML form would probably be sufficient, simply assign a set of checkboxes along with a price and description :

    @{
        // If the page was posted back, sum the items up
        if(IsPost)
        {
            // Total
            decimal total = 0;
            // Add each possible item
            total += Convert.ToDecimal(Request["item1"]);
            total += Convert.ToDecimal(Request["item2"]);
            total += Convert.ToDecimal(Request["item3"]);
            
            // Now you have your total, so store it here in the database
        }
    }
    
    <form>
       <!-- Your items -->
       <input id='item1' name='item1' value='1.00' /> Item 1 <br />
       <input id='item2' name='item2' value='2.00' /> Item 2 <br />
       <input id='item3' name='item3' value='3.00' /> Item 3 <br />
       <!-- Your button to purchase the items -->
       <input type='submit' value='Purchase Items' />
    </form>

    This is a very basic example, but the general principle should still apply.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 31, 2015 10:35 AM
  • User1313602441 posted
    Basically you want to create a shopping cart.
    You can try to understand how it was done here: http://www.asp.net/mvc/overview/older-versions/mvc-music-store/mvc-music-store-part-8
    Or you could search Mike's website, I remember reading an article of such there.
    On the issue of using checkboxes to get and calculate the user's cart, I think Rion has answered that already. All you need to do is study the code.
    While on the issue of users searching for an item via an input field, it has a pretty straight forward solution.
    First, you need to identify whether the users would be anonymous or would be required to be logged in. This is very important because if the user is logged in, then all the personal infos you'd normally require from anonymous users on each checkout, would simply be available in the user's profile.
    Second, when a user types in an item via the form field, you would then get the input using Request.QueryString to get it from the url.
    Third, you use Razor code to perform an SQL SELECT query for that item.
    Fourth, you get the information and the price of the item using the database method, QuerySingle().
    Optionally you could use jQuery and AJAX to make this request asynchronously.
    Then you render it to the page.
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 7, 2015 4:46 PM

All replies

  • User281315223 posted

    You might consider looking through a tutorial or considering an open-source option out there to help get you started. Depending on your needs, a basic one that you can find and download might have 90% of the functionality that you need and anything else could be custom-built :

    It's important to remember that depending on the needs of your system, you might be limited within a web application. For instance if you needed to interact with any hardware components, you would need some way of communicating with those, which can be difficult or impossible to do with a web application alone.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 31, 2015 8:25 AM
  • User-1557173817 posted

    Ok..I just need something simple that can display all item and price  with a checkbox, so the user selects the item he needs and those item selected will sum automatically and total bill send to the database.

    Monday, August 31, 2015 9:15 AM
  • User281315223 posted

    Ok..I just need something simple that can display all item and price  with a checkbox, so the user selects the item he needs and those item selected will sum automatically and total bill send to the database.

    That's probably quite a bit simpler than a Point of Sale system, or at least a POS system would likely be overkill for something like that. A simple HTML form would probably be sufficient, simply assign a set of checkboxes along with a price and description :

    @{
        // If the page was posted back, sum the items up
        if(IsPost)
        {
            // Total
            decimal total = 0;
            // Add each possible item
            total += Convert.ToDecimal(Request["item1"]);
            total += Convert.ToDecimal(Request["item2"]);
            total += Convert.ToDecimal(Request["item3"]);
            
            // Now you have your total, so store it here in the database
        }
    }
    
    <form>
       <!-- Your items -->
       <input id='item1' name='item1' value='1.00' /> Item 1 <br />
       <input id='item2' name='item2' value='2.00' /> Item 2 <br />
       <input id='item3' name='item3' value='3.00' /> Item 3 <br />
       <!-- Your button to purchase the items -->
       <input type='submit' value='Purchase Items' />
    </form>

    This is a very basic example, but the general principle should still apply.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 31, 2015 10:35 AM
  • User-1557173817 posted

    i dont understand this, can u help me with a code block for an input field,  so when the user types the item, its automatically appear with the price and send to the database with customer name and other person information. 

    Monday, August 31, 2015 1:00 PM
  • User1313602441 posted
    Basically you want to create a shopping cart.
    You can try to understand how it was done here: http://www.asp.net/mvc/overview/older-versions/mvc-music-store/mvc-music-store-part-8
    Or you could search Mike's website, I remember reading an article of such there.
    On the issue of using checkboxes to get and calculate the user's cart, I think Rion has answered that already. All you need to do is study the code.
    While on the issue of users searching for an item via an input field, it has a pretty straight forward solution.
    First, you need to identify whether the users would be anonymous or would be required to be logged in. This is very important because if the user is logged in, then all the personal infos you'd normally require from anonymous users on each checkout, would simply be available in the user's profile.
    Second, when a user types in an item via the form field, you would then get the input using Request.QueryString to get it from the url.
    Third, you use Razor code to perform an SQL SELECT query for that item.
    Fourth, you get the information and the price of the item using the database method, QuerySingle().
    Optionally you could use jQuery and AJAX to make this request asynchronously.
    Then you render it to the page.
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 7, 2015 4:46 PM