private void btn_OK_Click(object sender, EventArgs e) { if (this.bds_Item.Count == 0) { MessageBox.Show("无字段字典表数据!"); } else if (!(this.cmb_Item.Text.Trim() != "") || (this.cmb_Item.SelectedIndex <= -1)) { MessageBox.Show("请选修改项目!"); } else { bool flag = true; DataRowView current = null; current = (DataRowView)this.bds_Item.Current; if (current != null) { string str = current["cColName"].ToString(); string text = this.txt_ItemValue.Text; string str3 = current["cDataType"].ToString(); string str4 = str3.Trim(); if ((str4 != null) && (str4 != "string")) { if (!(str4 == "int")) { if (str4 == "double") { flag = FrmSTable.IsNumberic(text.Trim()); } else if (str4 == "date") { flag = FrmSTable.IsDateTime(text.Trim()); } else if (!(str4 == "bool")) { } } else { flag = FrmSTable.IsInteger(text.Trim()); } } if (!flag) { MessageBox.Show("录入项目值为非法数据,请录入正确的数据!"); this.txt_ItemValue.SelectAll(); this.txt_ItemValue.Focus(); } else if (this._doBatchUpdateData != null) { this._doBatchUpdateData(str.Trim(), text, str3.Trim()); } } } }
private void txt_RTotal_TextChanged(object sender, EventArgs e) { double num = 0.0; double num2 = 0.0; double num3 = 0.0; double num4 = 0.0; double num5 = 0.0; if ((this.txt_RTotal.Text.Trim() != "") && FrmSTable.IsNumberic(this.txt_RTotal.Text.Trim())) { num2 = double.Parse(this.txt_RTotal.Text.Trim()); } else if (!(!(this.txt_RTotal.Text.Trim() != "") || FrmSTable.IsNumberic(this.txt_RTotal.Text.Trim()))) { MessageBox.Show("请录入合法数值!"); this.txt_RTotal.SelectAll(); this.txt_RTotal.Focus(); return; } if ((this.txt_fBad.Text.Trim() != "") && FrmSTable.IsNumberic(this.txt_fBad.Text.Trim())) { num3 = double.Parse(this.txt_fBad.Text.Trim()); } else if (!(!(this.txt_fBad.Text.Trim() != "") || FrmSTable.IsNumberic(this.txt_fBad.Text.Trim()))) { MessageBox.Show("请录入合法数值!"); this.txt_fBad.SelectAll(); this.txt_fBad.Focus(); return; } if (this.txt_Qty.Text.Trim() == "") { MessageBox.Show("对不起,帐面数不能为空!"); } else { num = double.Parse(this.txt_Qty.Text.Trim()); num4 = (num2 - num) - num3; num5 = num2 - num3; this.txt_fDiff.Text = num4.ToString(); this.txt_RQty.Text = num5.ToString(); } }
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(); } } }
private void btnOK_Click(object sender, EventArgs e) { Exception exception; string sErr = ""; double num = 0.0; double num2 = 0.0; double pDiff = 0.0; double pBad = 0.0; if (this.txt_Qty.Text.Trim() != "") { num = double.Parse(this.txt_Qty.Text.Trim()); } if (this.txt_RQty.Text.Trim() != "") { try { num2 = double.Parse(this.txt_RQty.Text.Trim()); } catch (Exception exception1) { exception = exception1; MessageBox.Show("实盘数录入有误,数值非法!"); this.txt_RQty.SelectAll(); this.txt_RQty.Focus(); return; } } else { MessageBox.Show("对不起,实盘数不能为空!"); this.txt_RQty.Focus(); return; } if (this.txt_fBad.Text.Trim() != "") { try { pBad = double.Parse(this.txt_fBad.Text.Trim()); } catch (Exception exception2) { exception = exception2; MessageBox.Show("不良品数录入有误,数值非法!"); this.txt_fBad.SelectAll(); this.txt_fBad.Focus(); return; } } else { MessageBox.Show("对不起,不良品数不能为空!"); this.txt_fBad.Focus(); return; } if (pBad < 0.0) { MessageBox.Show("对不起不良品数不能为负数!"); this.txt_fBad.SelectAll(); this.txt_fBad.Focus(); } else if (this.txt_fDiff.Text.Trim() == "") { MessageBox.Show("对不起,损溢数不能为空!"); this.txt_fDiff.Focus(); } else { if (FrmSTable.IsNumberic(this.txt_fDiff.Text.Trim())) { pDiff = double.Parse(this.txt_fDiff.Text.Trim()); } else { MessageBox.Show("损溢数录入有误,数值非法!"); this.txt_fDiff.SelectAll(); this.txt_fDiff.Focus(); return; } if (num2 != (num + pDiff)) { MessageBox.Show("对不起,实盘数 不等于 帐面数 + 损溢数"); this.txt_fDiff.SelectAll(); this.txt_fDiff.Focus(); } else { string str2 = PubDBCommFuns.sp_Chk_WriteChkDtl(base.AppInformation.SvrSocket, base.UserInformation.UserName, base.UserInformation.UnitId, "WMS", 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(), pDiff, pBad, this.txt_cUnit.Text.Trim(), this.txt_cBNoIn.Text.Trim(), int.Parse(this.txt_nItemIn.Text.Trim()), this._CheckNo.Trim(), out sErr); if (((str2.Trim() != "0") && (str2.Trim() != "B")) && (sErr.Trim() != "")) { MessageBox.Show(sErr); } else { MessageBox.Show("登记成功!"); this._IsOK = true; base.Close(); } } } }
private void btnOK_Click(object sender, EventArgs e) { string str = ""; if (this.txt_Dtl_cMNo.Text.Trim() == "") { MessageBox.Show("对不起,物料编码不能为空!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.txt_Dtl_cMNo.Focus(); } else if (this.txt_Dtl_fQty.Text.Trim() == "") { MessageBox.Show("对不起,物料数量不能为空!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.txt_Dtl_fQty.Focus(); } else if (!FrmSTable.IsNumberic(this.txt_Dtl_fQty.Text.Trim())) { MessageBox.Show("对不起,物料数量为非法数值!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.txt_Dtl_fQty.SelectAll(); this.txt_Dtl_fQty.Focus(); } else if (double.Parse(this.txt_Dtl_fQty.Text.Trim()) == 0.0) { MessageBox.Show("对不起,数量不能为0"); this.txt_Dtl_fQty.SelectAll(); this.txt_Dtl_fQty.Focus(); } else if (this.txt_Dtl_cUnit.Text.Trim() == "") { MessageBox.Show("对不起,单位不能为空!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.txt_Dtl_cUnit.SelectAll(); this.txt_Dtl_cUnit.Focus(); } else { if (!this.isOutBill) { } if (this.isOutBill && (double.Parse(this.txt_Dtl_fQty.Text.Trim()) > this.fUseQty)) { MessageBox.Show("对不起,出库数大于可出数!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.txt_Dtl_fQty.SelectAll(); this.txt_Dtl_fQty.Focus(); } else { string str2; string str3; DataSet set; this.UIToDataRowView(this.drvItem, this.pnlDtlEdit); if (this.bIsNew) { str = this.drvItem["cBNo"].ToString(); this.bIsResultOK = true; this.bIsShowGrid = false; this.DataRowViewToUI(this.drvItem, this.pnlDtlEdit); this.bIsShowGrid = true; str2 = DBSQLCommandInfo.GetSQLByDataRow(this.drvItem, "TWB_BillRemoveDtl", "cBNo,cMNo", "cMName,cSpec,cMatStyle,cMatQCLevel,cMatOther,cCSId,cSupplier", true); str3 = ""; set = PubDBCommFuns.GetDataBySql(str2, DBSQLCommandInfo.GetFieldsForDate(this.drvItem), out str3); this.bIsResultOK = set.Tables[0].Rows[0][0].ToString() == "0"; if (this.bIsResultOK) { MessageBox.Show("增加明细成功!"); this.ClearUIValues(this.pnlDtlEdit); this.drvItem["cBNo"] = str; this.drvItem["cMNo"] = ""; this.DataRowViewToUI(this.drvItem, this.pnlDtlEdit); this.txt_Dtl_cMNo.SelectAll(); this.txt_Dtl_cMNo.Focus(); } } else { this.bIsShowGrid = false; this.DataRowViewToUI(this.drvItem, this.pnlDtlEdit); this.bIsShowGrid = true; str2 = DBSQLCommandInfo.GetSQLByDataRow(this.drvItem, "TWB_BillRemoveDtl", "cBNo,cMNo", "cMName,cSpec,cMatStyle,cMatQCLevel,cMatOther,cCSId,cSupplier", false); str3 = ""; set = PubDBCommFuns.GetDataBySql(str2, DBSQLCommandInfo.GetFieldsForDate(this.drvItem), out str3); this.bIsResultOK = set.Tables[0].Rows[0][0].ToString() == "0"; base.Close(); } } } }