private void btnOK_Click(object sender, EventArgs e) { if (this.bsGrid.Count == 0) { MessageBox.Show("对不起,没有任务数据可下发!"); } else if ((this.grdData.SelectedRows != null) && (this.grdData.SelectedRows.Count == 0)) { MessageBox.Show("对不起,没有选择要下发的任务数据!"); } else { int num = 0; foreach (DataGridViewRow row in this.grdData.SelectedRows) { if (int.Parse(row.Cells[this.colnStatus.Name].Value.ToString()) < 1) { string sErr = ""; if ((PubDBCommFuns.sp_Chk_DoCheckTask(base.AppInformation.SvrSocket, base.UserInformation.UserName, "WMS", base.UserInformation.UnitId, row.Cells[this.colcPosId.Name].Value.ToString().Trim(), int.Parse(this.cmb_Station.Text.Trim()), this._CheckNo, out sErr) == "0") || (sErr.Trim() == "")) { num++; } } } MessageBox.Show("已经成功下发:" + num.ToString() + " 条盘点任务!"); this._IsOK = num > 0; base.Close(); } }
private void btnOK_Click(object sender, EventArgs e) { if (bsGrid.Count == 0) { MessageBox.Show("对不起,没有任务数据可下发!"); return; } if (grdData.SelectedRows != null && grdData.SelectedRows.Count == 0) { MessageBox.Show("对不起,没有选择要下发的任务数据!"); return; } int iX = 0; foreach (DataGridViewRow dr in grdData.SelectedRows) { if (int.Parse(dr.Cells[colnStatus.Name].Value.ToString()) < 1) { string sErr = ""; string sX = PubDBCommFuns.sp_Chk_DoCheckTask(AppInformation.SvrSocket, UserInformation.UserName, "WMS", UserInformation.UnitId, dr.Cells[colcPosId.Name].Value.ToString().Trim(), int.Parse(cmb_Station.Text.Trim()), _CheckNo, out sErr); if (sX == "0" || sErr.Trim() == "") { iX++; } } } MessageBox.Show("已经成功下发:" + iX.ToString() + " 条盘点任务!"); _IsOK = iX > 0; Close(); }