/// <summary>获取基础设置参数 /// /// </summary> /// <returns></returns> private BaseParameter GetBaseParameter() { #region 获取参数 GetFileds(out m_strQueryColumns, lstQueryFileds); GetFileds(out m_strShowColumns, lstShowFileds); GetFileds(out m_strEditColumns, lstEditShowFileds); GetFileds(out m_strCheckInputColumns, lstCheckInputFileds); GetFileds(out m_strDontRepeatColumns, lstDontRepeatFileds); m_frameworkType = GetFrameworkType(); m_uiStyle = GetUiStyle(); m_listBindType = GetListBindType(); #endregion switch (m_codeGenType) { #region WinFromSimpleQuery case CodeGenType.WinFromSimpleQuery: m_baseParameter = new SimpleQueryParameter { QueryColumns = m_strQueryColumns, ShowColumns = m_strShowColumns, CodeGenType = m_codeGenType, DatabaseTable = m_databaseTable, FrameworkType = m_frameworkType, UiStyle = m_uiStyle, ListBindType = m_listBindType }; break; #endregion #region WinFromEditWithDialog case CodeGenType.WinFromEditWithDialog: m_baseParameter = new EditDialogParameter { QueryColumns = m_strQueryColumns, ShowColumns = m_strShowColumns, CodeGenType = m_codeGenType, DatabaseTable = m_databaseTable, FrameworkType = m_frameworkType, DontRepeatColumns = m_strDontRepeatColumns, CheckInputColumns = m_strCheckInputColumns, EditColumns = m_strEditColumns, UiStyle = m_uiStyle, ListBindType = m_listBindType }; break; #endregion #region WinFromTreeEditWithDialog case CodeGenType.WinFromTreeEditWithDialog: m_baseParameter = new TreeEditDialogParameter { QueryColumns = m_strQueryColumns, ShowColumns = m_strShowColumns, CodeGenType = m_codeGenType, DatabaseTable = m_databaseTable, FrameworkType = m_frameworkType, DontRepeatColumns = m_strDontRepeatColumns, CheckInputColumns = m_strCheckInputColumns, EditColumns = m_strEditColumns, UiStyle = m_uiStyle, ListBindType = m_listBindType, KeyId = txtKey.Text.Trim(), ParentId = txtParentKey.Text.Trim() }; break; #endregion } return(m_baseParameter); }
private void SetGlobal(BaseParameter baseParameter) { switch (baseParameter.CodeGenType) { #region WinFromSimpleQuery case CodeGenType.WinFromSimpleQuery: SimpleQueryParameter simpleQueryParameter = baseParameter as SimpleQueryParameter; if (simpleQueryParameter != null) { m_strQueryColumns = simpleQueryParameter.QueryColumns; m_strShowColumns = simpleQueryParameter.ShowColumns; m_databaseTable = simpleQueryParameter.DatabaseTable; m_codeGenType = simpleQueryParameter.CodeGenType; m_frameworkType = simpleQueryParameter.FrameworkType; m_uiStyle = simpleQueryParameter.UiStyle; m_listBindType = simpleQueryParameter.ListBindType; gridVEdit.Visible = false; tabPageEdit.Parent = null; tabPageEdit.Hide(); gridVShow.Visible = true; tabPageShow.Parent = tabControl1; tabPageShow.Show(); } break; #endregion #region WinFromEditWithDialog/WinFromTreeEditWithDialog case CodeGenType.WinFromEditWithDialog: case CodeGenType.WinFromTreeEditWithDialog: EditDialogParameter editDialogParameter = baseParameter as EditDialogParameter; if (editDialogParameter != null) { m_strQueryColumns = editDialogParameter.QueryColumns; m_strShowColumns = editDialogParameter.ShowColumns; m_databaseTable = editDialogParameter.DatabaseTable; m_codeGenType = editDialogParameter.CodeGenType; m_frameworkType = editDialogParameter.FrameworkType; m_uiStyle = editDialogParameter.UiStyle; m_listBindType = editDialogParameter.ListBindType; m_strEditColumns = editDialogParameter.EditColumns; m_strCheckInputColumns = editDialogParameter.CheckInputColumns; m_strDontRepeatColumns = editDialogParameter.DontRepeatColumns; gridVEdit.Visible = true; tabPageEdit.Parent = tabControl1; tabPageEdit.Show(); gridVShow.Visible = true; tabPageShow.Parent = tabControl1; tabPageShow.Show(); } break; #endregion #region WinFromNestQuery case CodeGenType.WinFromNestQuery: NestQueryParameter nestQueryParameter = baseParameter as NestQueryParameter; if (nestQueryParameter != null) { m_strQueryColumns = nestQueryParameter.QueryColumns; m_codeGenType = nestQueryParameter.CodeGenType; gridVEdit.Visible = false; tabPageShow.Parent = null; tabPageShow.Hide(); gridVShow.Visible = false; tabPageEdit.Parent = null; tabPageEdit.Hide(); } break; #endregion #region WinFromParentChildEditWithDialog case CodeGenType.WinFromParentChildEditWithDialog: ParentChildEditDialogParameter parentChildDialogParameter = baseParameter as ParentChildEditDialogParameter; if (parentChildDialogParameter != null) { m_databaseTable = parentChildDialogParameter.DatabaseTable; m_codeGenType = parentChildDialogParameter.CodeGenType; m_frameworkType = parentChildDialogParameter.FrameworkType; m_uiStyle = parentChildDialogParameter.UiStyle; m_listBindType = parentChildDialogParameter.ListBindType; m_strQueryColumns = parentChildDialogParameter.QueryColumns; m_strShowColumns = parentChildDialogParameter.ShowColumns; m_strEditColumns = parentChildDialogParameter.EditColumns; m_strCheckInputColumns = parentChildDialogParameter.CheckInputColumns; m_strDontRepeatColumns = parentChildDialogParameter.DontRepeatColumns; m_strShowColumnsDetail = parentChildDialogParameter.ShowColumnsDetail; m_strEditColumnsDetail = parentChildDialogParameter.EditColumnsDetail; m_strCheckInputColumnsDetail = parentChildDialogParameter.CheckInputColumnsDetail; m_strDontRepeatColumnsDetail = parentChildDialogParameter.DontRepeatColumnsDetail; m_databaseTableDetail = parentChildDialogParameter.DatabaseTableDetail; m_strKeyMaster = parentChildDialogParameter.KeyMaster; m_strKeyDetail = parentChildDialogParameter.KeyDetail; gridVEdit.Visible = true; tabPageEdit.Parent = tabControl1; tabPageEdit.Show(); gridVShow.Visible = true; tabPageShow.Parent = tabControl1; tabPageShow.Show(); } break; #endregion } if (baseParameter.CodeGenType != CodeGenType.WinFromParentChildEditWithDialog) { tabPageEditDetail.Parent = null; tabPageShowDetail.Parent = null; tabPageEditDetail.Hide(); tabPageShowDetail.Hide(); } else { tabPageEditDetail.Parent = tabControl1; tabPageShowDetail.Parent = tabControl1; tabPageEditDetail.Show(); tabPageShowDetail.Show(); } }