private void OnLeaveControl(object sender, System.EventArgs e) { const string METHOD_NAME = THIS + ". OnLeaveControl()"; try { FormControlComponents.OnLeaveControl(sender, e); } catch (Exception ex) { // displays the error message. PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error); // log message. try { Logger.LogMessage(ex, METHOD_NAME, Level.ERROR); } catch { PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
/// <summary> /// Process onleave control event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <author> Son HT, Jan 20, 2005</author> private void OnLeaveControl(object sender, System.EventArgs e) { const string METHOD_NAME = THIS + ".txtCode_Leave()"; //Only use when users use this to search for existing product try { FormControlComponents.OnLeaveControl(sender, e); } catch (Exception ex) { // displays the error message. PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error); // log message. try { Logger.LogMessage(ex, METHOD_NAME, Level.ERROR); } catch { PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error); } } }
private void txtBeginWO_Leave(object sender, EventArgs e) { const string METHOD_NAME = THIS + ".txtBeginWO_Leave"; try { FormControlComponents.OnLeaveControl(sender, e); if (!btnSearchBeginWO.Enabled || !txtBeginWO.Modified) { return; } txtBeginWO.Text = txtBeginWO.Text.Trim(); if (txtBeginWO.Text == String.Empty) { intWorkOrderMasterID = 0; return; } UtilsBO objUtilsBO = new UtilsBO(); intWorkOrderMasterID = 0; //search for master location id Hashtable hashCondition = new Hashtable(); hashCondition.Add(PRO_WorkOrderMasterTable.MASTERLOCATIONID_FLD, mMasterLocationID); DataTable dtResult = objUtilsBO.GetRows(REMAIN_WO_FOR_ISSUE_VIEW, PRO_WorkOrderMasterTable.WORKORDERNO_FLD, txtBeginWO.Text, hashCondition); if (dtResult.Rows.Count == 0) { txtBeginWO.Text = String.Empty; btnSearchBeginWO_Click(null, null); } else { if (dtResult.Rows.Count > 1) { btnSearchBeginWO_Click(null, null); } else { intWorkOrderMasterID = int.Parse(dtResult.Rows[0][PRO_WorkOrderMasterTable.WORKORDERMASTERID_FLD].ToString()); txtBeginWO.Text = dtResult.Rows[0][PRO_WorkOrderMasterTable.WORKORDERNO_FLD].ToString(); } } if (intWorkOrderMasterID <= 0) { txtBeginWO.Text = String.Empty; } } catch (PCSException ex) { // displays the error message. PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error); // log message. try { Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR); } catch { PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error); } } catch (Exception ex) { // displays the error message. PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error); // log message. try { Logger.LogMessage(ex, METHOD_NAME, Level.ERROR); } catch { PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error); } } }