C# :: Displaying Multiple Images And Adding Sales To Them?
Aug 28, 2014
My application requires the user to add sales to images, this is done by displaying the image for the GUI, and then the user would add sales using that images ID which is brought in from the database.
In part this is 2 questions, first question is what is the best way to generate a List for use when adding the sales to the database. The List would need multiple strings for each sale. So for example:
Image 1 (Sale)
- JPG ID
- Product ID
- Product Quantity
So i'm going to assume i'm best creating a new instance of a custom class for each sale, and then add each instance to a List<Sale>?
public class Sale
{
public int SaleID { get; set; }
public int JpgID { get; set; }
public int SaleQty { get; set; }
}
Then I need a decent way to update this List with the GUI controls. So maybe get the JPG ID and set name of the Sale Class Instance to the ID, in this way its unique and I can update that instance when it comes to increasing the sale of a product or decreasing it.
Second part comes to the design of the GUI of adding sales, when I made this using HTML/PHP that was easier. It looked something like this:
If I wrote some code to generate that kind of design again in C# it going to require many Controls, wouldn't that be a bit intensive on the system? I just want something which looks great but also functions good.
At some point I'm going to switch to WPF, but I just need to get a working prototype working now which my client can use, and then update it when I have more time as I have got other Web Related projects that need doing, so at the moment WPF is out of the question.
Here's what i'm searching for: I have a form with 3 pictureBoxes (pictureBox1,2,3). The form also contains one button.
What I want is that when the user clicks the button (so button_click event) that the 3 pictureBoxes each show a different picture. And when I click the button again again 3 different pictures will load.
I already found out that I need to make an arraylist for the pictures (there are about 100 pictures). A System.Random to select random images. But I have absolutely no clue on how to write this code.
I stored multiple images in MySQL SERVER 2005. Now I want to retrieve particular category of images into multiple picturebox at runtime in C# Windows application. i used the following code in my final result form at form_Load using c# windows apps.. But it displays only one picture at run time.
SqlConnection con = new SqlConnection(@"Data Source=ttt-PC;Initial Catalog=Query_Image;Integrated Security=True"); SqlCommand cmdnew = new SqlCommand("select pic from Image_Category where IMG_Cat='" + searchvalue.ToString() + "'", con); con.Open();
Is it possible to display data from a textfile and also save data in to a textfile, reason being is for me to create back-ups of data into a textfile hidden somewhere in a safe location in the local disk or server in case of database error and failure.
I have the following code which allows me to add the pdf files if I give the exact name and path of the file. But I have multiple pdf files in a folder which I want to add to each cell in the first column. I am having trouble thinking of the logic to have a for loop for a folder which contains the pdf files.
But this is very very rough draft. I have say 20 files in the folder pdf with different names(Title). How can I add all the 20 pdf files in the excel sheet?
I am making a multiple quiz program. So everything is working fine, except for the part where i'm trying to add a highscore for each user which is being stored in a binary file. I have added a sample of the program containing the error. This isn't the actual program, which is very long.
class user { //The collection of all info pertaining to the users char user_id[50]; public: int hscore1; user() { strcpy(user_id,"NULL"); hscore=0;
I need to make a bar chart with asterisks that looks like this:
Store 1: ****** Store 2: *** etc.
anyway, right now what I have is:
Code: #include <iostream> #include <iomanip> using namespace std; int main () { const int STORES = 5; int sales[STORES], i; for (i = 0; i < STORES; i++) {
Write a program that uses a structure named CorpData to store the following information on a company division.
Division Name(North, South, East, Or West) First quarter sales Second quarter sales Third quarter sales Fourth quarter sales Total annual sales Average quarter sales
Include a constructor that allows the division name and four quarterly sales amounts to be specified at the time a CorpData variable is created.
The program should create four variables of this structure, each representing one of the following corporate divisions: North, South, East and West. Each variable should be passed in turn to a function that calculates and stores the total annual sales and average sales for that division.
Once this has been done for each division, each variable should be passed in turn to a function that displays the division name, total sales, and average sales.
Build a class named "salesCompany". Save it's name with a string and an array with records which will be filled with values from sales in different cities of the company.
Build the constructor which must get as a parameter the name of the company and a text file which will fill the array. There is an example of the text file format. Every line saves the sold quantity of a product, identified by a code, in a certain city.
CodeCityQuantity 1a63bCity11200 45ab8City2550 #include <iostream> #include <string.h> using namespace std; class salesCompany {
[code].....
what should I add more and how can make it available for the user to enter as an input a text file.
I wrote this program using struct and it works fine, now I want to write it just using arrays and I don't think i can do it. So here is the original code:
I need coding this project using while loops and cout/cin.. It is suppose to be one while loop for the whole thing and inside of the first while loop is the second while loop for each sale separately.
You have been asked to write a program to calculate sales totals for a general store. Your program will not know how many products each customer will buy, so your program will have to repeat the process until the last product has been entered (use -1 for Product ID to end each sale). After each sale your program must ask if you want to do another sale (Y - continue, N - end program).
At the beginning of the day, the cash drawer has $500 in it. At the end of the program you must display how much money is in the drawer after handling all your sales transactions.
Input Your program must take the following input: - Product ID Number (int) - Quantity for each item purchased (int) - Cash Received at the end of the sale
Use the following dataset to determine the price and taxability for each item.
First Sale: Product ID Price Quantity Taxable 101 $65.00 2 Yes 102 $12.50 1 No 103 $24.50 5 No 104 $38.75 4 Yes 105 $17.80 6 Yes 106 $16.50 2 No 107 $42.85 8 Yes 108 $32.99 2 Yes 109 $28.75 1 Yes 110 $51.55 1 No
Second Sale: Product ID Price Quantity Taxable 102 $12.50 1 No 103 $24.50 1 No 106 $16.50 1 No 107 $42.85 1 Yes 108 $32.99 1 Yes 109 $28.75 1 Yes
Third Sale: Product ID Price Quantity Taxable 106 $16.50 4 No 107 $42.85 3 Yes 108 $32.99 1 Yes 109 $28.75 5 Yes 110 $51.55 2 No
Calculating Tax For those items that are taxable, assume a 7.5% sales tax. Be sure to keep a running total of tax for the each sale.
Getting Started You must use the starter file provided with this assignment. What to turn in: - A copy of your source code - A printout of your program's output
Since SDL doesn't have it's own function for rotating images and I'm tired of storing multiple angles of the same sprite in a file, I created my own function for doing so:
//XY Class class XY { public: XY(){} XY(float x, float y);
[Code] ....
The problem is while Spin does spin the surface correctly, some pixels are rotated to the same new position so gaps appear in the returned surface. I need a way of filling in the gaps so the returned image looks better. A link to a program I made that uses this function is below so you can see the problem that I'm talking about. [URL] ....
I currently use SDL 1.2. Could my problem be fixed if I used 2.0? For example, does SDL 2.0 have a built in function for rotating surfaces?
I have a database of images and I want to store paths of all those images to a text file (lets say "images.txt"). I can then use this text file in c++ to extract images one by one by using getline() in a loop.
I don't know how to store image paths to a text file.
I have written a socket witch send an image 256x256 and now i want to send many images and i don't know what loop to write to make the socket after have sent the first image to send another and not to write the same program many times for every image ......
this is the part that read the binary image
if( !(fp=fopen("Anemos.bmp","rb"))) { printf("Unable to load bin file: %s... ","Anemos.bmp");
I am working on application to work with images. How to open/read images, whether it is jpeg, png, bmp or tiff and get it to bitmap. Is there some universal command for this or I will need more commands, every time testing the extension or format and then to use different method to read the image? Best would be to do it automatically, but I don't know such command.
I am making a game Pong, and have been struggling with the collision aspect between the baal hitting off the paddle. I have created a Class, to draw a rectangle, to work with collision however I dont know how to assign the rectangle to the images of the ball and paddle.