Design - Company --> Customer --> Orders (ignore The Details Of How The Orders Have Products Etc)

Mar 9, 2009

I have a scenario at hand which has some design discussion going on. To break it down in simple words, think about a hierarchy as such Company -----> Customer ------> Orders (ignore the details of how the orders have products etc) if I was to expose an API to work with this, what would be a better design.

a)
Dim comp As New Company
comp.GetInfo(123)
Dim cust As New Customer
cust.Name= "CustomerName"
comp.Add( cust)


b)
Dim custhand As Customerhandler
Dim cust As New Customer
cust.Name= "CustomerName"
custhand.AddCustomer(cust,123) ''123 is CompanyID

View 5 Replies


ADVERTISEMENT

Sql - How To Insert Customer Details Into Orders Table

May 4, 2012

I've got 6 hours left to finish a uni project. It's a basic database driven e-commerce site. I have a home page, a products page, an orders page, an order confirm page, a shopping cart page and a view current orders page. The site uses an Access database with three tables. A Customer table, with all of the customer details, (FirstName, LastName, EmailAdd, CardNo, CardEx, SortCode, DeliveryAdd, Postcode) A Products table, with all the product information, (ProductID, ProductName, Price, ProductType, Images, ProductDescription). And an Orders table which contains CustomerID and ProductID. I'm trying to create an INSERT statement on the orders page so that when the customer inserts their details and presses the submit button the customers table will have a new record inserted. I also want this to create an entry in the orders table and redirect the client to the order confirm page which will display the details of the order. Here is my code which runs when the submit button is clicked on the order form. EDIT I've fixed the error with the missing apostrophe. Attempting to insert using two sql commands as I've been told that access databases can't handle two at once. Still getting an error though.

Protected Sub btnAddRecord_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim strFirstName As String

[Code].....

View 2 Replies

LINQ To SQL Query - Select Customer From Dropdownlist And Then Gridview - Load All Items Of All Orders Of That Customer

Oct 4, 2011

I have the following problem: I select a customer from a dropdownlist and then the gridview should load all items of all orders of that customer. I have the following query:

Dim allorders = From ord In db.Orders

Where ord.CustomerID = Convert.ToInt32(CustomerDropDownList.SelectedValue)

[CODE]..............

I also tried to modify the query as follows:

Dim orderitems = From oi In db.OrderItems

