private void okSimpleButton_Click(System.Object sender, EventArgs e) { try { m_Users = new UsersBLL(); string securityLevel = m_Users.GetUserSecurityLevel(FilterQuote(userNameTextEdit.Text), FilterQuote(passwordTextEdit.Text)); if (string.IsNullOrEmpty(securityLevel)) { m_Wrong += 1; if (m_Wrong >= 4) { MessageBox.Show("Wrong User Name or Password", "Incorrect Login", MessageBoxButtons.OK, MessageBoxIcon.Error); Close(); return; } else { MessageBox.Show("Wrong User Name or Password", "Incorrect Login", MessageBoxButtons.OK, MessageBoxIcon.Error); passwordTextEdit.Text = ""; userNameTextEdit.Focus(); userNameTextEdit.SelectionLength = userNameTextEdit.Text.Length; return; } } else { Properties.Settings.Default.UserName = userNameTextEdit.Text; Properties.Settings.Default.UserSecurityLevel = securityLevel; DialogResult = DialogResult.OK; Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error Encounterd", MessageBoxButtons.OK); } }
public void PrepareNewRecord() { saveSimpleButton.Tag = null; editSimpleButton.Tag = null; descriptionMemoEdit.Text = null; if (DateTime.Now.TimeOfDay < new TimeSpan(9, 0, 0)) { adjustmentDateEdit.DateTime = DateTime.Today.AddDays(-1); } else { adjustmentDateEdit.DateTime = DateTime.Today; } itemLookUpEdit.EditValue = null; originalQtyTextEdit.Text = null; newQtyTextEdit.Text = null; customerLookUpEdit.EditValue = null; reasonMemoExEdit.EditValue = null; locationLookUpEdit.EditValue = UsersBLL.GetUsersLocalLocation(Session.DefaultSession, Properties.Settings.Default.UserName).Oid; lpnLookUpEdit.Text = ""; originalLotLookUpEdit.Text = ""; newLotTextEdit.Text = ""; m_newLpn = false; }
private static void DeleteInventoryConsumption(Inventory productionRecord, Session inventorySession) { BomConsumption consumption = null; LocationInventory inventoryOnHand = null; using (XPCollection <BomConsumption> consumptions = productionRecord.InventoryConsumption) { for (int i = consumptions.Count - 1; i >= 0; i--) { consumption = consumptions[i]; inventoryOnHand = inventorySession.FindObject <LocationInventory>(new BinaryOperator(LocationInventory.Fields.LocationInventoryItem.ItemID.PropertyName, consumption.RawMatID.ItemID, BinaryOperatorType.Equal) & new BinaryOperator(LocationInventory.Fields.Location.Oid, UsersBLL.GetUsersLocalLocation(inventorySession, Properties.Settings.Default.UserName).Oid, BinaryOperatorType.Equal)); inventoryOnHand.QuantityOnHand += (float)(consumption.QuantityUsed + consumption.ScrapFactorUsed); inventoryOnHand.Save(); consumption.Delete(); } } }