private void 核实物品清单ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!CheckSelectedRow())
            {
                return;
            }

            普通入库物品清单 form = new 普通入库物品清单(CE_BusinessOperateMode.仓库核实, txtBill_ID.Text);

            form.ShowDialog();
        }
        private void 设置物品清单ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string billNo = txtBill_ID.Text;

            try
            {
                this.dataGridView1.CellEnter -= new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellEnter);

                if (lblBillStatus.Text != MaterialRequisitionBillStatus.新建单据.ToString())
                {
                    MessageDialog.ShowPromptMessage("您现在不是处于新建单据状态,无法进行此操作");
                    return;
                }

                if (!CheckDataItem())
                {
                    return;
                }

                // 如果此单据存在则检查选择行
                if (m_billServer.IsExist(txtBill_ID.Text))
                {
                    if (!CheckSelectedRow())
                    {
                        return;
                    }

                    if (!CheckUserOperation(dataGridView1.SelectedRows[0]))
                    {
                        return;
                    }
                }
                else
                {
                    S_OrdinaryInDepotBill bill = new S_OrdinaryInDepotBill();

                    bill.Bill_ID               = txtBill_ID.Text;
                    bill.Bill_Time             = dateTime_BillTime.Value;      // 入库日期
                    bill.OrderBill_ID          = txtOrderFormNumber.Text;      // 订单号
                    bill.Cess                  = Convert.ToInt32(txtProvider.Tag);
                    bill.NeedQualityAffirmance = chkQualityAffirmance.Checked; // 需质检确认
                    bill.NeedMachineManager    = chkNeedMachineManager.Checked;
                    bill.AskDepartment         = txtAskDepartment.Text;

                    if (bill.NeedMachineManager)
                    {
                        bill.DeviceType = cmbDeviceType.Text;
                    }

                    bill.QualityEligibilityFlag = false;
                    bill.MachineValidationID    = "";
                    bill.BuyerCode      = BasicInfo.LoginID;                // 采购员编码
                    bill.Proposer       = txtProposer.Tag as string;
                    bill.Checker        = "0000";
                    bill.MachineManager = "0000";
                    bill.DepotManager   = "0000";
                    bill.StorageID      = UniversalFunction.GetStorageID(cmbStorage.Text);

                    if (txtDesigner.Text == "")
                    {
                        bill.Designer = "0000";
                    }
                    else
                    {
                        bill.Designer = txtDesigner.Tag as string;
                    }

                    bill.Provider   = txtProvider.Text;                     // 供应商编码
                    bill.Depot      = txtMaterialType.Tag as string;        // 仓库名就是材料类别
                    bill.Remark     = txtRemark.Text;
                    bill.BillStatus = OrdinaryInDepotBillStatus.新建单据.ToString();

                    if (!m_billServer.AddBill(bill, out m_queryResult, out m_error))
                    {
                        MessageDialog.ShowErrorMessage(m_error);
                        return;
                    }
                }

                普通入库物品清单 form = new 普通入库物品清单(CE_BusinessOperateMode.修改, txtBill_ID.Text);
                form.ShowDialog();

                if (!m_goodsServer.IsExist(txtBill_ID.Text))
                {
                    if (MessageDialog.ShowEnquiryMessage("您没有设置物品清单,是否要删除已经创建的单据?") == DialogResult.Yes)
                    {
                        if (!m_billServer.DeleteBill(txtBill_ID.Text, out m_queryResult, out m_error))
                        {
                            MessageDialog.ShowErrorMessage(m_error);
                        }
                        else
                        {
                            RefreshDataGridView(m_queryResult);
                        }
                    }
                }
            }
            finally
            {
                this.dataGridView1.CellEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellEnter);
            }

            RefreshDataGridView(m_queryResult);
            PositioningRecord(billNo);
        }