Пример #1
0
        /// <summary>
        /// 窗体载入
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FormStore_Load(object sender, EventArgs e)
        {
            InitTreeView();

            m_selectDepotCode = null;

            if (m_conditionGoodsCode != null)
            {
                DataTable table;

                if (!m_storeServer.GetSomeGoodsCodeStore(m_conditionGoodsCode, m_conditionSpec, out table, out m_err))
                {
                    MessageDialog.ShowErrorMessage(m_err);
                    return;
                }

                dataGridView1.DataSource = table;
                dataGridView1.Refresh();

                treeView.Enabled = false;
            }
            else
            {
                if (!m_storeServer.GetAllStore(m_selectDepotCode, m_sequence, out m_findStore, out m_err))
                {
                    MessageDialog.ShowErrorMessage(m_err);
                    return;
                }

                RefreshDataGridView(m_findStore);

                treeView.Enabled = true;
            }

            for (int i = 0; i < dataGridView1.Columns.Count; i++)
            {
                //dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
            }

            dataGridView1.Columns[0].Visible = false;
        }