private bool AlreadyExistsInDiffLot(string sn) { BinaryOperator lotFilter = new BinaryOperator("LotId", m_lotId, BinaryOperatorType.NotEqual); BinaryOperator snFilter = new BinaryOperator("SerialNumber", sn); GroupOperator groupOperator = new GroupOperator(new CriteriaOperator[] { lotFilter, snFilter }); NSLotIdSerial nsLotIdSerial = m_session.FindObject <NSLotIdSerial>(groupOperator); if (nsLotIdSerial != null) { // Check if the lot is still in inventory if (Scout.Core.Service <IInventoryService>().GetItemById (m_session, nsLotIdSerial.LotId) != null) { MessageBox.Show("This sn already exists for a different lot.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(true); } } return(false); }
private void SaveNewSerial(string sn) { NSLotIdSerial nsLotIdSerial = Scout.Core.Data.CreateEntity <NSLotIdSerial>(m_session); nsLotIdSerial.UserName = SCOUT.Core.Security.UserSecurity.CurrentUser.Login; nsLotIdSerial.TimeStamp = DateTime.Now; nsLotIdSerial.LotId = m_lotId; nsLotIdSerial.SerialNumber = sn; nsLotIdSerial.Revision = revText.Text; Scout.Core.Data.Save(m_session); }
private void EmbeddedNavigator_ButtonClick(object sender, NavigatorButtonClickEventArgs e) { if (e.Button.ButtonType == NavigatorButtonType.Remove) { NSLotIdSerial nsUnit = snView.GetFocusedRow() as NSLotIdSerial; if (nsUnit != null) { if (Scout.Core.UserInteraction.Dialog.AskQuestion ("Do you really want to delete " + nsUnit.SerialNumber + " ?") == DialogResult.Yes) { e.Handled = false; RefreshCounts(); snText.Focus(); return; } } e.Handled = true; } }
private bool AlreadyExistsForLot(string sn) { BinaryOperator lotFilter = new BinaryOperator("LotId", m_lotId); BinaryOperator snFilter = new BinaryOperator("SerialNumber", sn); GroupOperator groupOperator = new GroupOperator(new CriteriaOperator[] { lotFilter, snFilter }); NSLotIdSerial nsLotIdSerial = m_session.FindObject <NSLotIdSerial>(groupOperator); if (nsLotIdSerial != null) { MessageBox.Show("This sn already exists for this lot.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(true); } return(false); }