예제 #1
0
        /// <summary>编辑
        ///
        /// </summary>
        private void DoEdit()
        {
            string strMsg = CheckSelect(EntityOperationType.修改);

            if (strMsg != string.Empty)
            {
                MessageBox.Show(strMsg);
                return;
            }
            OrderMaster model = objListViewMaster.SelectedObjects[0] as OrderMaster;

            if (model != null)
            {
                FrmMasterDetailDemoDialog frmDialog = new FrmMasterDetailDemoDialog(model, m_lstOrderMaster, m_lstOrderDetail);
                if (frmDialog.ShowDialog() == DialogResult.OK)
                {
                    m_lstOrderMaster = frmDialog.ListOrderMaster;
                    m_lstOrderDetail = frmDialog.ListOrderDetail;
                    if (m_lstOrderMaster != null)
                    {
                        objListViewMaster.SetObjects(m_lstOrderMaster);
                        objListViewMaster.Refresh();
                    }
                    if (m_lstOrderDetail != null)
                    {
                        objListViewDetail.SetObjects(m_lstOrderDetail);
                        objListViewDetail.Refresh();
                    }
                }
            }
        }
예제 #2
0
        /// <summary>新增
        ///
        /// </summary>
        private void DoNew()
        {
            FrmMasterDetailDemoDialog frmDialog = new FrmMasterDetailDemoDialog(null, m_lstOrderMaster, m_lstOrderDetail);

            if (frmDialog.ShowDialog() == DialogResult.OK)
            {
                m_lstOrderMaster = frmDialog.ListOrderMaster;
                m_lstOrderDetail = frmDialog.ListOrderDetail;
                if (m_lstOrderMaster != null)
                {
                    objListViewMaster.SetObjects(m_lstOrderMaster);
                    objListViewMaster.Refresh();
                }
                if (m_lstOrderDetail != null)
                {
                    objListViewDetail.SetObjects(m_lstOrderDetail);
                    objListViewDetail.Refresh();
                }
            }
        }