/// <summary> /// 添加 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAdd_Click(object sender, EventArgs e) { if (!m_workbenchServer.Add(txtWorkbench.Text, "", out m_findWorkbench, out m_err)) { MessageDialog.ShowErrorMessage(m_err); return; } RefreshDataGridView(m_findWorkbench); RefreshControl(); }
/// <summary> /// 添加工位 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAddWorkbench_Click(object sender, EventArgs e) { txtWorkbench.Text = txtWorkbench.Text.Trim(); if (GlobalObject.GeneralFunction.IsNullOrEmpty(txtWorkbench.Text)) { MessageDialog.ShowPromptMessage("工位号不允许为空"); return; } IQueryable <View_P_Workbench> result = null; if (m_workbenchService.Add(txtWorkbench.Text, txtWorkbenchRemark.Text.Trim(), out result, out m_error)) { MessageDialog.ShowPromptMessage("添加成功"); dgvWorkbench.DataSource = result; } else { MessageDialog.ShowErrorMessage(m_error); } }