private void btnOK_Click(object sender, EventArgs e) { string strBId = ""; #region 检查完整性 //检测是否录入全 if (txt_cMNo.Text.Trim() == "") { MessageBox.Show("对不起,物料编码不能为空!", "", MessageBoxButtons.OK, MessageBoxIcon.Information); txt_cMNo.Focus(); return; } if (this.txt_fQty.Text.Trim() == "") { MessageBox.Show("对不起,物料数量不能为空!", "", MessageBoxButtons.OK, MessageBoxIcon.Information); txt_fQty.Focus(); return; } if (!IsNumberic(txt_fQty.Text.Trim())) { MessageBox.Show("对不起,物料数量为非法数值!", "", MessageBoxButtons.OK, MessageBoxIcon.Information); txt_fQty.SelectAll(); txt_fQty.Focus(); return; } if (txt_cUnit.Text.Trim() == "") { MessageBox.Show("对不起,单位不能为空!", "", MessageBoxButtons.OK, MessageBoxIcon.Information); txt_cUnit.SelectAll(); txt_cUnit.Focus(); return; } #endregion strBId = drvItem["cBNo"].ToString(); UIToDataRowView(drvItem, grdEdit); string sErr = ""; string sX = DBFuns.sp_Chk_WriteAjustDtl(AppInformation.SvrSocket, UserInformation.UserName, UserInformation.UnitId, "WMS", strBId, txt_cWHId.Text.Trim(), txt_cPosId.Text.Trim(), txt_nPalletId.Text.Trim(), txt_cBoxId.Text.Trim(), txt_cMNo.Text.Trim(), double.Parse(txt_fQty.Text.Trim()), txt_cBNoIn.Text.Trim(), int.Parse(txt_nItemIn.Text.Trim()), "", txt_cWHIdErp.Text.Trim(), txt_cAreaIdErp.Text.Trim(), txt_cPosIdErp.Text.Trim(), out sErr); if (sX.Trim() != "" && sX.Trim() != "0" && sErr.Trim() != "") { MessageBox.Show(sErr); } else { Close(); } }
private void btnOK_Click(object sender, EventArgs e) { string pAjustNo = ""; if (this.txt_cMNo.Text.Trim() == "") { MessageBox.Show("对不起,物料编码不能为空!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.txt_cMNo.Focus(); } else if (this.txt_fQty.Text.Trim() == "") { MessageBox.Show("对不起,物料数量不能为空!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.txt_fQty.Focus(); } else if (!FrmSTable.IsNumberic(this.txt_fQty.Text.Trim())) { MessageBox.Show("对不起,物料数量为非法数值!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.txt_fQty.SelectAll(); this.txt_fQty.Focus(); } else if (this.txt_cUnit.Text.Trim() == "") { MessageBox.Show("对不起,单位不能为空!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.txt_cUnit.SelectAll(); this.txt_cUnit.Focus(); } else { pAjustNo = this.drvItem["cBNo"].ToString(); this.UIToDataRowView(this.drvItem, this.grdEdit); string sErr = ""; string str3 = DBFuns.sp_Chk_WriteAjustDtl(base.AppInformation.SvrSocket, base.UserInformation.UserName, base.UserInformation.UnitId, "WMS", pAjustNo, this.txt_cWHId.Text.Trim(), this.txt_cPosId.Text.Trim(), this.txt_nPalletId.Text.Trim(), this.txt_cBoxId.Text.Trim(), this.txt_cMNo.Text.Trim(), double.Parse(this.txt_fQty.Text.Trim()), this.txt_cBNoIn.Text.Trim(), int.Parse(this.txt_nItemIn.Text.Trim()), "", out sErr); if (((str3.Trim() != "") && (str3.Trim() != "0")) && (sErr.Trim() != "")) { MessageBox.Show(sErr); } else { base.Close(); } } }