/// <summary> /// Model /// </summary> private void GridLookUpModel_PreviewKeyDown() { if (string.IsNullOrEmpty(gridLookUpEditModelID.Text)) { Ultils.GridLookUpEditControlNotNull(gridLookUpEditModelID, "Model"); } else { _currentModel = _modelService.GetModelById(gridLookUpEditModelID.EditValue.ToString()); if (_currentModel != null) { lblQuantityModel.Text = $"/{_currentModel.Quantity}"; txtWorkingOrder.Focus(); } else { Ultils.GridLookUpEditNoMessage(gridLookUpEditModelID); if (XtraMessageBox.Show("Model [" + gridLookUpEditModelID.Text + "] chưa có trong hệ thống.\nBạn có muốn thêm mới Model?", "THÔNG BÁO", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { var addModel = new FormAddModel(gridLookUpEditModelID.EditValue.ToString(), gridLookUpEditModelID.Text, txtOperatorCode.Text); addModel.ShowDialog(); LoadGridLookupEditModel(); } else { DialogResult = DialogResult.No; gridLookUpEditModelID.SelectAll(); } } } }
private void gridLookUpEditModelID_ButtonPressed(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (e.Button.Index == 1) { var addModel = new FormAddModel(null, null, txtOperatorCode.Text); addModel.ShowDialog(); LoadGridLookupEditModel(); } }