private void btnOK_Click(object sender, EventArgs e) { string sErr = ""; string sWHId = ""; string sErpChkId = cmd_ErpNo.Text.Trim(); string sChkType = ""; string sChkTypeDesc = ""; string sMType = ""; string sMTypeDesc = ""; string sMNo = ""; string sMNoDesc = ""; string sPos = ""; string sDateFrom = ""; string sDateTo = ""; if (cmb_WHId.Items.Count > 0 && cmb_WHId.SelectedValue != null) { sWHId = cmb_WHId.SelectedValue.ToString(); } if (sWHId == "") { MessageBox.Show("对不起,仓库部能为空!"); cmb_WHId.SelectAll(); cmb_WHId.Focus(); } if (rbtnAll.Checked) { sChkType = "301"; sChkTypeDesc = "全盘"; } else { sChkType = "302"; sChkTypeDesc = "抽盘"; } if (txt_ItemType.Tag != null) { sMType = txt_ItemType.Tag.ToString(); } sMTypeDesc = txt_ItemType.Text.Trim(); //if (sMTypeDesc.Trim().Length > 20) //{ // sMTypeDesc = sMType; //} if (txt_Mat.Tag != null) { sMNo = txt_Mat.Tag.ToString().Trim(); } sMNoDesc = txt_Mat.Text.Trim(); //if (sMNoDesc.Trim().Length > 20) //{ // sMNoDesc = sMNo; //} sPos = txt_Pos.Text.Trim(); if (chk_Date.Checked) { if (dtpFrom.Value.Date > dtpTo.Value.Date) { MessageBox.Show("对不起,开始日期不能大于截止日期!"); dtpFrom.Focus(); return; } sDateFrom = dtpFrom.Value.ToString("yyyy-MM-dd 00:00:00"); sDateTo = dtpTo.Value.ToString("yyyy-MM-dd 23:59:59"); } Cursor.Current = Cursors.WaitCursor; string sX = PubDBCommFuns.sp_Chk_DoChkBuilder(AppInformation.SvrSocket, UserInformation.UserName, UserInformation.UnitId, sChkType, sChkTypeDesc, sErpChkId, sWHId, sMType, sMTypeDesc, sMNo, sMNoDesc, sPos, sDateFrom, sDateTo, out sErr); Cursor.Current = Cursors.Default; if (sX != "B") { MessageBox.Show("生成盘点单数据时出错:" + sErr); } else { MessageBox.Show("成功生成盘点单:" + sErr); Close(); } }
private void btnOK_Click(object sender, EventArgs e) { string sErr = ""; string pWHId = ""; string pErpCheckId = this.cmd_ErpNo.Text.Trim(); string pCheckType = ""; string pCheckTypeDesc = ""; string pMType = ""; string pMTypeDesc = ""; string pMNo = ""; string pMNoDesc = ""; string pPos = ""; string pDateFrom = ""; string pDateTo = ""; if ((this.cmb_WHId.Items.Count > 0) && (this.cmb_WHId.SelectedValue != null)) { pWHId = this.cmb_WHId.SelectedValue.ToString(); } if (pWHId == "") { MessageBox.Show("对不起,仓库部能为空!"); this.cmb_WHId.SelectAll(); this.cmb_WHId.Focus(); } if (this.rbtnAll.Checked) { pCheckType = "301"; pCheckTypeDesc = "全盘"; } else { pCheckType = "302"; pCheckTypeDesc = "抽盘"; } if (this.txt_ItemType.Tag != null) { pMType = this.txt_ItemType.Tag.ToString(); } pMTypeDesc = this.txt_ItemType.Text.Trim(); if (this.txt_Mat.Tag != null) { pMNo = this.txt_Mat.Tag.ToString().Trim(); } pMNoDesc = this.txt_Mat.Text.Trim(); pPos = this.txt_Pos.Text.Trim(); if (this.chk_Date.Checked) { if (this.dtpFrom.Value > this.dtpTo.Value) { MessageBox.Show("对不起,开始日期不能大于截止日期!"); this.dtpFrom.Focus(); return; } pDateFrom = this.dtpFrom.Value.ToString("yyyy-MM-dd 00:00:00"); pDateTo = this.dtpTo.Value.ToString("yyyy-MM-dd 23:59:59"); } Cursor.Current = Cursors.WaitCursor; string str13 = PubDBCommFuns.sp_Chk_DoChkBuilder(base.AppInformation.SvrSocket, base.UserInformation.UserName, base.UserInformation.UnitId, pCheckType, pCheckTypeDesc, pErpCheckId, pWHId, pMType, pMTypeDesc, pMNo, pMNoDesc, pPos, pDateFrom, pDateTo, out sErr); Cursor.Current = Cursors.Default; if (str13 != "B") { MessageBox.Show("生成盘点单数据时出错:" + sErr); } else { MessageBox.Show("成功生成盘点单:" + sErr); base.Close(); } }