private void BtnSelect_Click(object sender, RoutedEventArgs e) { try { // 清空 TBawcX.Text = ""; TBawcYt.Text = ""; TBawcZt.Text = ""; TBawcYs.Text = ""; TBawcZs.Text = ""; TBrgv1.Text = ""; TBrgv2.Text = ""; string area = CBarea.Text; string x = TBx.Text; string y = TBy.Text; string z = TBz.Text; if (string.IsNullOrEmpty(area) || string.IsNullOrEmpty(x) || string.IsNullOrEmpty(y) || string.IsNullOrEmpty(z)) { Notice.Show("请完整填空!", "提示", 3, MessageBoxIcon.Info); return; } wmsloc = string.Format("{0}-{1}-{2}-{3}", area, x, y, z); WCS_CONFIG_LOC loc = CommonSQL.GetWcsLoc(wmsloc); if (string.IsNullOrEmpty(loc.WMS_LOC)) { Notice.Show("无对应坐标数据!", "提示", 3, MessageBoxIcon.Info); return; } string[] t = loc.AWC_LOC_TRACK.Split('-'); string[] s = loc.AWC_LOC_STOCK.Split('-'); TBawcX.Text = t[0]; TBawcYt.Text = t[1]; TBawcZt.Text = t[2]; TBawcYs.Text = s[1]; TBawcZs.Text = s[2]; TBrgv1.Text = loc.RGV_LOC_1; TBrgv2.Text = loc.RGV_LOC_2; BtnSave.IsEnabled = true; } catch (Exception ex) { Notice.Show(ex.Message, "错误", 3, MessageBoxIcon.Error); } }