|
give me few minutes im sending to you by e-mail
|
|
|
|
|
Hi Henry
I think you have an email check it out
Roni
|
|
|
|
|
I have it.
I will not be able to look at it until tomorrow though and what with it being so near to Xmas I'm going to be busier than usual, so please be patient.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi Roni,
Before I go to bed, I noticed while unzipping your project that there is a Login/Logout Form. Will I need a password to run the program? If so you'd better email that to me too.
Good night, I'll speak to you some time tomorrow.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi Henry
You can look at the database the password under the User table
Also when you load tha application dont click the LogIn/Logout Button, click the SignIn button
you dont need password there just press to OK button of dialog signin box and you can get thrugh to the next step of the application...
roni
|
|
|
|
|
OK.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi Henry
I've read also the e-mail that you send it to me. The reason I made the SignIn and LogIn/Logout buttons its only to test my application, because i will remove on of them in the end of my application.
Now with the panels (such as: starters panel, mains panel, etc etc,) that you mentioned on e-mail well basically they are empty, but when I click for instance the Starter Button it calls the StarterUserControl and places inside the starter panel, basically this wasn't my Idea in the beggining when I started to do this project, becasue I know the more control in to your application the slower it would be the application. My idea in the begging was to create somehow dynamic buttons or whatever, in oreder to reduce the number of controls in the forms, but I didnt have any clue how to do it but maybe in time i will when I get to know better the c# environment
roni
|
|
|
|
|
LAPEC wrote: Now with the panels (such as: starters panel, mains panel, etc etc,) that you mentioned on e-mail well basically they are empty, but when I click for instance the Starter Button it calls the StarterUserControl and places inside the starter panel
I followed what the code was doing, but you can do the same thing with just one panel, as I suggested in my Email. Just add all the UserControls to the same panel, while you are still using the UCs, that is. Then, at the times when you now show or hide the panels, simply show or hide the UC in question. So instead of StarterPanel.Hide or StarterPanel.Show use starterUC.Hide and starterUC.Show .
I'll get in touch later.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
ok Henry
I'll talk to you later
|
|
|
|
|
Hi Henry
Merry Christmas
I hope you enjoying your Christmas Time.
Kind regards
Roni
modified on Sunday, December 26, 2010 11:21 AM
|
|
|
|
|
Hi Henry
How are you, how was you christmas, I hope you enjoy it..
I have another slight problem, probably the same as before but this time with dataGridView1.
Kind regards
Roni
|
|
|
|
|
Hi Roni,
Sorry for the delay in responding.
Thank you for your seasonal greetings, I hope you enjoyed the break (if you had one) and have a happy and prosperous New Year.
Although I have not contacted you, I have been thinking about your application. I have tested a version with all the StarterPanel, MainPanel etc. removed and it works well. My testing machine is an old, slow one and without the extra panels it responds much faster and with less flashing.
I am currently trying to work out a way to dispense with the many UserControls too but that is a little more complicated than I at first thought due to the 'Cooking Instructions' buttons (Rare, Well Done etc.) that you had not mentioned before.
Also your database should really have some Normalization[^] applied to it before your application grows much more, otherwise any changes that are made will become horrendous to implement.
Still, never mind for now. What is your problem with the DataGridview?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi Henry
Good to hear from you again.
I actually managed to sort out the problem that you explained to me, and I'm only doing with two panels (food and drink panel).
Now another problem is rising.
You know on the listview the sample that you send it to me as a zip file.
On that listview of your sample, you have divided the courses into groups of the listview (and I did managed to do that on my project).
The problem is like so
When I add the starter items in to listview and also the main items it groups on the listview like so:
Starters ════════════════════════════════════
1 Soup £0.00
1 Bruschetta £0.00
Mains ═══════════════════════════════════════
1 Ravioli £0.00
1 Lasagne £0.00
1 Veg. Pizza £0.00
But what I want to do now is: (maybe you have noticed there is a button called Course Separator)....
Between starter group header and main group header I want to insert a line string into listview like so....
Starters ════════════════════════════════════
1 Soup £0.00
1 Bruschetta £0.00
****** Course 1 ****** this is what I want to insert in between...
Mains ═══════════════════════════════════════
1 Ravioli £0.00
1 Lasagne £0.00
1 Veg. Pizza £0.00
here is the code of the button but for some reason its not displaying nothing into listview.
private void cmdCourseSeparator_Click(object sender, EventArgs e)
{
string line1 = "════";
string line2 = "══════ Course 1 ══════";
string line3 = "══════";
string line4 = "══════ Course 2 ══════";
ListViewGroup liViGroup = new ListViewGroup();
liViGroup.HeaderAlignment = System.Windows.Forms.HorizontalAlignment.Center;
if (liViGroup.Header == "Starter")
{
liViGroup.Items.Add(line1);
}
this.TableOrderListView.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] {
liViGroup});
}
|
|
|
|
|
While I have a think about that.
Take a look at A Much Easier to Use ListView[^], from a very quick glance it looks much nicer than the standard one, allows more customization to be done, more easily.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Incidentally, I forgot to mention this in my previous message.
Earlier today I noticed how ugly the standard TabControl looks in your application and I made a note of Painting Your Own Tabs - Second Edition[^], which you might also consider using.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I know they were really ugly, but I removed them I'm not using the tabs anymore
|
|
|
|
|
Henry are you still online
|
|
|
|
|
Here you go
private void btnSeparator_Click(object sender, EventArgs e)
{
string line2 = "══════ Course 1 ";
string line3 = "══════";
string currentGroup = GetCurrentGroup();
if (!string.IsNullOrEmpty(currentGroup))
{
if (!lvwOrder.Groups[currentGroup].Items[lvwOrder.Groups[currentGroup].Items.Count - 1].Text.Contains("Course"))
{
switch (currentGroup)
{
case "Dessert":
line2 = "══════ Course 3";
break;
case "Main":
line2 = "══════ Course 2";
break;
}
ListViewItem newItem = new ListViewItem(line2);
newItem.SubItems.Add(line3);
newItem.SubItems.Add(line3);
newItem.Group = lvwOrder.Groups[currentGroup];
lvwOrder.Items.Add(newItem);
}
}
}
private string GetCurrentGroup()
{
string result = string.Empty;
if (((DataRowView)MenuBS.Current) != null)
{
result = ((DataRowView)MenuBS.Current)["FoodType"].ToString();
}
return result;
}
I am not sure of the benefit of having both the group header and this new separator, still it's your app so.............
Also, as it is it relies on the user to hit the button at the right time. If you are going to do this, it might be better to do it automatically, say when they switch from the Starters button to the Mains, although this too has problems. What if the user enters the Starters then goes to the Mains, at which point the customer changes the order for their starter?
Bearing this in mind it might be better to add the separators automatically when the order is sent. I can't think of any problems in doing it that way. Although I'm sure that I will.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
modified on Wednesday, January 5, 2011 3:57 PM
|
|
|
|
|
Hi Henry
I just got back from work. How are you
I got the sample and so far is working. thank you very much
I also considered very carefully what you said about (having both group header and the new separator).
But from my point of view (maybe I'm wrong) I dont think it can be a problem, because say for instance once you place an order
(by pressing the send button) you can set a sort of crystal report do the layout of that order and force it to print it
excatly the way it should be on the print ticket order....
I also want to ask you another problem with my datagridview (I was goning to ask you last night but I thought maybe it was a bit late)
Kind regards
Roni
|
|
|
|
|
Ask away.
I can't promise to answer tonight though.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Ok no problem
I will talk to you tomorow because I'm a bit tired to be honest with you
I worked all day today.....
Once again thank you very much...
Kind regards
Roni
|
|
|
|
|
OK.
Get a good nights rest.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi Henry
I want to explain the prblem I'm having with datagridview...
-Run the application that I send it to you,
-Click on the SignIn Button to jump to the next form,
-At the bottom of this form there is a Button called Manage,
-Click on it to call that form,
Now, on this form there is a Button called Stock In, if you click on this button it calls the form called StockIn form.
As you can see, the controls of this form are:
-food & drink Buttons (corresponding to the food and drink menu),
-four other buttons to scroll up and down (these buttons are not important at this moment), and
-dataGridView.
What I want to do here in this form is:
-When I click the Starter button I want to display only the starters on the datagridview (so far I have managed to do that 'see the code below')
private DataGridViewTextBoxColumn ColFoodQtyStock = new DataGridViewTextBoxColumn();
private DataGridViewTextBoxColumn ColFoodStatus = new DataGridViewTextBoxColumn();
private void cmdStarters_Click(object sender, EventArgs e)
{
OleDbConnectionStringBuilder connBuilder = new OleDbConnectionStringBuilder();
connBuilder.DataSource = @"C:\Users\AP_AE\Desktop\DTPOS_APP\DataBase\DtposMenu.accdb";
connBuilder.Provider = "Microsoft.ACE.OLEDB.12.0";
connBuilder.Add("Jet OLEDB:Engine Type", "5");
string foodTypeSql = @"SELECT FoodName, FoodType FROM Food WHERE FoodType = @foodType";
using (OleDbConnection conn = new OleDbConnection(connBuilder.ConnectionString))
{
dataGridView1.Columns.Clear();
dataGridView1.RowTemplate.Height = 60;
dataGridView1.Visible = true;
dataGridView2.Visible = false;
try
{
OleDbCommand foodsCommand = new OleDbCommand(foodTypeSql, conn);
OleDbParameter foodType = foodsCommand.Parameters.Add("@foodType", OleDbType.VarChar, 15);
OleDbDataAdapter foodsDa = new OleDbDataAdapter(foodsCommand);
DataRow dr;
DataSet ds = new DataSet();
conn.Open();
foodType.Value = "Starter";
foodsDa.Fill(ds, "Food_table");
conn.Close();
dataGridView1.DataSource = ds;
dataGridView1.DataMember = "Food_table";
dataGridView1.Columns.AddRange(ColFoodQtyStock, ColFoodStatus);
DataGridViewCellStyle dataGridViewCellStyle1 = new DataGridViewCellStyle();
this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
dataGridViewCellStyle1.Font = new Font("Verdana", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.dataGridView1.Columns[0].Width = 420;
this.dataGridView1.Columns[1].Width = 180;
this.dataGridView1.Columns[2].Width = 300;
this.dataGridView1.Columns[3].Width = 308;
ColFoodStatus.HeaderText = "Status";
ColFoodStatus.Name = "ColFoodStatus";
ColFoodQtyStock.HeaderText = "Quantity In Stock";
ColFoodQtyStock.Name = "ColFoodQtyStock";
}
catch (Exception ex)
{
MessageBox.Show("Error: " + ex);
}
}
}
And here is what it looks like the dataGridView...
===============================================================
FoodName FoodType Qty In Stock Status
===============================================================
Olives Starter
Soup Starter
etc... etc...
===============================================================
The columns FoodName & FoodType are generated from the database, and the columns Qty In Stock & Status are genereated at a run time.
Now how can I add data in the columns Qty In Stock & Status at the run time (see the datagridview below)
===============================================================
FoodName FoodType Qty In Stock Status
===============================================================
Olives Starter 0 <Allways on Stock>
Soup Starter 0 <Allways on Stock>
etc... etc... etc... etc...
===============================================================
There is more to ask you later what else I want to do but for the moment I want to do just this....
Henry this is a very long question and I hope is clear and understandable to you.
Thanks in advance
kind regards
Roni
|
|
|
|
|
Hi Roni,
I think that I understand your question but cannot help at the moment because after a quick look through your database I cannot see anything resembling a Stock Control/Inventory system.
If there is one, please tell me where it is and I will have another look.
If you haven't got as far as creating one yet then can I suggest that you take a look at Inventory Management Database[^]. Download it and take a look at the tables and the one view it contains. This is a pretty good example of the sort of structure(s) that you will need to implement.
If you do not like that one, or are just interested, take a look at Inventory Templates[^], from the same site. You will see that many of them are Excel templates but there are a few Access ones (Inventory, HomeInventory, Book Collection, Wine Collection). The first one (Inventory) is just an *.accdt file and as I do not have Access I am not able to look at it to see if it is more suited for you than the one in the paragraph above.
Write back, when you have had a think.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
|
|
|
|
|
Hi Henry
The purpose of the Qty In Stock & Status is to control the food and drinks on application at run time.
Basically if for instance there are only 10 portion of Soups, what I want to do is go to that StockIn form
(I mentioned on my previous question) and controll it like so...
this is the datagridview what it should look like (after you click the starter button)
===============================================================
FoodName FoodType Qty In Stock Status
===============================================================
Olives Starter 0 <Allways on Stock>
Soup Starter 0 <Allways on Stock>
etc... etc... etc... etc...
===============================================================
and this is a datagridview what it should look like when you controll the stock of your food at run time...
===============================================================
FoodName FoodType Qty In Stock Status
===============================================================
Olives Starter 0 <Allways on Stock>
Soup Starter 10 <Controlled>
etc... etc... etc... etc...
===============================================================
So basically what I'm trying to achieve is, as soon as I load the database records for instance Starters
(see above the 1st datagridview) click on the cell under the Qty In Stock Column of the Soup Row
(see the 2nd datagridview) pop up a dialog form and enter the quantity of that food,
and then take that number (num 10) and displayit on the button (called Soup) of the first form the one with the restaurant menu.
Please Henry let me know if you don't understand my question....
Kind regards
Roni
|
|
|
|