/// <summary> /// 分配设备 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DevPortion_Click(object sender, EventArgs e) { try { // 获取清单号 if (DGcommand.SelectedItem == null) { Notice.Show("请选择需要分配设备的清单!", "提示", 3, MessageBoxIcon.Info); return; } string wcs = (DGcommand.SelectedItem as DataRowView).Row[0].ToString(); // 获取WCS清单 String sql = String.Format(@"select * from wcs_command_v where WCS_NO = '{0}'", wcs); DataTable dtcommand = DataControl._mMySql.SelectAll(sql); if (DataControl._mStools.IsNoData(dtcommand)) { return; } WCS_COMMAND_V com = dt.ToDataEntity <WCS_COMMAND_V>(); _TASK.AllotItemDev(com); RefreshData(); GetDGitemInfo(); Notice.Show("分配完成!", "完成", 3, MessageBoxIcon.Success); } catch (Exception ex) { Notice.Show("分配失败: " + ex.Message, "错误", 3, MessageBoxIcon.Error); } }