public void Clear() { txtName.Text = ""; txtOrderID.Clear(); txtTeacher.Clear(); txtStudent.Clear(); // oOrder.ScanItems.Clear(); txtOrderID.Clear(); // Grid.DataBind(); txtMessage.Text = ""; txtEntryDate.Text = DateTime.Now.Date.ToString(); }
public void Clear() { txtName.Clear(); txtOrderID.Clear(); txtTeacher.Clear(); txtStudent.Clear(); oOrder.ScanItems.Clear(); txtProductID.Clear(); txtBoxes.Clear(); //ScannedItems.Items.Clear(); txtEntryDate.Text = DateTime.Now.Date.ToString(); Grid.DataBind(); }
/// <summary> /// Clean up any resources being used. /// </summary> #endregion #region Events private void txtAdquire_Click(object sender, EventArgs e) { if (oTeacher.Find(txtTeacher.Text)) { if (oTeacher.Scanned) { if ((MessageBox.Show("Add more images?", "Add Forms...", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)) { txtTeacher.Clear(); return; } } try { picnumber = 0; twainDevice.ShowUserInterface = false; twainDevice.StartSession(); twainDevice.CloseSession(); if (picnumber > 0) { oCustomer.Teachers[oCustomer.Teachers.Index].Scanned = true; oTeacher.Scanned = true; oTeacher.UpdateStatus(); if (this.SetNextTeacher()) { txtTeacher.Text = oTeacher.Name; } else { txtTeacher.Clear(); txtTeacher.Focus(); } } } catch (Exception ex) { MessageBox.Show(ex.Message); GetError(); } } else { MessageBox.Show("This teacher doesn't exist"); } }
public void Clear() { txtRepID.Clear(); txtName.Text = ""; txtUserID.Clear(); txtPassword.Clear(); txtUser.Text = ""; }
public void Clear() { txtDate.Value = DateTime.Now; txtAmount.Clear(); txtComment.Clear(); txtChargeID.Clear(); txtAmountDue.Clear(); }
public void Clear() { txtWidth.Clear(); txtHeight.Clear(); txtLength.Clear(); txtProductID.Clear(); txtCookieDough.Checked = false; }
public void Clear() { //Grid.Rows.Dispose(); txtName.Clear(); //oRep.Items.dtItems.Rows.Clear(); //Grid.DataBind(); }
public void Save() { oVoicemail.RepID = Convert.ToInt32(txtRepID.Text); oVoicemail.CompanyID = this.CompanyID; oVoicemail.ID = txtVoicemailID.Text; oVoicemail.Save(); Clear(); txtVoicemailID.Clear(); txtVoicemailID.Focus(); }
public void Save() { oPack.NoCopies = (Int32)txtNumberOfPrints.Number; oPack.Description = txtDescription.Text; oPack.ID = txtBrochureTypeID.Text; oPack.Save(); Clear(); txtBrochureTypeID.Clear(); }
public void Clear() { txtAddress.Clear(); txtState.Clear(); txtCity.Clear(); txtZipCode.Clear(); txtPhone.Clear(); txtFax.Clear(); txtName.Clear(); cbIsExternal.Checked = false; }
public void Clear() { txtAddress.Clear(); txtState.Clear(); txtCity.Clear(); txtZipCode.Clear(); txtPhone.Clear(); txtFax.Clear(); txtContact.Clear(); txtName.Clear(); txteMail.Clear(); }
public void Clear() { //txtAskForPhone.Checked = false; txtBrochureTypeID.DataBindings.Clear(); txtNumberOfPrints.DataBindings.Clear(); txtDescription.DataBindings.Clear(); txtNumberOfPrints.Text = "0"; txtDescription.Clear(); }
public void Clear() { //Grid.Rows.Dispose(); txtDescription.Clear(); txtProductID.Text = String.Empty; txtPDescription.Text = String.Empty; txtProductTypeID.Text = String.Empty; txtPTDescription.Text = String.Empty; cbAskForPhone.Checked = false; //oBrochure.Items.dtItems.Rows.Clear(); //Grid.DataBind(); }
public void Save() { oCompany.ID = txtCompanyID.Text; oCompany.Name = txtName.Text; oCompany.Address = txtAddress.Text; oCompany.City = txtCity.Text; oCompany.State = txtState.Text; oCompany.ZipCode = txtZipCode.Text; oCompany.Phone = txtPhone.Value.ToString(); oCompany.IsExternal = cbIsExternal.Checked; oCompany.Save(); Clear(); txtCompanyID.Clear(); }
public void Save() { oBox.ID = txtBoxID.Text; oBox.Length = Convert.ToDouble(txtLength.Text); oBox.Width = Convert.ToDouble(txtWidth.Text); oBox.Height = Convert.ToDouble(txtHeight.Text); oBox.ProductID = txtProductID.Text; oBox.IsCookieDough = txtCookieDough.Checked; oBox.Save(); Clear(); txtBoxID.Clear(); }
public void Save() { oTaxState.ProductID = txtProductID.Text; oTaxState.StateID = ctrState.SelectedValue.ToString(); if (ctrTaxable.CheckedIndex > -1) { oTaxState.Taxable = ctrTaxable.CheckedItem.DataValue.ToString(); oTaxState.Tax = txtTax.Number; oTaxState.Save(); Clear(); txtProductID.Clear(); } }
public void Clear() { txtAddress.Clear(); txtState.Clear(); txtCity.Clear(); txtZipCode.Clear(); txtPhone.Clear(); txtFax.Clear(); txtContact.Clear(); txtName.Clear(); txteMail.Clear(); txtRepChargesList.Checked = false; cbCompetitors.Checked = false; cbShowCommission.Checked = false; }
public void Save() { oVendor.ID = txtVendorID.Text; oVendor.Name = txtName.Text; oVendor.Address_1 = txtAddress.Text; oVendor.City = txtCity.Text; oVendor.State = txtState.Text; oVendor.ZipCode = txtZipCode.Text; oVendor.Phone = txtPhone.Value.ToString(); oVendor.Fax = txtFax.Value.ToString(); oVendor.eMail = txteMail.Text; oVendor.Save(); Clear(); txtVendorID.Clear(); }
private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { #region txtOrderID if (sender == txtOrderID) { if (e.KeyCode.ToString() == "Return" || e.KeyCode.ToString() == "Tab") { if (txtOrderID.Text.Trim() == "") { txtOrderID.Clear(); txtOrderID.Focus(); return; } Int32 OrderID; try { OrderID = Convert.ToInt32(txtOrderID.Text); } catch (Exception ex) { Global.ShowNotifier(ex.Message); Global.playSimpleSound(3); txtOrderID.Clear(); txtOrderID.Focus(); return; } if (oImprinting.Find(OrderID, Global.CurrrentLine)) { if (oImprinting.ImprintItems.Count == 0) { Global.ShowNotifier("This order does exist but has no items with this product type: " + Global.CurrrentLine); txtOrderID.Clear(); txtOrderID.Focus(); return; } if (CompanyID != oImprinting.CompanyID) { Global.ShowNotifier("Different Order's Company/Season"); txtOrderID.Clear(); txtOrderID.Focus(); return; } txtTeacher.Text = oImprinting.Teacher; txtStudent.Text = oImprinting.Student; if (oImprinting.Imprinted) { Global.ShowNotifier("Order already printed"); //return; } this.ShowOrder(); txtOrderID.Enabled = false; //txtBoxes.Enabled = false; txtProductID.BackColor = Color.White; txtProductID.Focus(); return; } else { MessageBox.Show("Order not found..."); txtOrderID.Clear(); txtOrderID.Focus(); return; } } } #endregion #region txtProductID if (sender == txtProductID) { if (e.KeyCode.ToString() == "F8") { this.Grid.Focus(); } if (e.KeyCode.ToString() == "F2") { if (oImprinting.oProduct.View()) { this.txtProductID.Text = oImprinting.oProduct.ID; return; } } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { txtDescription.Clear(); if (txtProductID.Text.ToUpper() == "DONE") { if (!oImprinting.IfDone()) { Global.playSimpleSound(1); txtDescription.Text = "You have products left"; Global.ShowNotifier(txtDescription.Text); ActiveLeft(); txtProductID.Clear(); txtProductID.Focus(); return; } oImprinting.UpdateImprinted(true, Global.CurrrentLine); Clear(); txtOrderID.Enabled = true; txtOrderID.Focus(); return; } if (txtProductID.Text.ToUpper() == "ABORT") { Clear(); groupBox2.Focus(); txtOrderID.Enabled = true; txtOrderID.Focus(); return; } Imprinting.ImprintItem oItem = oImprinting.GetItem(txtProductID.Text); if (oItem == null) { oItem = oImprinting.GetItemTicket(txtProductID.Text); } if (oItem == null) { Global.playSimpleSound(2); txtDescription.Text = "TICKET OR PRODUCT NOT IN ORDER"; Global.ShowNotifier(txtDescription.Text); this.txtProductID.Clear(); this.txtProductID.Focus(); return; } txtProductID.Text = oItem.TicketID.ToString(); if (oItem.Printed) { Global.playSimpleSound(2); txtDescription.Text = "TICKET ALREADY PRINTED"; Global.ShowNotifier(txtDescription.Text); /*if (MessageBox.Show("Do you want reprint this Ticket?", "Re-print", MessageBoxButtons.YesNo, MessageBoxIcon.Warning,MessageBoxDefaultButton.Button2) == DialogResult.Yes) * { * oTicket.Find(Convert.ToInt32(txtProductID.Text)); * frmTicket frm = new frmTicket(oTicket); * frm.Show(); * if (!frm.Print()) * { * Global.ShowNotifier("No Printed"); * frm.Dispose(); * return; * } * frm.Dispose(); * oImprinting.ImprintItems[txtProductID.Text].Printed = true; * } * else*/ { this.txtProductID.Clear(); this.txtProductID.Focus(); return; } } else { oTicket.Find(Convert.ToInt32(txtProductID.Text)); frmTicket frm = new frmTicket(oTicket); frm.Show(); if (!frm.Print()) { Global.ShowNotifier("No Printed"); frm.Dispose(); return; } frm.Dispose(); oImprinting.ImprintItems[txtProductID.Text].Printed = true; } if (oImprinting.ImprintItems.Contains(txtProductID.Text)) { this.txtDescription.Text = oImprinting.ImprintItems[txtProductID.Text].Description; if (oImprinting.ImprintItems[txtProductID.Text].Printed) { this.ActiveRow(true); } else { this.ActiveRow(false); } // Grid.DataBind(); this.txtProductID.Clear(); return; } } } #endregion #region txtGrid if (sender == this.Grid) { //MessageBox.Show(e.KeyData.ToString()); if (Char.IsDigit(Convert.ToChar(e.KeyValue))) { txtProductID.Focus(); txtProductID.Text += Convert.ToChar(e.KeyValue).ToString(); SendKeys.Send("{END}"); return; } if (e.KeyCode.ToString() == "F8") { this.txtProductID.Focus(); return; } if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Up || e.KeyCode == Keys.Down || e.KeyCode == Keys.PageDown) { //return; } } #endregion #region Default Option //Default option switch (e.KeyCode) { case Keys.Tab: if (!e.Shift) { this.SelectNextControl(this.ActiveControl, true, true, true, true); } break; case Keys.Enter: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Down: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Up: this.SelectNextControl(this.ActiveControl, false, true, true, true); break; case Keys.F8: this.Grid.Focus(); break; case Keys.F3: break; case Keys.PageDown: break; //case Keys.<some key>: // ......; // break; } #endregion }
private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { #region txtCustomerID if (sender == txtCustomerID) { Boolean IsF2 = false; if (e.KeyCode.ToString() == "F2") { if (oCustomer.View()) { this.txtCustomerID.Text = oCustomer.ID; this.txtTeacher.Focus(); } else { this.txtCustomerID.Clear(); this.txtCustomerID.Focus(); return; } IsF2 = true; this.txtName.Text = oCustomer.Name; oOrder.CustomerID = txtCustomerID.Text; /*txtCustomerID.Enabled = false; * oOrder.LoadOrders(); * Grid.DataSource = oOrder.ScanItems; * Grid.DataBind(); * txtOrderID.Focus(); * return;*/ } if (e.KeyCode.ToString() == "Return" || e.KeyCode.ToString() == "Tab" || IsF2) { IsF2 = false; if (!this.get_customer()) { this.txtCustomerID.Focus(); return; } //MessageBox.Show(oCustomer.Scanned +"-"+ oOrder.OrdersScanned.ToString() +"-"+oOrder.OrdersEntered.ToString()); if ((oCustomer.Scanned || oOrder.OrdersScanned == oOrder.OrdersEntered)) { //MessageBox.Show("This is already Done"); txtCustomerID.Enabled = false; txtPallets.Enabled = true; txtPallets.Text = oCustomer.NumberPallets.ToString(); txtPallets.Focus(); return; } oOrder.CustomerID = txtCustomerID.Text; if (oOrder.OrdersEntered == 0) { MessageBox.Show("This customer doesnt have any Order..."); txtCustomerID.Clear(); txtCustomerID.Focus(); return; } oOrder.LoadOrders(); txtCustomerID.Enabled = false; oOrder.CustomerID = txtCustomerID.Text; Grid.DataSource = oOrder.ScanItems; Grid.DataBind(); txtOrderID.Focus(); return; } } #endregion #region txtOrderID if (sender == txtOrderID) { if (e.KeyCode == Keys.F12) { Grid.Focus(); return; } if (e.KeyCode == Keys.F2) { if (oOrder.View()) { txtOrderID.Text = oOrder.ID; } return; } if (e.KeyCode.ToString() == "Return" || e.KeyCode.ToString() == "Tab") { if (txtOrderID.Text.Trim() == "") { txtOrderID.Clear(); txtOrderID.Focus(); return; } if (txtCustomerID.Text != oOrder.CustomerID) { Global.playSimpleSound(1); return; } txtOrderID.Text = Convert.ToUInt32(txtOrderID.Text).ToString(); if (oOrder.FindHeader(Convert.ToInt32(txtOrderID.Text))) { if (oOrder.BoxesPacked == 0) { ActiveRow(false); Global.playSimpleSound(2); txtMessage.Text = "Order Not Packed Yet"; txtMessage.ForeColor = Color.Red; ShowMessage("Order Not Packed Yet", Color.Red); return; } if (oOrder.CustomerID != txtCustomerID.Text) { Global.playSimpleSound(3); txtTeacher.Text = oOrder.Teacher; txtStudent.Text = oOrder.Student; txtMessage.Text = "Different School"; txtMessage.ForeColor = Color.Red; ShowMessage("Different School", Color.Red); return; } if (oOrder.BoxesPacked > 0 && oOrder.BoxesPacked == oOrder.BoxesScanned) // (oOrder.Packed) { //oOrder.UpdateOrderScanned(oOrder.ID); //oOrder.LoadOrders(); Global.playSimpleSound(1); txtTeacher.Text = oOrder.Teacher; txtStudent.Text = oOrder.Student; txtBox.Text = String.Format("Boxes {0}", oOrder.BoxesScanned); txtMessage.Text = "Order Already Scanned"; txtMessage.ForeColor = Color.Red; ShowMessage("Order Already Scanned", Color.Red); return; } if (oOrder.BoxesPacked < oOrder.BoxesScanned) { ActiveRow(false); Global.playSimpleSound(2); ShowMessage("Something wrong, Modify number of boxes!!! ", Color.Red); return; } Boolean IsPacked = false; if (oOrder.BoxesPacked == oOrder.BoxesScanned) { Global.playSimpleSound(2); ShowMessage("Order Already Packed ", Color.Red); IsPacked = true; } txtTeacher.Text = oOrder.Teacher; txtStudent.Text = oOrder.Student; if (!IsPacked) { oOrder.BoxesScanned += 1; } txtBox.Text = String.Format("Box {0} of {1}", oOrder.BoxesScanned, oOrder.BoxesPacked); oOrder.UpdateScanned(oOrder.ID, oOrder.BoxesScanned); if (oOrder.BoxesScanned == oOrder.BoxesPacked) { //oOrder.ScanItems.Remove(txtOrderID.Text); oOrder.UpdateOrderScanned(oOrder.ID); ActiveRow(true); } else { ActiveRow(false); Grid.DataBind(); } if (!IsPacked) { txtMessage.Text = "GOOD!"; txtMessage.ForeColor = Color.Green; ShowMessage(txtBox.Text, Color.Green); } if (oOrder.OrdersScanned == oOrder.OrdersEntered) //oOrder.ScanItems.Count == 0) { txtPallets.Enabled = true; txtPallets.Focus(); return; } this.Focus(); txtOrderID.Focus(); txtOrderID.Clear(); return; } else { Global.playSimpleSound(0); } txtOrderID.Clear(); return; } } #endregion #region txtPallets if (sender == txtPallets) { if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtPallets.Text == "") { txtPallets.Focus(); return; } if (Convert.ToInt32(txtPallets.Text) > 100) { txtPallets.Clear(); txtPallets.Focus(); return; } //oOrder.BoxesScanned = Convert.ToInt16(txtPallets.Text); //oOrder.UpdatePacked(); oOrder.NumberPallets = Convert.ToInt32(txtPallets.Text); oOrder.UpdateCustomerScanned(); PrinPalletLabels(); Clear(); txtCustomerID.Enabled = true; txtPallets.Enabled = false; txtOrderID.Enabled = false; txtCustomerID.Focus(); this.Close(); return; } } #endregion #region txtGrid if (sender == this.Grid) { if (e.KeyValue >= 48 && e.KeyValue <= 57) { txtOrderID.Focus(); //SendKeys.Send("{TAB}"); // SendKeys.Send(c.ToString()); } if (e.KeyCode == Keys.F12) { txtOrderID.Focus(); return; } if (e.KeyCode.ToString() == "F8") { return; } if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Up || e.KeyCode == Keys.Down || e.KeyCode == Keys.PageDown) { //return; } } #endregion #region Default Option //Default option switch (e.KeyCode) { case Keys.Tab: if (!e.Shift) { this.SelectNextControl(this.ActiveControl, true, true, true, true); } break; case Keys.Enter: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Down: //this.SelectNextControl(this.ActiveControl,true,true,true,true); break; case Keys.Up: //this.SelectNextControl(this.ActiveControl,false,true,true,true); break; case Keys.F8: break; case Keys.F3: break; case Keys.PageDown: break; //case Keys.<some key>: // ......; // break; } #endregion }
private void txtCustomerID_KeyUp(object sender, KeyEventArgs e) { #region txtCustomerID if (sender == txtCustomerID) { Boolean IsF2 = false; if (e.KeyCode.ToString() == "F2") { if (!oCustomer.View()) { this.txtTeacher.Focus(); return; } IsF2 = true; } if (e.KeyCode.ToString() == "Return" || e.KeyCode.ToString() == "Tab" || IsF2) { if (!IsF2) { if (!oCustomer.Find(txtCustomerID.Text)) { this.txtCustomerID.Focus(); return; } } this.txtCustomerID.Text = oCustomer.CustomerID; this.txtName.Text = oCustomer.Name; IsF2 = false; oCustomer.CustomerID = oCustomer.ID; oCustomer.Teachers.Load(oCustomer.ID); if (this.SetNextTeacher()) { txtTeacher.Text = oTeacher.Name; } else { txtTeacher.Clear(); txtTeacher.Focus(); } this.txtTeacher.Focus(); return; } if (e.KeyCode == Keys.Down) { txtTeacher.Clear(); } } #endregion #region txtTeacher if (sender == txtTeacher) { if (e.KeyCode.ToString() == "F2") { oTeacher.CustomerID = txtCustomerID.Text; oTeacher.View(); if (oTeacher.Name != "") { if (oTeacher.Scanned) { if ((MessageBox.Show("Add more ?", "Add Forms...", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)) { txtTeacher.Clear(); return; } } this.txtTeacher.Text = oTeacher.Name; return; } } if (e.KeyCode == Keys.Enter || e.KeyCode.ToString() == "Tab") { if (txtCustomerID.Text.Trim() != "") { if (oTeacher.Find(this.CompanyID, oCustomer.CustomerID, txtTeacher.Text)) { this.txtTeacher.Text = oTeacher.Name; return; } else { txtTeacher.Clear(); txtTeacher.Focus(); return; } } } if (e.KeyCode == Keys.Up) { txtTeacher.Clear(); } } #endregion #region Default Option //Default option switch (e.KeyCode) { case Keys.Tab: if (!e.Shift) { this.SelectNextControl(this.ActiveControl, true, true, true, true); } break; case Keys.Enter: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Down: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Up: this.SelectNextControl(this.ActiveControl, false, true, true, true); break; case Keys.F8: break; case Keys.F7: this.Close(); break; //case Keys.<some key>: // ......; // break; } #endregion }
public void Save() { Clear(); txtProductID.Clear(); }
private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { #region txtPrizeID if (sender == txtPrizeID) { if (e.KeyCode == Keys.PageDown || e.KeyCode == Keys.F3) { return; } if (e.KeyCode.ToString() == "F2") { if (oPrize.View()) { ShowPrize(); txtDescription.Focus(); Grid.DataSource = oPrize.Items.dtItems; Grid.DataBind(); Grid.Focus(); MoveLast(); return; } } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtPrizeID.Text.Trim().Length == 0) { Clear(); txtPrizeID.Focus(); } if (oPrize.Find(txtPrizeID.Text)) { txtDescription.Text = oPrize.Description; Grid.DataSource = oPrize.Items.dtItems; Grid.DataBind(); Grid.Focus(); MoveLast(); } else { Clear(); oPrize.Items.dtItems.Rows.Clear(); oPrize.ID = txtPrizeID.Text; oPrize.Items.AddEmpty(); Grid.DataSource = oPrize.Items.dtItems; Grid.DataBind(); txtDescription.Focus(); } return; } } #endregion #region Grid if (sender == Grid) { if (e.KeyCode == Keys.F2) { UltraGridRow gridRow; gridRow = Grid.ActiveRow; if (gridRow != null) { if (Grid.ActiveRow.Cells["ProductID"] == Grid.ActiveCell) { if (oProduct.View()) { if (!oPrize.Items.Contains(Grid.ActiveRow.Cells["ProductID"].Text)) { Grid.ActiveRow.Cells["ProductID"].Value = oProduct.ID; Grid.ActiveRow.Cells["Description"].Value = oProduct.Description; Grid.ActiveRow.Cells["Amount"].Activate(); Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } else { MessageBox.Show("Item already entered"); Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } } } } } if (e.KeyCode == Keys.Delete) { } if (e.KeyCode == Keys.Enter) { Infragistics.Win.UltraWinGrid.UltraGridRow gridRow; gridRow = Grid.ActiveRow; if (gridRow != null) { if (Grid.ActiveRow.Cells["ProductID"] == Grid.ActiveCell) { if (oProduct.Find(Grid.ActiveRow.Cells["ProductID"].Text)) { if (!Contain(Grid.ActiveRow.Cells["ProductID"].Text)) { Grid.ActiveRow.Cells["ProductID"].Value = oProduct.ID; Grid.ActiveRow.Cells["Description"].Value = oProduct.Description; Grid.ActiveRow.Cells["BreakLevel"].Activate(); Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } else { MessageBox.Show("Item already entered"); Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } } return; } if (Grid.ActiveRow.Cells["Amount"] == Grid.ActiveCell) { gridRow = gridRow.GetSibling(Infragistics.Win.UltraWinGrid.SiblingRow.Next); if (gridRow != null) { MoveDown(); return; } else //if (Grid.ActiveRow.Cells["ProductID"].Text && Grid.ActiveRow.Cells["0"].Text) { if (Grid.ActiveRow.Cells["ProductID"].Text != "" && !Contain(Grid.ActiveRow.Cells["ProductID"].Text)) { if (Grid.GetRow(ChildRow.Last) == Grid.ActiveRow) { oPrize.Items.AddEmpty(); Grid.DataBind(); MoveLast(); //Grid.PerformAction(UltraGridAction.LastRowInBand, false, false); } else { Grid.PerformAction(UltraGridAction.NextRowByTab, false, false); Grid.ActiveRow.Cells["ProductID"].Activate(); Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } } else { Grid.ActiveRow.Cells["ProductID"].Activate(); Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); Grid.ActiveRow.Cells["BreakLevel"].Value = 0; Grid.ActiveRow.Cells["Amount"].Value = 0; } return; } } if (Grid.ActiveRow.Cells["BreakLevel"] == Grid.ActiveCell) { Grid.PerformAction(UltraGridAction.NextRowByTab, false, false); Grid.ActiveRow.Cells["Amount"].Activate(); Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); return; } if (Grid.ActiveRow.Cells["Quantity"] == Grid.ActiveCell) { Grid.PerformAction(UltraGridAction.NextRowByTab, false, false); Grid.ActiveRow.Cells["ProductID"].Activate(); Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); return; } } } if (e.KeyCode == Keys.Down) { MoveDown(); return; } if (e.KeyCode == Keys.Up) { Infragistics.Win.UltraWinGrid.UltraGridRow gridRow; gridRow = Grid.ActiveRow; gridRow = gridRow.GetSibling(Infragistics.Win.UltraWinGrid.SiblingRow.Previous); if (gridRow != null) { gridRow.Activate(); //' set ActiveCell Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); } return; } } #endregion #region txtDescription if (sender == txtDescription) { if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { oPrize.Description = txtDescription.Text; txtProductTypeID.Focus(); MoveLast(); return; } } #endregion #region txtProductTypeID if (sender == txtProductTypeID) { if (e.KeyCode.ToString() == "F2") { if (oPack.View()) { txtProductTypeID.Text = oPack.ID; txtPTDescription.Text = oPack.Description; } } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtProductTypeID.Text.Trim().Length == 0) { txtProductTypeID.Focus(); } if (oPack.Find(txtProductTypeID.Text)) { txtProductTypeID.Text = oPack.ID; txtPTDescription.Text = oPack.Description; } Grid.Focus(); return; } } #endregion #region Default Option //Default option switch (e.KeyCode) { case Keys.Tab: if (!e.Shift) { this.SelectNextControl(this.ActiveControl, true, true, true, true); } break; case Keys.Enter: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Down: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Up: this.SelectNextControl(this.ActiveControl, false, true, true, true); break; case Keys.F3: oPrize.Delete(); Clear(); oPrize.Items.dtItems.Rows.Clear(); Grid.DataBind(); txtPrizeID.Clear(); txtPrizeID.Focus(); break; case Keys.PageDown: this.Save(); //oPrize.Description = txtDescription.Text; //oPrize.Save(); Grid.DataBind(); Clear(); txtPrizeID.Clear(); txtPrizeID.Focus(); break; case Keys.Delete: if (e.Control) { DeleteItem(); } break; //case Keys.<some key>: // ......; // break; } #endregion }
private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { #region txtOrderID if (sender == txtOrderID) { if (e.KeyCode.ToString() == "Return" || e.KeyCode.ToString() == "Tab") { if (txtOrderID.Text.Trim() == "") { txtOrderID.Clear(); txtOrderID.Focus(); return; } if (oOrder.Find(Convert.ToInt32(txtOrderID.Text))) { if (CompanyID != oOrder.CompanyID) { MessageBox.Show("Different Order's Company/Season"); txtOrderID.Clear(); txtOrderID.Focus(); return; } txtTeacher.Text = oOrder.Teacher; txtStudent.Text = oOrder.Student; this.ShowOrder(Convert.ToInt32(txtOrderID.Text)); if (oOrder.Packed) { MessageBox.Show("Order already packed " + oOrder.BoxesPacked.ToString() + " boxes"); txtBoxes.Enabled = true; txtBoxes.Text = oOrder.BoxesPacked.ToString(); txtBoxes.Focus(); /* Clear(); * txtOrderID.Clear(); * txtOrderID.Focus();*/ return; } txtOrderID.Enabled = false; txtBoxes.Enabled = false; txtProductID.Focus(); return; } else { MessageBox.Show("Order not found..."); txtOrderID.Clear(); txtOrderID.Focus(); return; } } } #endregion #region txtProductID if (sender == txtProductID) { if (e.KeyCode.ToString() == "F8") { this.Grid.Focus(); } if (e.KeyCode.ToString() == "F2") { if (oOrder.oProduct.View()) { this.txtProductID.Text = oOrder.oProduct.ID; return; } } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { txtDescription.Clear(); if (txtProductID.Text.ToUpper() == "DONE") { if (!oOrder.IfDone()) { Global.playSimpleSound(1); txtDescription.Text = "You have products left"; ActiveLeft(); txtProductID.Clear(); txtProductID.Focus(); return; } txtBoxes.Clear(); txtBoxes.Enabled = true; txtBoxes.Focus(); //txtOrderID.Enabled = true; return; } if (txtProductID.Text.ToUpper() == "ABORT") { Clear(); groupBox2.Focus(); txtOrderID.Enabled = true; txtOrderID.Focus(); return; } BarCode_2: if (txtProductID.Text.Length < 12) { txtProductID.Text = oOrder.GetItem(txtProductID.Text); if (txtProductID.Text == "") { Global.playSimpleSound(2); txtDescription.Text = "PRODUCT NOT IN ORDER"; this.txtProductID.Clear(); this.txtProductID.Focus(); return; } } //Check by Code if (oOrder.ScanItems.Contains(txtProductID.Text)) { if (oOrder.ScanItems[txtProductID.Text].Quantity < (oOrder.ScanItems[txtProductID.Text].Scanned + 1)) { Global.playSimpleSound(3); txtDescription.Text = "EXTRA PRODUCT !!!"; txtProductID.Clear(); return; } oOrder.ScanItems[txtProductID.Text].Scanned += 1; //if (oOrder.ScanItems[txtProductID.Text].Scanned == oOrder.ScanItems[txtProductID.Text].Quantity) // DeleteRow(); this.txtDescription.Text = oOrder.ScanItems[txtProductID.Text].Description; //this.ScannedItems.Text = oOrder.ScanItems[txtProductID.Text].ProductID + " - " + oOrder.ScanItems[txtProductID.Text].Description; //this.ScannedItems.Items.Add(oOrder.ScanItems[txtProductID.Text].ProductID + " - " + oOrder.ScanItems[txtProductID.Text].Description); if (oOrder.ScanItems[txtProductID.Text].Scanned == oOrder.ScanItems[txtProductID.Text].Quantity) { //oOrder.ScanItems[txtProductID.Text].Packed = ""; this.ActiveRow(true); } else { this.ActiveRow(false); } Grid.DataBind(); this.txtProductID.Clear(); //this.txtDescription.Text = ""; // return; } else { String Barcode2 = oOrder.GetSecondaryBarcode(txtProductID.Text); if (Barcode2 != "") { txtProductID.Text = Barcode2; goto BarCode_2; } Global.playSimpleSound(5); txtDescription.Text = "PRODUCT NOT IN ORDER"; this.txtProductID.Clear(); this.txtProductID.Focus(); return; } } } #endregion #region txtBoxes if (sender == txtBoxes) { if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtBoxes.Text == "") { txtBoxes.Focus(); return; } if (txtBoxes.Text.ToUpper() == "DONE" || txtBoxes.Text.ToUpper() == "ONE") { txtBoxes.Text = "1"; } oOrder.BoxesPacked = Convert.ToInt16(txtBoxes.Text); oOrder.UpdatePacked(true); Clear(); txtBoxes.Enabled = false; txtOrderID.Enabled = true; txtOrderID.Focus(); return; } } #endregion #region txtGrid if (sender == this.Grid) { if (e.KeyCode.ToString() == "F8") { this.txtProductID.Focus(); return; } if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Up || e.KeyCode == Keys.Down || e.KeyCode == Keys.PageDown) { //return; } } #endregion #region Default Option //Default option switch (e.KeyCode) { case Keys.Tab: if (!e.Shift) { this.SelectNextControl(this.ActiveControl, true, true, true, true); } break; case Keys.Enter: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Down: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Up: this.SelectNextControl(this.ActiveControl, false, true, true, true); break; case Keys.F8: this.Grid.Focus(); break; case Keys.F3: break; case Keys.PageDown: break; //case Keys.<some key>: // ......; // break; } #endregion }
private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { #region txtBrochureID if (sender == txtBrochureID) { if (e.KeyCode == Keys.PageDown || e.KeyCode == Keys.F3) { return; } if (e.KeyCode.ToString() == "F2") { if (oBrochure.View()) { ShowVendor(); } if (txtBrochureID.Text == "") { return; } txtDescription.Focus(); Grid.DataSource = oBrochure.Items.dtItems; Grid.DataBind(); Grid.Focus(); MoveLast(); return; } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtBrochureID.Text.Trim().Length == 0) { Clear(); txtBrochureID.Focus(); } if (oBrochure.Find(txtBrochureID.Text)) { ShowVendor(); Grid.DataSource = oBrochure.Items.dtItems; Grid.DataBind(); Grid.Focus(); MoveLast(); } else { Clear(); oBrochure.ID = txtBrochureID.Text; oBrochure.Items.AddEmpty(); Grid.DataSource = oBrochure.Items.dtItems; Grid.DataBind(); txtDescription.Focus(); } return; } } #endregion #region txtDescription if (sender == txtDescription) { if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { oBrochure.Description = txtDescription.Text; Grid.Focus(); MoveLast(); return; } } #endregion #region Grid if (sender == Grid) { if (e.KeyCode == Keys.F2) { UltraGridRow gridRow; gridRow = Grid.ActiveRow; if (gridRow != null) { if (Grid.ActiveRow.Cells["ProductID"] == Grid.ActiveCell) { if (oProduct.View()) { if (!Contain(Grid.ActiveRow.Cells["ProductID"].Text)) { Grid.ActiveRow.Cells["ProductID"].Value = oProduct.ID; Grid.ActiveRow.Cells["InvCode"].Value = oProduct.InvCode; Grid.ActiveRow.Cells["Description"].Value = oProduct.Description; Grid.ActiveRow.Cells["Price"].Activate(); Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } else { MessageBox.Show("Item already entered"); Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } } } } } if (e.KeyCode == Keys.Delete) { } if (e.KeyCode == Keys.Enter) { if (Grid.ActiveRow.Cells["ProductID"].Text != "" && !Contain(Grid.ActiveRow.Cells["ProductID"].Text)) { if (Grid.ActiveRow.Cells["ProductID"] == Grid.ActiveCell) { if (oProduct.Find(Grid.ActiveRow.Cells["ProductID"].Text)) { if (!Contain(Grid.ActiveRow.Cells["ProductID"].Text)) { Grid.ActiveRow.Cells["ProductID"].Value = oProduct.ID; Grid.ActiveRow.Cells["InvCode"].Value = oProduct.InvCode; Grid.ActiveRow.Cells["Description"].Value = oProduct.Description; Grid.ActiveRow.Cells["Price"].Activate(); Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } else { MessageBox.Show("Item already entered"); Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } } } else if (Grid.ActiveRow.Cells["Price"] == Grid.ActiveCell) { Grid.ActiveRow.Cells["Forecast"].Activate(); Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); return; } if (Grid.GetRow(ChildRow.Last) == Grid.ActiveRow) { oBrochure.Items.AddEmpty(); Grid.DataBind(); MoveLast(); //Grid.PerformAction(UltraGridAction.LastRowInBand, false, false); } else { Grid.PerformAction(UltraGridAction.NextRowByTab, false, false); Grid.ActiveRow.Cells["ProductID"].Activate(); Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } } else { Grid.ActiveRow.Cells["ProductID"].Activate(); Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); Grid.ActiveRow.Cells["Price"].Value = 0; } return; } if (e.KeyCode == Keys.Down) { MoveDown(); return; } if (e.KeyCode == Keys.Up) { Infragistics.Win.UltraWinGrid.UltraGridRow gridRow; gridRow = Grid.ActiveRow; gridRow = gridRow.GetSibling(Infragistics.Win.UltraWinGrid.SiblingRow.Previous); if (gridRow != null) { gridRow.Activate(); //' set ActiveCell Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); } return; //SendKeys.Send("{TAB}"); } } #endregion #region txtProductID if (sender == txtProductID) { if (e.KeyCode.ToString() == "F2") { if (oProduct.View()) { txtProductID.Text = oProduct.ID; txtPDescription.Text = oProduct.Description; } } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtProductID.Text.Trim().Length == 0) { txtProductID.Focus(); } if (oProduct.Find(txtProductID.Text)) { txtProductID.Text = oProduct.ID; txtPDescription.Text = oProduct.Description; } } } #endregion #region txtProductTypeID if (sender == txtProductTypeID) { if (e.KeyCode.ToString() == "F2") { if (oPack.View()) { txtProductTypeID.Text = oPack.ID; txtPTDescription.Text = oPack.Description; } } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtProductTypeID.Text.Trim().Length == 0) { txtProductTypeID.Focus(); } if (oPack.Find(txtProductTypeID.Text)) { txtProductTypeID.Text = oPack.ID; txtPTDescription.Text = oPack.Description; } } } #endregion #region Default Option //Default option switch (e.KeyCode) { case Keys.Tab: if (!e.Shift) { this.SelectNextControl(this.ActiveControl, true, true, true, true); } break; case Keys.Enter: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Down: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Up: this.SelectNextControl(this.ActiveControl, false, true, true, true); break; case Keys.F3: if (MessageBox.Show("Do you really want to Delete this Brochure?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.No) { MessageBox.Show("Operation Cancelled"); return; } oBrochure.Delete(); Grid.DataBind(); Clear(); txtBrochureID.Clear(); txtBrochureID.Focus(); break; case Keys.PageDown: this.Save(); Grid.DataBind(); Clear(); txtBrochureID.Clear(); txtBrochureID.Focus(); break; case Keys.Delete: if (e.Control) { DeleteItem(); } break; //case Keys.<some key>: // ......; // break; } #endregion }
private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { #region txtProductID if (sender == txtProductID) { if (e.KeyCode.ToString() == "F8") { this.Grid.Focus(); } if (e.KeyCode.ToString() == "F2") { if (oOrder.oProduct.View(oOrder.oCustomer)) { this.txtProductID.Text = oOrder.oProduct.ID; return; } } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtProductID.Text == "DONE") { txtProductID.Clear(); txtCollected.Enabled = true; txtCollected.Focus(); return; } if ((txtProductID.Text.Length == 12 && oOrder.oProduct.FindByBarcode(txtProductID.Text)) || oOrder.oProduct.Find(txtProductID.Text)) { Boolean HasBrochure = false; foreach (BrochureByCustomer bc in oOrder.oCustomer.Brochures) { if (oOrder.oProduct.IsInBrochure(bc.BrochureID)) { HasBrochure = true; break; } } if (!HasBrochure) { Global.playSimpleSound(); txtDescription.Text = "This Product Belongs to Other Brochure"; return; } this.IDetail.ProductID = oOrder.oProduct.ID; this.IDetail.Price = oOrder.oProduct.ExtendedPrice(oOrder.oCustomer); this.IDetail.Description = oOrder.oProduct.Description.ToString(); this.IDetail.Length = oOrder.oProduct.Length; this.IDetail.Width = oOrder.oProduct.Width; this.IDetail.Height = oOrder.oProduct.Height; this.txtProductID.Text = oOrder.oProduct.ID; this.txtDescription.Text = oOrder.oProduct.Description; AddItem(); ActiveRow(); txtProductID.Focus(); } else { Global.playSimpleSound(); } this.txtProductID.Focus(); this.txtProductID.Clear(); return; } } #endregion #region txtCollected if (sender == this.txtCollected) { if (oOrder.Collected != txtCollected.Number) { oOrder.Collected = txtCollected.Number; getTotals(); } if (e.KeyCode == Keys.PageDown || e.KeyCode == Keys.Return) { if (!oOrder.oCustomer.Find(CustomerID)) { MessageBox.Show("Please enter a valid Customer ID/School ID "); return; } if (Math.Abs(oOrder.Diff) > 0 && !IsDiff) { Global.playSimpleSound(); IsDiff = true; } else { IsDiff = false; } Save(); Clear(); txtCollected.Enabled = false; txtProductID.Focus(); return; } } #endregion #region Grid if (sender == this.Grid) { if (e.KeyCode == Keys.Enter) { if (Grid.ActiveRow != null) { if (Grid.ActiveCell != null) { if (!Grid.ActiveCell.IsInEditMode) { //' set ActiveCell Grid.ActiveCell = Grid.ActiveRow.Cells["Quantity"]; Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); return; } else { Grid.PerformAction(UltraGridAction.ExitEditMode, true, true); return; } } else { Grid.ActiveCell = Grid.ActiveRow.Cells["Quantity"]; Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); return; } } } if (e.KeyCode == Keys.Down) { Grid.PerformAction(UltraGridAction.BelowRow, false, false); return; } if (e.KeyCode == Keys.Up) { Grid.PerformAction(UltraGridAction.AboveRow, false, false); return; } /* * if (e.KeyCode.ToString()=="Delete") * { * this.DeleteItem(false); * return; * }*/ if (e.KeyCode.ToString() == "F8") { this.txtProductID.Focus(); return; } } #endregion #region Default Option //Default option switch (e.KeyCode) { case Keys.Tab: if (!e.Shift) { this.SelectNextControl(this.ActiveControl, true, true, true, true); } break; case Keys.Enter: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Down: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Up: this.SelectNextControl(this.ActiveControl, false, true, true, true); break; case Keys.F8: this.Grid.Focus(); break; case Keys.F5: { Clear(); txtProductID.Focus(); } break; case Keys.F12: { oOrder.Find(oOrder.GetLastID()); ShowOrder(); } break; case Keys.F3: deleteOrder(); break; case Keys.PageDown: this.Save(); txtProductID.Clear(); txtCollected.Enabled = true; txtCollected.Focus(); return; //case Keys.<some key>: // ......; // break; } #endregion }
private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { #region Grid if (sender == Grid) { if (Grid.ActiveCell != null) { switch (Grid.ActiveCell.Column.Key) { case "Received": if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Down || e.KeyCode == Keys.Tab) { Grid.PerformAction(UltraGridAction.NextRowByTab, false, false); Grid.ActiveCell = Grid.ActiveRow.Cells["Received"]; Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } if (e.KeyCode == Keys.Up) { Grid.PerformAction(UltraGridAction.PrevRowByTab, false, false); Grid.ActiveCell = Grid.ActiveRow.Cells["Received"]; Grid.PerformAction(UltraGridAction.EnterEditMode, false, false); } break; } } return; } #endregion #region txtOrderID if (sender == txtOrderID) { if (e.KeyCode == Keys.F2) { if (oPurchase.View(true)) { oReceive.FindPurchase(oPurchase.ID); txtOrderID.Text = oReceive.ID; txtVendorID.Text = oReceive.VendID; oVendor.Find(oReceive.VendID); txtName.Text = oVendor.Name; if (oReceive.RItems.Count > 0) { Grid.DataSource = oReceive.RItems; Grid.DataBind(); MoveFirst(); txtOrderID.Enabled = false; } else { MessageBox.Show("This PO was already received..."); } return; } this.txtName.Text = oVendor.Name; return; } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtOrderID.Text.Trim() == "") { txtOrderID.Clear(); txtOrderID.Focus(); return; } if (oReceive.FindPurchase(txtOrderID.Text)) { txtVendorID.Enabled = true; txtVendorID.Text = oReceive.VendID; oVendor.Find(oReceive.VendID); txtName.Text = oVendor.Name; Grid.DataSource = oReceive.Items; MoveFirst(); txtOrderID.Enabled = false; return; } else { txtVendorID.Enabled = true; txtVendorID.Focus(); return; } } } #endregion #region txtVendorID if (sender == txtVendorID) { if (e.KeyCode.ToString() == "F2") { if (oVendor.View()) { this.txtVendorID.Text = oVendor.ID; if (!oVendor.Find(txtVendorID.Text)) { this.txtVendorID.Focus(); return; } this.txtName.Text = oVendor.Name; Grid.Focus(); return; } this.txtName.Text = oVendor.Name; } if (e.KeyCode.ToString() == "Return" || e.KeyCode.ToString() == "Tab") { if (!oVendor.Find(txtVendorID.Text)) { this.txtVendorID.Focus(); return; } this.txtName.Text = oVendor.Name; //Grid.DataSource = oVendor.ReOrders.GetDataTable(oVendor); Grid.Focus(); return; } } #endregion #region Default Option //Default option switch (e.KeyCode) { case Keys.Tab: if (!e.Shift) { this.SelectNextControl(this.ActiveControl, true, true, true, true); } break; case Keys.Enter: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Down: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Up: this.SelectNextControl(this.ActiveControl, false, true, true, true); break; case Keys.F3: Delete(); break; case Keys.PageDown: break; //case Keys.<some key>: // ......; // break; } #endregion }
private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { #region txtCustomerID if (sender == txtCustomerID) { if (e.KeyCode == Keys.PageDown || e.KeyCode == Keys.F3) { return; } if (e.KeyCode.ToString() == "F2") { if (oCustomer.View()) { ShowCustomer(); oTeachers.CustomerID = oCustomer.ID; oTeachers.Load(oCustomer.ID); Grid.DataSource = oTeachers.Table; Grid.DataBind(); Grid.Focus(); MoveLast(); return; } } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtCustomerID.Text.Trim().Length == 0) { Clear(); txtCustomerID.Focus(); } if (oCustomer.Find(txtCustomerID.Text)) { ShowCustomer(); oTeachers.CustomerID = oCustomer.ID; oTeachers.Load(oCustomer.ID); Grid.DataSource = oTeachers.Table; Grid.DataBind(); Grid.Focus(); MoveLast(); } else { Clear(); Grid.DataSource = oTeachers.Table; Grid.DataBind(); txtName.Focus(); } return; } } #endregion #region Grid if (sender == Grid) { if (e.KeyCode == Keys.F2) { UltraGridRow gridRow; gridRow = Grid.ActiveRow; if (gridRow != null) { if (Grid.ActiveRow.Cells["Teacher"] == Grid.ActiveCell) { /* * if (oProduct.View()) * { * if (!oImages.Items.Contains(Grid.ActiveRow.Cells["ProductID"].Text)) * { * * Grid.ActiveRow.Cells["ProductID"].Value = oProduct.ID; * Grid.ActiveRow.Cells["Description"].Value = oProduct.Description; * Grid.ActiveRow.Cells["Amount"].Activate(); * Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); * return; * } * else * { * MessageBox.Show("Item already entered"); * Grid.ActiveCell = Grid.ActiveRow.Cells["ProductID"]; * Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); * return; * } * } */ } } } if (e.KeyCode == Keys.Delete) { } if (e.KeyCode == Keys.Enter) { Infragistics.Win.UltraWinGrid.UltraGridRow gridRow; gridRow = Grid.ActiveRow; if (gridRow != null) { if (Grid.ActiveCell.Text.Trim() != "" && Grid.ActiveRow.Cells["Teacher"] == Grid.ActiveCell) { if (Contain(Grid.ActiveRow.Cells["Teacher"].Text)) { MessageBox.Show("Item already entered"); Grid.ActiveCell = Grid.ActiveRow.Cells["Teacher"]; Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); Grid.ActiveRow.Cells["Teacher"].Value = ""; } else { this.MoveLast(); } } return; } } if (e.KeyCode == Keys.Down) { MoveDown(); return; } if (e.KeyCode == Keys.Up) { Infragistics.Win.UltraWinGrid.UltraGridRow gridRow; gridRow = Grid.ActiveRow; gridRow = gridRow.GetSibling(Infragistics.Win.UltraWinGrid.SiblingRow.Previous); if (gridRow != null) { gridRow.Activate(); //' set ActiveCell Grid.ActiveCell = Grid.ActiveRow.Cells["Teacher"]; Grid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode, false, false); } return; } } #endregion #region txtName if (sender == txtName) { if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { // oImages.Description = txtName.Text; Grid.Focus(); MoveLast(); return; } } #endregion #region Default Option //Default option switch (e.KeyCode) { case Keys.Tab: if (!e.Shift) { this.SelectNextControl(this.ActiveControl, true, true, true, true); } break; case Keys.Enter: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Down: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Up: this.SelectNextControl(this.ActiveControl, false, true, true, true); break; case Keys.F3: oTeachers.Delete(); Clear(); // oImages.Items.dtItems.Rows.Clear(); Grid.DataBind(); txtCustomerID.Clear(); txtCustomerID.Focus(); break; case Keys.PageDown: MoveLast(); oTeachers.Save(); Grid.DataBind(); Clear(); txtCustomerID.Clear(); txtCustomerID.Focus(); break; case Keys.Delete: if (e.Control) { DeleteItem(); } break; //case Keys.<some key>: // ......; // break; } #endregion }
public void Clear() { txtOrderID.Clear(); txtVendorID.Clear(); // Grid.Rows.Dispose(); }
private void txtCustomerID_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { #region txtOrderID if (sender == txtOrderID) { if (e.KeyCode.ToString() == "Return" || e.KeyCode.ToString() == "Tab") { if (txtOrderID.Text.Trim() == "") { txtOrderID.Clear(); txtOrderID.Focus(); return; } int split = txtOrderID.Text.IndexOf('.'); if (split > -1) { txtOrderID.Text = txtOrderID.Text.Substring(0, split).Trim(); } Int32 OrderID; try { OrderID = Convert.ToInt32(txtOrderID.Text); } catch (Exception ex) { Global.ShowNotifier(ex.Message); Global.playSimpleSound(3); txtOrderID.Clear(); txtOrderID.Focus(); return; } if (oPacking.Find(OrderID, Global.CurrrentLine)) { if (oPacking.ScanItems.Count == 0) { MessageBox.Show("This order does exist but has no items with this product type: " + Global.CurrrentLine); txtOrderID.Clear(); txtOrderID.Focus(); return; } if (CompanyID != oPacking.CompanyID) { MessageBox.Show("Different Order's Company/Season"); txtOrderID.Clear(); txtOrderID.Focus(); return; } txtTeacher.Text = oPacking.Teacher; txtStudent.Text = oPacking.Student; Order.PackByOrder oOB = new Order.PackByOrder(); if (oOB.Find(Convert.ToInt32(txtOrderID.Text), Global.CurrrentLine)) { if (oOB.Packed) // (oPacking.Packed) { MessageBox.Show("Order already packed by " + oOB.Packer + " " + oOB.BoxesPacked.ToString() + " boxes"); txtBoxes.Enabled = true; txtBoxes.Text = oOB.BoxesPacked.ToString(); txtBoxes.Focus(); return; } } /* * if (oPacking.Packed) * { * MessageBox.Show("Order already packed by " + oPacking.Packer + " " + oPacking.BoxesPacked.ToString()+" boxes"); * txtBoxes.Enabled = true; * txtBoxes.Text = oPacking.BoxesPacked.ToString(); * txtBoxes.Focus(); * * return; * } */ this.ShowOrder(); txtOrderID.Enabled = false; txtBoxes.Enabled = false; txtProductID.BackColor = Color.White; txtProductID.Focus(); return; } else { MessageBox.Show("Order not found..."); txtOrderID.Clear(); txtOrderID.Focus(); return; } } } #endregion #region txtProductID if (sender == txtProductID) { if (e.KeyCode.ToString() == "F8") { this.Grid.Focus(); } if (e.KeyCode.ToString() == "F2") { if (oPacking.oProduct.View()) { this.txtProductID.Text = oPacking.oProduct.ID; return; } } if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { txtDescription.Clear(); if (txtProductID.Text.ToUpper() == "DONE") { if (!oPacking.IfDone()) { Global.playSimpleSound(1); txtDescription.Text = "You have products left"; ActiveLeft(); txtProductID.Clear(); txtProductID.Focus(); return; } txtBoxes.Clear(); txtBoxes.Enabled = true; txtBoxes.Focus(); //txtOrderID.Enabled = true; return; } if (txtProductID.Text.ToUpper() == "ABORT") { Clear(); groupBox2.Focus(); txtOrderID.Enabled = true; txtOrderID.Focus(); return; } BarCode_2: if (txtProductID.Text.Length < 12) { if (!oPacking.ScanItems.Contains(txtProductID.Text)) { txtProductID.Text = oPacking.GetItem(txtProductID.Text); if (txtProductID.Text == "") { Global.playSimpleSound(2); txtDescription.Text = "PRODUCT NOT IN ORDER"; this.txtProductID.Clear(); this.txtProductID.Focus(); return; } } } //Check by Code if (oPacking.ScanItems.Contains(txtProductID.Text)) { if (oPacking.ScanItems[txtProductID.Text].Quantity < (oPacking.ScanItems[txtProductID.Text].Scanned + 1)) { Global.playSimpleSound(3); txtDescription.Text = "EXTRA PRODUCT !!!"; txtProductID.Clear(); return; } oPacking.ScanItems[txtProductID.Text].Scanned += 1; //if (oPacking.ScanItems[txtProductID.Text].Scanned == oPacking.ScanItems[txtProductID.Text].Quantity) // DeleteRow(); this.txtDescription.Text = oPacking.ScanItems[txtProductID.Text].Description; //this.ScannedItems.Text = oPacking.ScanItems[txtProductID.Text].ProductID + " - " + oPacking.ScanItems[txtProductID.Text].Description; //this.ScannedItems.Items.Add(oPacking.ScanItems[txtProductID.Text].ProductID + " - " + oPacking.ScanItems[txtProductID.Text].Description); if (oPacking.ScanItems[txtProductID.Text].Scanned == oPacking.ScanItems[txtProductID.Text].Quantity) { //oPacking.ScanItems[txtProductID.Text].Packed = ""; this.ActiveRow(true); } else { this.ActiveRow(false); } // Grid.DataBind(); this.txtProductID.Clear(); //this.txtDescription.Text = ""; // return; } else { String Barcode2 = oPacking.GetSecondaryBarcode(txtProductID.Text); if (Barcode2 != "") { txtProductID.Text = Barcode2; goto BarCode_2; } Global.playSimpleSound(5); txtDescription.Text = "PRODUCT NOT IN ORDER"; this.txtProductID.Clear(); this.txtProductID.Focus(); return; } } } #endregion #region txtBoxes if (sender == txtBoxes) { if (e.KeyCode == Keys.Return || e.KeyCode == Keys.Tab) { if (txtBoxes.Text == "") { txtBoxes.Focus(); return; } if (txtBoxes.Text.ToUpper() == "DONE" || txtBoxes.Text.ToUpper() == "ONE") { txtBoxes.Text = "1"; } try { oPacking.BoxesPacked = Convert.ToInt16(txtBoxes.Text); //oPacking.Lines[Global.CurrrentLine].BoxesPacked = Convert.ToInt16(txtBoxes.Text); } catch { txtBoxes.Text = ""; txtBoxes.Focus(); return; } oPacking.UpdatePacked(true, Global.CurrrentLine); PrintTitle(); Clear(); txtBoxes.Enabled = false; txtOrderID.Enabled = true; txtOrderID.Focus(); return; } } #endregion #region txtGrid if (sender == this.Grid) { //MessageBox.Show(e.KeyData.ToString()); if (Char.IsDigit(Convert.ToChar(e.KeyValue))) { txtProductID.Focus(); txtProductID.Text += Convert.ToChar(e.KeyValue).ToString(); SendKeys.Send("{END}"); return; } if (e.KeyCode.ToString() == "F8") { this.txtProductID.Focus(); return; } if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Up || e.KeyCode == Keys.Down || e.KeyCode == Keys.PageDown) { //return; } } #endregion #region Default Option //Default option switch (e.KeyCode) { case Keys.Tab: if (!e.Shift) { this.SelectNextControl(this.ActiveControl, true, true, true, true); } break; case Keys.Enter: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Down: this.SelectNextControl(this.ActiveControl, true, true, true, true); break; case Keys.Up: this.SelectNextControl(this.ActiveControl, false, true, true, true); break; case Keys.F8: this.Grid.Focus(); break; case Keys.F3: break; case Keys.PageDown: break; //case Keys.<some key>: // ......; // break; } #endregion }