Where oi.OrderNumber = (From From ord In db.Orders

[CODE]...........

But this does not work. I just started using LINQ.

View 5 Replies

Display Customer Orders That Have Been Placed?

Jun 28, 2009

It's a basic Access database driven e-commerce site. I have a home page, a products page, an orders page, an order confirm page, a shopping cart page and a view current orders page. The site uses an Access database with three tables. A Customer table, with all of the customer details, (FirstName, LastName, EmailAdd, CardNo, CardEx, SortCode, DeliveryAdd, Postcode)A Products table, with all the product information, (ProductID, ProductName, Price, ProductType, Images, ProductDescription). And an Orders table which contains CustomerID and ProductID.I've managed to get the orders page to work, this leads to the order confirmation page which displays the details the customer just placed.Here is what I have in the order confirmation page load event so far. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

[code]...

This returns this error "Syntax error in FROM clause." I'm guessing my SQL code is wrong. I noticed when I placed the order in the order page it added an entry in the Access database where the generated CustomerID was 12 on the customers table and 4 in the orders table. Shouldn't these numbers be the same when they are generated?

View 2 Replies

How To Display Customer Orders That Have Been Placed

May 4, 2012

I have a home page, a products page, an orders page, an order confirm page, a shopping cart page and a view current orders page. The site uses an Access database with three tables. A Customer table, with all of the customer details, (FirstName, LastName, EmailAdd, CardNo, CardEx, SortCode, DeliveryAdd, Postcode)A Products table, with all the product information, (ProductID, ProductName, Price, ProductType, Images, ProductDescription).And an Orders table which contains CustomerID and ProductID.I've managed to get the orders page to work, this leads to the order confirmation page which displays the details the customer just placed.[code]This returns this error "Syntax error in FROM clause." I'm guessing my SQL code is wrong.I noticed when I placed the order in the order page it added an entry in the Access database where the generated CustomerID was 12 on the customers table and 4 in the orders table.

View 2 Replies

Field Is Bound To The Orders Orders Qry 'View'?

Feb 29, 2012

I am working on an invoicing program that based on the Northwind database.I am pulling information from a 'view' for the orders form.How do i program the customer ID field to populate with the corresponding invoiceID (already done through the view) AND when i drop down the customerID box to list all possible customers from the customers table.I have the SQL for the operation I believe the problem is that the field is bound to the orders Orders Qry 'View'.How can i accomplish both of these tasks within the same dropdown?

View 1 Replies

Automatically Print Out Orders?

Mar 7, 2010

I am wanting to create a VB.Net app that checks a database and then prints out the latest orders, the database is mysql and i need it to periodatically check and only print new orders i.e. not print ones it has already printed out.

View 3 Replies

Creating A List Of Orders

Jun 5, 2011

So I have a program that is supposed to support a small business. I have the work completed and the professor said it was correct but I wanted to go do a little extra. Basically, on the Order screen, you begin to type the name of a customer/supplier/employee into a text box and a list of names that fit the criteria pops up in a list box (lbMatchingAccounts). When you select it, you can hit enter new order and be transported to the Order Details screen to enter the new order.

[Code]...

View 2 Replies

How To Calculate Orders (Seven Different Items)

Jun 8, 2011

I need to make an application that can calculate the items the user chooses from. There is 7 different items the user can choose from.

Small Coffee ..... $4.95
Medium Coffee .... $6.87
Large Coffee ..... $8.52
Bagel ............ $2.99
Cream ............ $0.71
Sugar ............ $0.50
Lid .............. $0.99

Total the coffee order (subtotal + tax at 6% = grand total). Allow the user to delete items from the customer order and to allow the user to start the order for a new customer (clear all). Create a button that gives a 10% discount for coffee only and adjusts the subtotal, tax, and total. Make certain the user can not click the button more than once per customer and if an item is removed from the customer order, make sure the discounted price is removed rather than the list price of the coffee. The button can only be clicked after the coffee is ordered, not before the coffee is selected.

This is what I got so far
Public Class Form1
Private myCoolCheckBoxPrices() As Double = {4.95, 6.87, 8.52, 2.99, 0.71, 0.5, 0.99}
Private myTax As Double = 0.06 'Tax used to add to Total Price
Private Sub lstItems_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstItems.DoubleClick
[Code] .....

View 13 Replies

No Orders In The Last X Days - SQL Access ASP

Mar 11, 2009

My table holds the following information:- ID- custID- ordered- amount- dateAddedFrom my ASP (VBScript) page I am trying to show all the rows where someone has not ordered, say in the last 30 days, 2 months, 1 year, etc. I am struggling to put the SQL statement together.

View 1 Replies

Counting Orders And Grouping Them, Linq To Sql?

Aug 15, 2011

I have a table called Ordersthe table has many rows but im only interested in two in particular.I want to query the table so it returns the average ordered count of each producti want to know what is the average count of the ordered products, but now in total but per productID instead.

View 1 Replies

Invoice Application With Orders Detail?

May 8, 2012

I am using the northwind database, My goal is to create an application that has a main form area for the orders and a details section (I guess a data grid view)How can I Utilize the data grid view for inputting values such as Product, Quantity, Unit Price, Extended price.... Specifically how to program the date grid view to multiply unit price by Quantity to get the extended price, then add up all the extended prices and shove that to another txtBox outside the dataGridView (txtSubtotal)Saving the header (to the Orders table) and using the InvoiceID to also save the details section in the OrdersDetail table.

View 1 Replies

List All CustomerID And Corresponding Count Of Orders

Sep 12, 2011

I have the following code for Customers and their orders. I want to list all the customerID and the corresponding count of orders. How do I achieve it using LINQ? [code]

View 3 Replies

Using Microsoft Acres Database - Table Named Customer Info To Store Customer Details When Registering

Oct 5, 2011

A registeration sys using a Microsoft acres database I have a table named customer info to store customer details when registering and I need coding that will add the following to my table customer I'd , firstname, lastname , phonenumber and user also has to make selection between radio buttons male or female.

View 2 Replies

Database And Report Methods - Recording Orders?

Jun 5, 2011

This program I am writing is basically a way to record orders. So I got a bunch of possible components required, which got their textfield(1 for product info, 1 for product price). Those are controlled with a checkbox, disabled on default. Enabled when checked.

Something like this:
Label, Checkbox, Product info textbox, Product price textbox.
This for a bunch of products, and at the bottom you got the total costs textbox.
Which updates as entries are made.

1. Would a access database be a good thing to use for this? To save the completed forms to, for later viewing through the program. Or are the better options for this kind of thing.

2. Would crystal reports be a good choice to make the reports after the form has being completed. So you got a decent sheet which shows you the entire order, and give a print ability.

View 6 Replies

Take Orders - Populate Textbox From Databound ComboBox

Dec 1, 2010

I got a pizza shop and the assingment is to create a application which allows the user to take a customer's order... I have a combo box filled with all of the items you can order (data from an access file)... and I need to have it so that when you select an item, it shows up in a text box below... I keep getting an error message saying you can't convert datarowview to string..

Here is some
Private Sub TakeOrders_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'PROJECT4DataSet.Items' table. You can move, or remove it, as needed.
Me.ItemsTableAdapter.Fill(Me.PROJECT4DataSet.Items)
[Code] .....

View 2 Replies

VS 2008 Select Users And Count Orders?

Aug 21, 2010

I've tried to write a code which will count the orders for each person in my users table. This is what I have but it's not working. What is wrong?

vb.net
Dim command As New SqlClient.SqlCommand("SELECT *, COUNT(Orders.Username) FROM Users LEFT OUTER JOIN Orders ON Users.Username = Orders.IssuedBy ORDER BY Users.PersonName")

View 3 Replies

Created A Program Which Stores And Creates Customers And Orders

Mar 2, 2010

I've been coding in VB.net for a while now, but still have never used the printing features. I've created a program which stores and creates customers and orders etc. I now require to print invoices related to these quotes.Is the following possible within VB.net when printing a document. Images i.e. Logo of company (which i've made already)Table of items orderedTotalshorizontal lines to split-up the design of the invoice/document.

View 2 Replies

Runnig From Server - Allow Employees To Submit Work Orders

Jun 8, 2012

I have written a small program to allow our employees to submit work orders. I want to have each computer on our network to be able to open the program, run it, and have the files (which are actually jpeg's of the form) saved on the server. This part works fine.

I have it loaded on the server and have tried to run it from several computers. While the program does run ok, it does not load the My.Settings items that are on the server. On each computer the program has, or appears to have its own set of my.settings.

If I go to the form in the program that allows me to add items to my.settings, and make changes they are saved, but when I go to the next computer they are not there. It only reflects the my.settings that were put directly in during program construction. (opened my.setting, clicked on the setting and added them there)

My question is,, how to get the program to stay on the server when running it so that the settings are there no matter which pc is running it? This is a windows forms program, I am using Visual Basic 2010 Express.

View 12 Replies

VS 2008 - Sqlcommand Incorrect - Take All Notes From Orders Table

May 6, 2009

Look at the code. all i need to do is take all notes from orders table.

The connection is openned

Private Sub Load_History()
Dim myCnt As Integer
Dim myStr As String
Dim totalrows As Integer
Dim myDataset As New DataSet

[CODE]...

View 3 Replies

Pizza Shop - Take Orders - Populate Text Box From Databound Combo Box?

Sep 28, 2010

got a pizza shop and the assingment is to create a application which alows the user to take a customer's order... I have a combo box filled with all of the items you can order (data from an access file)... and I need to have it so that when you select an item, it shows up in a text box below... I keep getting an error message saying you can't convert datarowview to string..

here is some

Private Sub TakeOrders_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'PROJECT4DataSet.Items' table. You can move, or remove it, as needed.
Me.ItemsTableAdapter.Fill(Me.PROJECT4DataSet.Items)
End Sub

[code]....

View 3 Replies

Reading Signed And Unsigned Values From A Stream In Both Byte Orders?

May 23, 2011

I need to read signed and unsigned 8 bit, 16 bit and 32 bit values from a file stream which may be little-endian or big-endian (it happens to be a tiff file which carries the byte order indicator at the start).I initially started by writing my own functions to read the values and was able to do so for unsigned values. e.g.

Public Function ReadUInt32() As UInt32
Dim b(4) As Byte
input.Read(b, 0, 4)

[code]....

But then I started looking at signed values and my brain broke.As an alternative, I found the IO.BinaryReader which will let me read signed values directly but doesn't seem to have any way to indicate that the data is big-endian or little-endian.Is there a nice way of handling this? Failing that, can someone tell me how to convert multiple bytes into signed values (in both byte orders)?

View 2 Replies

Update OrderStatus In Database Table Of Only Selected Orders In DataGridView

Nov 15, 2011

I am developing a Windows Forms Based Application using dbo.database and Visual Basic: I populate some Orders in DataGridView1 using LINQ 2 SQL from "tbl_Orders" where OrderStatus is "Pending". I change OrderStatus Column Type to "CheckBox" in DataGridView, Now I want that when I select some records (Orders) by checking respective checkboxes and click on "btn_UpdateStatus" Button, program pick OrderID's of only selected orders and update OrderStatus of Only selected Records (Orders) from "Pending" to "Completed" in Database Table "tbl_Orders" and DataGridView1 should be Refreshed. [code]

View 1 Replies

Generate A Report That Shows The Products Ordered For A Given Customer?

Jan 23, 2011

I'm trying to generate a report that shows the products ordered for a given customer.

I'm getting an error on the line that states:

lblList.Text &= rowInvoices(
"ProductCode")
& " "
& rowInvoices("Quantity")

The error message states: Column 'ProductCode' does not belong to table Customers.

I have three tables: The Customer Table, which points to the Invoice Invoice table via the CustomerID.

Also, the Invoice table, which contains the product code, points to the Invoice table via the InvoiceID.

If possible I'd like to bring in the Products table to get the Product description.

[Code]...

View 1 Replies

User Interface Choice For Managing An "orders" Table?

Mar 17, 2011

I want to "manage" a table of "orders." Orders is a typical table with a foreign key pointing to a customer, and a one-to-many relationship with a "details" table. To manage orders means to enter new orders, add details to orders, record payments, print a list of orders, cancel orders, mark orders shipped, print one order, etc., etc. These tasks can be divided into tasks that affect single orders (cancel an order) and tasks that affect multiple orders (print a list of orders).That task division led me to this user interface: present a form/window that displays by default a list of orders, and provide a button that switches the view from list mode to single-order mode. Each mode then provides the buttons for its tasks.

View 2 Replies

Call A Line Of Orders From Event To Another Event?

Jan 11, 2010

How I can call a line of orders from event to another event,

Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

[Code].....

View 15 Replies

Design - Pass User Details Between Objects?

Aug 16, 2010

I'm redesigning an old VB6 application into VB.net and there is one thing I'm not sure on the best way to do. In the VB6 application whenever we created a new instance of a component, we would pass in the user details (user name and the like) so we new who was performing the tasks. However, no that I'm redesigning I've created some nice class designs, but I'm having to add in user details into every class and it just looks wrong.

Is there a VB.net way of doing this so my classes can just have class specific details? Some way so that if my classes need to know who is performing a task, they can get the information themselves, rather than having it passed in whenever the objects are created?

View 2 Replies

Autocomplete Customer Surnames Direct From The Customer Datatable?

Jan 5, 2010

I am trying to autocomplete customer surnames direct from the Customer Datatable, using the code below which I got from another thread, but nothing is happening.

[Code]...

View 6 Replies

How To Do Programming Master Details Details Details

Jul 26, 2009

I have 4 Tables Master And Three Tables Details

how to programming this Technique

This Picture dispaly what i mean http://img300.imageshack.us/img300/3981/26072009110315.png

View 2 Replies

Get A Details View In ASP.NET To Display The Details Of The Logged-in User Only?

Dec 9, 2011

I'm trying to get a details view in ASP.NET to display the details of the logged-in user only. I have been told to use:

select * from STAFF where USERNAME = user.identity.name

I thought this was too simple to be true and I was correct as it shows no data when I attempt to run.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved