Example #1
0
        private void btnNewBarcodeModel_Click(object sender, EventArgs e)
        {
            FrmBarcodeEdit f = new FrmBarcodeEdit();
            f.setKeyValue(arrlistSellectRow);
            f.LoadDataTable((DataTable)dataGridView1.DataSource);

            f.ShowDialog();

            //如果返回的不是原先编辑的,就增加,并且也加
            if (isExitXmlFileData(f.shapesFileData.Value))
            {

                addXmlFileData(f.shapesFileData.Value);
            }

            strCurrentTableName = f.strTableName;

            dataGridView1.DataSource = f.CurrentDataTable;

            f.Dispose();

            comboBoxBarcodeModel_SelectedIndexChanged(null, null);//重新刷新一下画布
        }
Example #2
0
        private void btnEditBarcodeModel_Click(object sender, EventArgs e)
        {
            //判断是否选择条形码模板
            if (comboBoxBarcodeModel.SelectedItem == null)
            {
                MessageBox.Show("请选择条形码模板");
                return;
            }

            FrmBarcodeEdit f = new FrmBarcodeEdit(((clsKeyValue)comboBoxBarcodeModel.SelectedItem), (DataTable )dataGridView1.DataSource, arrlistSellectRow,strCurrentTableName);
            //f.setKeyValue(arrlistSellectRow);
            f.ShowDialog();

            //如果返回的不是原先编辑的,就增加,并且也加
            if (isExitXmlFileData(f.shapesFileData.Value))
            {
                addXmlFileData(f.shapesFileData.Value);
            }

            strCurrentTableName = f.strTableName;

            dataGridView1.DataSource = f.CurrentDataTable;//可能换了数据的

            f.Dispose();//释放

            //同时更新画布。
            dataGridViewChangedCell();

            comboBoxBarcodeModel_SelectedIndexChanged(null, null);
        }