private void ImportLineToSupplier(PositionLvi line) { if (line == null) { return; } try { var _newPosition = line.DataObj; _newPosition.SupplierId = m_supplier.SupplierId; if (GParams.Instance.BasarCom.PositionGet(_newPosition.PositionNo, true) == null) { var _created = false; var _createdSpec = false; GParams.Instance.BasarCom.PositionCreate(_newPosition, out _created, out _createdSpec); if (_created && _createdSpec) { m_lbErrorMsg.Text = @"Position angenommen..."; m_lbErrorMsg.BackColor = Color.FromArgb(255, 100, 255, 100); m_globalList.Remove(line); PlayConfirmedSound(); } else { m_lbErrorMsg.Text = @"Positionsnummer existiert bereits!"; m_lbErrorMsg.BackColor = Color.FromArgb(255, 100, 255, 100); m_globalList.Remove(line); PlayBadSound(); } } else { m_lbErrorMsg.Text = @"Positionsnummer existiert bereits!"; m_lbErrorMsg.BackColor = Color.FromArgb(255, 255, 100, 100); m_globalList.Remove(line); PlayBadSound(); } } catch (Exception _ex) { MessageBox.Show(_ex.Message); } dvTextBox1.Focus(); dvTextBox1.SelectAll(); }
private void ReturnLineToSupplier(PositionLvi line) { if (line == null) { return; } try { var _newPosition = line.DataObj; _newPosition.SupplierId = this.m_supplier.SupplierId; var _posToReturn = GParams.Instance.BasarCom.PositionGet(_newPosition.PositionNo, true); if (_posToReturn != null) { if (_posToReturn.ReturnedToSupplierAt.HasValue && _posToReturn.ReturnedToSupplierAtSpecified) { MessageBox.Show("Positionsnummer wurde verkauft!"); } else { _posToReturn.ReturnedToSupplierAt = DateTime.Now; var _updateDone = false; var _updateDoneSpec = false; GParams.Instance.BasarCom.PositionUpdate(_posToReturn, out _updateDone, out _updateDoneSpec); bool _v1 = false, _v2 = false; GParams.Instance.BasarCom.SetSupplierToReturned(_posToReturn.SupplierId, true, true, out _v1, out _v2); if (!(_updateDone && _updateDoneSpec)) { MessageBox.Show("Fehler beim eintragen der Rückgabe..."); } } } else { MessageBox.Show("Positionsnummer existiert nicht!"); } } catch (Exception _ex) { MessageBox.Show(_ex.Message); } if (this.ReLoadhRestScreen(null) > 0) { this.dvTextBox1.Focus(); this.dvTextBox1.Focus(); this.dvTextBox1.SelectAll(); } else { this.PlayConfirmedSound(); System.Threading.Thread.Sleep(500); this.PlayConfirmedSound(); this.Close(); } }