Example #1
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            DataTable dt = (DataTable)dataGridView1.DataSource;

            string strBillIDGather = "";

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (Convert.ToBoolean(dt.Rows[i]["选"]))
                {
                    strBillIDGather += "'" + dt.Rows[i][m_strSelectType + "单号"].ToString() + "',";
                }
            }

            strBillIDGather = "(" + strBillIDGather.Remove(strBillIDGather.Length - 1) + ")";


            if (!m_serverMaterialReturnList.BatchCreateList(m_strSelectType, m_strBillID, strBillIDGather, out m_strErr))
            {
                MessageDialog.ShowPromptMessage(m_strErr);
            }
            else
            {
                MessageDialog.ShowPromptMessage("生成成功");
                this.Close();
            }
        }
        private void btnBatchCreate_Click(object sender, EventArgs e)
        {
            FormDataTableCheck frm =
                new FormDataTableCheck(m_goodsServer.GetBatchCreatList("领料", ServerTime.Time.AddDays(-20), ServerTime.Time));

            frm.OnFormDataTableCheckFind += new GlobalObject.DelegateCollection.FormDataTableCheckFindDelegate(frm_OnFormDataTableCheckFind1);
            frm._BlDateTimeControlShow    = true;

            if (frm.ShowDialog() == DialogResult.OK)
            {
                string strBillIDGather = "";

                foreach (DataRow dr in frm._DtResult.Rows)
                {
                    strBillIDGather += "'" + dr["领料单号"].ToString() + "',";
                }

                strBillIDGather = "(" + strBillIDGather.Remove(strBillIDGather.Length - 1) + ")";

                if (!m_goodsServer.BatchCreateList("领料", m_billNo, strBillIDGather, out m_error))
                {
                    MessageDialog.ShowPromptMessage(m_error);
                }
                else
                {
                    MessageDialog.ShowPromptMessage("生成成功");
                    this.Close();
                }

                m_queryGoodsInfo = m_goodsServer.GetGoods(m_billNo);
                RefreshDataGridView(m_queryGoodsInfo);
            }
        }