|
Hi Roni,
Yes.
I was going to call you later.
What can I do for you?
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!
|
|
|
|
|
Im trying to sort this datagridview for a quite sometime and its doing my heading...
|
|
|
|
|
Well, as I said the other day I have had two ideas.
1) Add a column to the Food Table and the Drink Table 'QtyInStock' to hold the information. Although as I don't know how you calculate(?) the data for the Status field I can't advise on that at the moment.
2) Implement a Dictionary (or similar Collection) to hold the information and read it in when the application starts and write it out to disk when the app closes.
Both of these will involve quite complex changes to the code.
With 1), to make it work properly you would have to at least do part of what I mentioned a while ago and move the Data access stuff out into a separate project so that you can then be sure that both the StartersUC (and MainsUC and DessertUC etc.) and the Stock-In form are guaranteed to be looking at the same DataSet/DataTable so that when you update the data in Stock-In the UCs get notified and can update their buttons. Similarly when the buttons decrease the number the next time you go to Stock-In it sees the new figures.
With 2) to ensure that all the Forms/UCs etc. that need to are looking at the same collection it would have to be implemented as a Singleton Class. There is also the Serialization and Deserialization to be dealt with.
As I say, both will require substantial changes to the existing code because the application was not designed from the start to allow for this sort of thing. It has sort of just grown little bits to deal with specific problems in isolation, not as a part of the whole application. It is nobody's fault. It is a result of having asked for help about a specific thing, getting a helpful response and coding to that. The problem is that the responders had no idea how their suggestions would impact on the other parts, because they did not know about them.
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
How are you, just wanted to say hello...
kind regards
roni
|
|
|
|
|
Hi there Roni,
Sorry for the delay in replying. I moved your message somewhere safe so I could reply later and forgot where I put it.
I'm OK. Hope you are too.
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!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
|
|
|
|
|
Hi Henry
How are you, I hope you ok too
roni
|
|
|
|
|
Hi Henry
are you still online
I need to ask you something if possible
kind regards
roni
|
|
|
|
|
you know the datagridview I have the one with qty in stock and status,
how can populate this two columns with data? Is ther a loop to use or something else...
This is what datagridview looks when I click the starter button
===============================================================
FoodName FoodType Qty In Stock Status
===============================================================
Olives Starter
Soup Starter
Caprese Starter
Bruschetta Starter
Mushroom Starter
Antipasto Starter
Scallops Starter
Calamari Starter
Crab Avocado Starter
Pizza Bread Starter
===============================================================
And this is what datagridview should look like when when generating the other to column template...
=================================================================
FoodName FoodType Qty In Stock Status
=================================================================
Olives Starter 0 Allways On Stock
Soup Starter 0 Allways On Stock
Caprese Starter 0 Allways On Stock
Bruschetta Starter 0 Allways On Stock
Mushroom Starter 0 Allways On Stock
Antipasto Starter 0 Allways On Stock
Scallops Starter 0 Allways On Stock
Calamari Starter 0 Allways On Stock
Crab Avocado Starter 0 Allways On Stock
Pizza Bread Starter 0 Allways On Stock
=================================================================
here is the code of cmdStarter_Click even button....
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);
DataSet ds = new DataSet();
conn.Open();
foodType.Value = "Starter";
foodsDa.Fill(ds, "Food_table");
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);
}
}
}
|
|
|
|
|
Hi,
I've got a strange issue that I need a little help with understanding fully. I've posted this on the Inno setup list a few days ago with no response so I thought I'd ask here as well.
There are functions in my application to allow users to select a file in the view of the application and then selectively either open it in another editor application (user configurable) or open Windows Explorer with the file selected. I'm using a ProcessStartInfo object passed to the Process.Start(processStartInfo) method.
This is all working as expected when I run in debug/release from within VS. It also works as expected if I go to either the Release or Debug folders and launch the application outside of Visual Studio. Neither Visual Studio nor the application is running as admin. If I copy either of these to another location on the same machine and launch the app it also works as expected.
As soon as I build the installer and run the install (built using Inno Setup) these functions stop working. This led me to believe that UAC is the issue but what I've tried baring that in mind has only served to confuse me further.
I have an older installer for the same application, if I install this one the functions work as expected! Also, without running as admin. This application code hasn't been touched between these two different versions / installers. The Inno build script is also identical between the two installers.
The difference is that the new one was built on my new Windows 7 (64 bit) dev machine, the old installer was built on my old WinXP dev machine. Both are being installed the Windows 7 machine. The other difference is that I'm using the much newer latest build of Inno itself with the new InnoIDE but I can't imagine that contributing to the weirdness.
Basically, I'm confused as to where to go to fix this, does the setup / script need to change or should I be looking to the app source code for changes to solve this issue? Why does the old installer / app work?
The really odd thing is that even running the new version (post installing it) as admin doesn't fix the issue, it appears that the OS still denies my application the right to launch external programs.
Any pointers on this would be great, I'm really at a loss as to where to go from here.
Thanks in advance,
|
|
|
|
|
If anyone has any pointers on this it would be really appreciated.
Cheers,
|
|
|
|
|
i have a programm that it should have in it's output a file with .url suffix ...
when double click on file , browser open and go to that adress in the URL property in .url properties files ...
but i don,t know haw i can set this file property with coding in c# ...
plz help me
|
|
|
|
|
|
Hello ,
I am read File and I want to get information from each 256 byte and from each 256 byte I want to divided each 16 byte in order and get my Info?
Here's Sample of Converted 256 Byte
------------------------------------------
01 1C 09 0A 0A 0B 1C 09 0A 0A 0C 00 01 00 00 01 01 1C 09 0A 0A 0C 1C 09 0A 0A 0D 80 01 00 00 02 02 1C 09 0A 0A 0D 1C 09 0A 0A 0E 00 02 00 00 03 03 1C 09 0A 0A 0E 1C 09 0A 0A 0F 80 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Here's My Logic but I can not do it using code.
I want to Read All bytes and if Number of Byte equal to 256 I will go to Nested loop to Read 16 byte from previous 256 byte and Get Info
|
|
|
|
|
Sorry, but you need to explain this.
You tell us, you´re reading 256 byte (I assume you use a byte array ...). Where is the problem with access to the last 16 byte you read?
|
|
|
|
|
Honeyboy_20 wrote: I want to divided each 16 byte in order
you mean dividing each 256 Bytes set into 16 Byte in some order?
Honeyboy_20 wrote: and get my Info?
??? not clearly explained.
First and the Foremost: FIGHT TO WIN
|
|
|
|
|
Honeyboy_20 wrote: I want to Read All bytes
FileStream fs = File.OpenRead(filename);
byte[] data = new byte[fs.Length];
fs.Read (data, 0, data.Length)
Honeyboy_20 wrote: if Number of Byte equal to 256 I will go to Nested loop to Read 16 byte from previous 256 byte
byte[] set256=new byte[256];
int p=0;
for(int i=0;i < data.Length;i++)
{
set256[p++]=data[i];
if(p==256)
{
byte[] set16=new byte[16];
int k=0;
for(int j=0;j < 256;j++)
{
set16[k++]=set256[j];
if(k==16)
{
k=0;
}
}
p=0;
}
}
First and the Foremost: FIGHT TO WIN
modified on Thursday, December 16, 2010 10:35 AM
|
|
|
|
|
A few comments:
1. if you want to read all bytes at once, just use File.ReadAllBytes()
2. why are you copying bytes all the time, from data to set256, then from set256 to set16. That is a complete waste of bytes and cycles.
3. "is less then" is < (use the little widget above the text edit field for special characters).
|
|
|
|
|
your are right! i was just going to proof the concept thru coding.
Luc Pattyn wrote: 3. "is less then" is < (use the little widget above the text edit field for special characters).
i dont know why "<" is not to be printed
First and the Foremost: FIGHT TO WIN
|
|
|
|
|
by default the message gets HTML decoded, so any < could be the beginning of a tag; and unrecognized tags are ignored.
Officially you must escape the special characters ( < > & ); in practice, there seems to be no problem when followed by a digit or a space.
|
|
|
|
|
corrected! i think initially that was not properly decoded. i used pre tags also. now thats ok.
First and the Foremost: FIGHT TO WIN
|
|
|
|
|
|
Hi!
I have a report which has report header, Page header, details and report footer. The problem is that Page header is appearing on every page even if there is no details data remaining i.e. only report footer is there
|
|
|
|
|
Create a boolean formula. Set formula based on number of detail records. 0 recs = true, 1 or more recs = false.
Use formula in suppress option under page header (section).
Possibly do the same for footer, and detail as well if you want to completely eliminate blank page.
|
|
|
|
|
Thanks!
The code,
if PageNumber = TotalPageCount then true else false
worked on the suppress event of the page header
I haven't worked on crystal reports a great deal so I was thinking that there might be some issues in my report design but after your reply, googling made me know that one has to do this manually through code
|
|
|
|
|
Hello,
I need to show my pdf in a part of my page, how i can this, the web browser in Asp don't exist ?
Thank you verry mutch.
|
|
|
|