private void btnShortConfirm_Click(object sender, EventArgs e) { if (gridShort.Rows.Count <= 0) { return; } //登录验证 #if DEBUG #else ShortConfirmForm form = new ShortConfirmForm(); if (form.ShowDialog() == DialogResult.OK) #endif { foreach (DataGridViewRow row in gridShort.Rows) { CJianHuoHu jh = row.Tag as CJianHuoHu; if (jh != null) { int shortqty = getShortQty(jh.should_qty, jh.real_qty); if (shortqty > 0) { LocalDataService.updateShortJianHuo(jh.hu, jh.mat, shortqty); } } } MetroMessageBox.Show(this, "短拣成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void btnShortConfirm_Click(object sender, EventArgs e) { if (gridShort.Rows.Count <= 0) { return; } //登录验证 ShortConfirmForm form = new ShortConfirmForm(); if (form.ShowDialog() == DialogResult.OK) { List <PKDeliverBoxShortPickDetailInfo> shortList = new List <PKDeliverBoxShortPickDetailInfo>(); foreach (DataGridViewRow row in gridShort.Rows) { PKDeliverBoxShortPickDetailInfo item = new PKDeliverBoxShortPickDetailInfo(); item.HU = (row.Tag as ShortPickBoxInfo).HU; item.LGNUM = SysConfig.LGNUM; item.PICK_TASK = (row.Tag as ShortPickBoxInfo).PICK_TASK; item.PICK_TASK_ITEM = (row.Tag as ShortPickBoxInfo).PICK_TASK_ITEM; item.MATNR = (row.Tag as ShortPickBoxInfo).MATNR; item.QTY = (row.Tag as ShortPickBoxInfo).RQTY; item.DJQTY = (row.Tag as ShortPickBoxInfo).SHORTQTY; if (item.QTY == 0 && item.DJQTY == 0) { continue; } shortList.Add(item); } if (LocalDataService.SaveShortPickDetail(shortList)) { MetroMessageBox.Show(this, "短拣成功,请重新投放通道机检测", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); //清空列表 this.Invoke(new Action(() => { gridShort.Rows.Clear(); })); } else { MetroMessageBox.Show(this, "短拣失败,可能是网络不稳定,请稍候重试", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }