Click here to Skip to main content
15,906,626 members
Home / Discussions / C#
   

C#

 
AnswerRe: Rar and c# Pin
OriginalGriff11-Apr-16 21:38
mveOriginalGriff11-Apr-16 21:38 
AnswerRe: Rar and c# Pin
koolprasad200311-Apr-16 22:50
professionalkoolprasad200311-Apr-16 22:50 
QuestionMass Storage USB device protection tool except few white list USB hard disk Pin
Deepeshonly11-Apr-16 7:19
Deepeshonly11-Apr-16 7:19 
QuestionRe: Mass Storage USB device protection tool except few white list USB hard disk Pin
CHill6011-Apr-16 12:52
mveCHill6011-Apr-16 12:52 
AnswerRe: Mass Storage USB device protection tool except few white list USB hard disk Pin
Deepeshonly12-Apr-16 3:30
Deepeshonly12-Apr-16 3:30 
PraiseRe: Mass Storage USB device protection tool except few white list USB hard disk Pin
Deepeshonly12-Apr-16 7:05
Deepeshonly12-Apr-16 7:05 
AnswerRe: Mass Storage USB device protection tool except few white list USB hard disk Pin
Gerry Schmitz12-Apr-16 13:59
mveGerry Schmitz12-Apr-16 13:59 
QuestionHow to restart a Programm in Release-Modus per Code Pin
Member 1191673510-Apr-16 20:28
Member 1191673510-Apr-16 20:28 
AnswerRe: How to restart a Programm in Release-Modus per Code Pin
Richard MacCutchan10-Apr-16 20:49
mveRichard MacCutchan10-Apr-16 20:49 
AnswerRe: How to restart a Programm in Release-Modus per Code Pin
Suresh710-Apr-16 20:50
Suresh710-Apr-16 20:50 
AnswerRe: How to restart a Programm in Release-Modus per Code Pin
Bernhard Hiller10-Apr-16 23:04
Bernhard Hiller10-Apr-16 23:04 
AnswerRe: How to restart a Programm in Release-Modus per Code Pin
Member 1191673510-Apr-16 23:51
Member 1191673510-Apr-16 23:51 
GeneralRe: How to restart a Programm in Release-Modus per Code Pin
Eddy Vluggen11-Apr-16 0:33
professionalEddy Vluggen11-Apr-16 0:33 
AnswerRe: How to restart a Programm in Release-Modus per Code Pin
ZurdoDev11-Apr-16 7:47
professionalZurdoDev11-Apr-16 7:47 
GeneralRe: How to restart a Programm in Release-Modus per Code Pin
Member 1191673511-Apr-16 20:38
Member 1191673511-Apr-16 20:38 
GeneralRe: How to restart a Programm in Release-Modus per Code Pin
Pete O'Hanlon11-Apr-16 21:44
mvePete O'Hanlon11-Apr-16 21:44 
AnswerRe: How to restart a Programm in Release-Modus per Code Pin
ZurdoDev12-Apr-16 1:08
professionalZurdoDev12-Apr-16 1:08 
QuestionFiltering - C# winform connected to Access DB Pin
Kipp Doré10-Apr-16 12:51
Kipp Doré10-Apr-16 12:51 
AnswerRe: Filtering - C# winform connected to Access DB Pin
Garth J Lancaster10-Apr-16 13:11
professionalGarth J Lancaster10-Apr-16 13:11 
AnswerRe: Filtering - C# winform connected to Access DB Pin
Richard Andrew x6410-Apr-16 14:56
professionalRichard Andrew x6410-Apr-16 14:56 
AnswerRe: Filtering - C# winform connected to Access DB Pin
Richard Deeming11-Apr-16 1:39
mveRichard Deeming11-Apr-16 1:39 
QuestionSelection logic problem Pin
mekubo9-Apr-16 22:31
mekubo9-Apr-16 22:31 
C#
Hi guys,
 
I am trying to check for inventory quantity in database. If quatinty entered in dispatch webform is less than inventory, the dispatch should continue. else i should see error message that dispatch quantity is more than inventory and terminate the process.
 
My code below gives the following results:
When i try dispatching quantity less than inventory, the error still pops up and the program does not continue to excecute dispatch.  i do not want this. 
 
I am implementing the code from addbutton that should insert item to gridview (only if quantity is more than inventory). 
 
 
 
 
 
 
int SelectedDPItem;
int InventoryQTY;
int DinventoryQTY;

SqlConnection Connection = new SqlConnection("Data Source=localhost;Initial Catalog=warehousedb;Integrated Security=True ");
SqlDataAdapter INVadapter = new SqlDataAdapter("Select ItemID, ItemName, Quantity FROM inventory ", Connection);

SelectedDPItem = int.Parse(DropDownListItem_D.SelectedValue.ToString());
// Open Connection
Connection.Open();
SqlCommand Inventorychkcommand = new SqlCommand(("Select Quantity FROM inventory " + ("WHERE (ItemName LIKE \'"
+ (DropDownListItem_D.Text + "\')"))), Connection);
InventoryQTY = Convert.ToInt32(Inventorychkcommand.ExecuteScalar());
DinventoryQTY = Convert.ToInt32(txtQuantity_D.Text);



if (InventoryQTY < DinventoryQTY)
{

{

ClientScript.RegisterStartupScript(this.GetType(), "key", "<script>alert('sorry , Stock Balance is less than requested quantity.')</script>");
}
}


else
{

{
// procedure of inserting the record
AddNewRecordRowToGrid();

txtwaybill_D.Enabled = false;
DropDownListTransp.Enabled = false;
txtTruckNo_D.Enabled = false;
txtDrivername_D.Enabled = false;
DropDownListEmployee_D.Enabled = false;
btnNew.Enabled = false;
btnPostDispatch.Enabled = true;

DropDownListItem_D.Enabled = false;
txtDispatchDate.Enabled = false;
txtDestn.Enabled = false;
txtQuantity_D.Enabled = false;
txtDestn.Enabled = false;
}

AnswerRe: Selection logic problem Pin
OriginalGriff9-Apr-16 22:34
mveOriginalGriff9-Apr-16 22:34 
QuestionDobble Buffering Pin
FukkPhag19-Apr-16 20:23
FukkPhag19-Apr-16 20:23 
AnswerRe: Dobble Buffering Pin
OriginalGriff9-Apr-16 20:46
mveOriginalGriff9-Apr-16 20:46 

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.