Click here to Skip to main content
15,908,931 members
Home / Discussions / C#
   

C#

 
GeneralRe: PolyGon To Shift Right Pin
Luc Pattyn9-Apr-11 5:52
sitebuilderLuc Pattyn9-Apr-11 5:52 
GeneralRe: PolyGon To Shift Right Pin
OriginalGriff9-Apr-11 5:55
mveOriginalGriff9-Apr-11 5:55 
GeneralRe: PolyGon To Shift Right Pin
Anubhava Dimri10-Apr-11 18:17
Anubhava Dimri10-Apr-11 18:17 
GeneralRe: PolyGon To Shift Right [modified] Pin
GlobX10-Apr-11 18:32
GlobX10-Apr-11 18:32 
GeneralRe: PolyGon To Shift Right Pin
David198710-Apr-11 20:26
David198710-Apr-11 20:26 
JokeRe: PolyGon To Shift Right Pin
GlobX10-Apr-11 20:31
GlobX10-Apr-11 20:31 
AnswerRe: PolyGon To Shift Right Pin
Luc Pattyn9-Apr-11 5:55
sitebuilderLuc Pattyn9-Apr-11 5:55 
GeneralRe: PolyGon To Shift Right Pin
Anubhava Dimri10-Apr-11 18:16
Anubhava Dimri10-Apr-11 18:16 
QuestionC# session Pin
adrian salas8-Apr-11 18:09
adrian salas8-Apr-11 18:09 
AnswerRe: C# session Pin
OriginalGriff8-Apr-11 20:36
mveOriginalGriff8-Apr-11 20:36 
GeneralRe: C# session Pin
adrian salas9-Apr-11 3:33
adrian salas9-Apr-11 3:33 
AnswerRe: C# session Pin
Anubhava Dimri8-Apr-11 20:50
Anubhava Dimri8-Apr-11 20:50 
AnswerRe: C# session Pin
dan!sh 9-Apr-11 5:34
professional dan!sh 9-Apr-11 5:34 
AnswerRe: C# session Pin
Ganesh Kumar Kaki13-Apr-11 1:21
Ganesh Kumar Kaki13-Apr-11 1:21 
QuestionWebserver only sending text occasionally? [modified] Pin
venomation8-Apr-11 16:38
venomation8-Apr-11 16:38 
AnswerRe: Webserver only sending text occasionally? Pin
Richard Andrew x649-Apr-11 3:27
professionalRichard Andrew x649-Apr-11 3:27 
GeneralRe: Webserver only sending text occasionally? Pin
venomation9-Apr-11 4:59
venomation9-Apr-11 4:59 
AnswerRe: Webserver only sending text occasionally? Pin
BobJanova11-Apr-11 5:10
BobJanova11-Apr-11 5:10 
QuestionHow to get a value to return in a textbox Pin
Justiin12658-Apr-11 12:15
Justiin12658-Apr-11 12:15 
Hi,

I am having issues for a project for work and was wondering if anybody can help me. I am trying to calculate The percentage for refurb for the day. The formula is Refurb_Rate = (totalRefurb / totalUnits * 100) The program is supposed to supposed count the refurb in the db and return a value in a textbox. I initialized my values to 0, but my problem is how do I get it to calculate each time a user scans in a unit to be refurbed. Anything I try to do gives me an error in my program. Right now it's returning a value of of 1 because I added RefurbRate++. Can anyone help me? Thanks.

Justin

Here is what I've done with my code:

private int GetRefurbRate()
{
string sql = "";
int Refurb_Rate = 0;
int totalRefurb = 0;
int totalUnits = 0;
string error_msg = "";

sql = "SELECT COUNT(*) " +
"FROM " + schema + ".repair_part rp " +
"WHERE rp.repair_ord = '" + txtRO.Text + "' ";
while (true)
{
if (!myDb.RunSql(sql, true))
{
error_msg = "DBError for getting Refurb Rate";
break;
}
if (myDb.dbRdr.HasRows)
{
if (myDb.dbRdr.Read())
{
try
{
Refurb_Rate = (totalRefurb / totalUnits * 100);
}
catch (Exception e)
{
Console.WriteLine(e);
}
}

Refurb_Rate++;
}
break;
}
myDb.dbRdr.Close();
if (error_msg != String.Empty)
{
MessageBox.Show(error_msg, "Get Refurb Rate",
MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
return Refurb_Rate;
AnswerRe: How to get a value to return in a textbox Pin
Colin Angus Mackay8-Apr-11 14:15
Colin Angus Mackay8-Apr-11 14:15 
GeneralRe: How to get a value to return in a textbox Pin
Justiin12658-Apr-11 16:28
Justiin12658-Apr-11 16:28 
AnswerRe: How to get a value to return in a textbox Pin
Luc Pattyn8-Apr-11 15:01
sitebuilderLuc Pattyn8-Apr-11 15:01 
GeneralRe: How to get a value to return in a textbox Pin
Justiin12658-Apr-11 16:39
Justiin12658-Apr-11 16:39 
AnswerRe: How to get a value to return in a textbox Pin
Luc Pattyn8-Apr-11 17:10
sitebuilderLuc Pattyn8-Apr-11 17:10 
AnswerRe: How to get a value to return in a textbox Pin
davidnz8-Apr-11 15:32
davidnz8-Apr-11 15:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.