private bool ValidateDataInput() { bool bValidate = true; errProvider.Clear(); if (txtGSCode.Text.Trim().Equals("")) { errProvider.SetError(txtGSCode, SGMText.GASSTATION_DATA_INPUT_GS_ID_ERR); bValidate = false; } else if (!txtGSCode.Text.Trim().Equals(m_stGSIDEdit)) { Task <String> task = SGM_WaitingIdicator.WaitingForm.waitingFrm.progressReporter.RegisterTask( () => { return(m_service.SGMManager_CheckGasStationExist(txtGSCode.Text.Trim())); }); SGM_WaitingIdicator.WaitingForm.waitingFrm.progressReporter.RegisterContinuation(task, () => { String stResponse = task.Result as String; DataTransfer response = JSonHelper.ConvertJSonToObject(stResponse); if (response.ResponseCode == DataTransfer.RESPONSE_CODE_SUCCESS) { if (response.ResponseDataBool) { errProvider.SetError(txtGSCode, SGMText.GASSTATION_DATA_INPUT_EXIST_GS_ID_ERR); bValidate = false; } } else { errProvider.SetError(txtGSCode, SGMText.GASSTATION_GET_GS_ERR); frmMsg.ShowMsg(SGMText.SGM_ERROR, SGMText.CUSTOMER_GET_CUS_ERR + "\n" + response.ResponseErrorMsg + ":\n" + response.ResponseErrorMsgDetail, SGMMessageType.SGM_MESSAGE_TYPE_ERROR); bValidate = false; } }, SynchronizationContext.Current); } if (cboGasStore.Items.Count <= 0) { errProvider.SetError(cboGasStore, SGMText.GASSTATION_DATA_INPUT_GS_GASTORE_ERR); bValidate = false; } if (txtGSName.Text.Trim().Equals("")) { errProvider.SetError(txtGSName, SGMText.GASSTATION_DATA_INPUT_GS_NAME_ERR); bValidate = false; } if (txtGSAddress.Text.Trim().Equals("")) { errProvider.SetError(txtGSAddress, SGMText.GASSTATION_DATA_INPUT_GS_ADDRESS_ERR); bValidate = false; } return(bValidate); }