private void ItemName1_txt_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter && ItemCode_txt.Text != "") { if (ItemCode_txt.Items.Contains(ItemCode_txt.Text) == false) { ItemNewName_txt.Text = ItemCode_txt.Text; ItemNewName_txt.Focus(); } else { bool DontAdd = false; for (int loop = 0; loop < ConsignmentDataGridView.Rows.Count - 1; loop++) //String ItemCodeGridData in ConsignmentDataGridView[) { if (ConsignmentDataGridView["ItemCode", loop].Value.Equals(ItemCode_txt.Text) == true) { DontAdd = true; break; } } if (DontAdd == false) { Ctn_txt.Focus(); foreach (DataRow asdf in ItemDataSet.Tables[0].Rows) { if (asdf["CODE"].ToString() == ItemCode_txt.Text) { QtyPerBox_txt.Text = asdf["QTY_BOX"].ToString(); Description_txt.Text = asdf["MODEL"].ToString(); Price_txt.Text = asdf["PRICE"].ToString(); } } } else { Variables.NotificationStatus = true; Variables.NotificationMessageTitle = this.Name; Variables.NotificationMessageText = "This Item is already Added"; } } } else if (e.KeyCode == Keys.Enter && ItemCode_txt.Items.Count > 0) { ItemCode_txt.Text = ItemCode_txt.Items[0].ToString(); } } catch (Exception ex) { Variables.NotificationMessageTitle = this.Name; Variables.NotificationMessageText = ex.Message; Variables.NotificationStatus = true; } }
private void button6_Click(object sender, EventArgs e) { ItemNewName_txt.Text = "None"; ItemModel_txt.Text = "None"; ItemQuantity_txt.Text = "0"; ItemPrice_txt.Text = "0"; TQUANTITY_txt.Text = "0"; ItemPictureBox.ImageLocation = ""; textBox2.Text = ""; ItemNewName_txt.Focus(); }
private void AddItem_Shown(object sender, EventArgs e) { ItemNewName_txt.Focus(); }