Ejemplo n.º 1
0
        public FrmControlSetting(BaseParameter baseParameter)
        {
            InitializeComponent();

            SetGlobal(baseParameter);

            //嵌套查询
            if (baseParameter.CodeGenType != CodeGenType.WinFromNestQuery)
            {
                m_dtColumns = CodeMakerHelper.GetColumnByTbName(m_databaseTable.Name, m_databaseTable.DatabaseSchema.ConnectionString);
            }

            m_bseControlTypeDal = GlobalHelp.GetControlTypeHelper();
            m_bseUiDal          = GlobalHelp.GetUiHelper();

            m_dtEditControlType               = m_bseControlTypeDal.GetList(" Ctl_Type ='Common' and State=1").Tables[0];
            colQueryControlType.DataSource    = m_dtEditControlType;
            colQueryControlType.ValueMember   = "ControlType";
            colQueryControlType.DisplayMember = "ControlType";


            colEditControlType.DataSource    = m_dtEditControlType.Copy();
            colEditControlType.ValueMember   = "ControlType";
            colEditControlType.DisplayMember = "ControlType";

            m_dtShowControlType              = m_bseControlTypeDal.GetList("Ctl_Type ='GridView' and State=1 ").Tables[0];
            colShowControlType.DataSource    = m_dtShowControlType;
            colShowControlType.ValueMember   = "ControlType";
            colShowControlType.DisplayMember = "ControlType";


            //主子表
            if (baseParameter.CodeGenType == CodeGenType.WinFromParentChildEditWithDialog)
            {
                gridVEditDetail.CellValueChanged      += grdVEditDetail_CellValueChanged;
                gridVShowDetail.CellValueChanged      += grdVShowDetail_CellValueChanged;
                colEditControlTypeDetail.DataSource    = m_dtEditControlType.Copy();
                colEditControlTypeDetail.ValueMember   = "ControlType";
                colEditControlTypeDetail.DisplayMember = "ControlType";

                colShowControlTypeDetail.DataSource    = m_dtShowControlType.Copy();
                colShowControlTypeDetail.ValueMember   = "ControlType";
                colShowControlTypeDetail.DisplayMember = "ControlType";

                m_dtColumnsDetail = CodeMakerHelper.GetColumnByTbName(m_databaseTableDetail.Name, m_databaseTableDetail.DatabaseSchema.ConnectionString);
            }

            gridVQuery.AutoGenerateColumns      = false;
            gridVShow.AutoGenerateColumns       = false;
            gridVEdit.AutoGenerateColumns       = false;
            gridVShowDetail.AutoGenerateColumns = false;
            gridVEditDetail.AutoGenerateColumns = false;
        }
Ejemplo n.º 2
0
        public static List <Bse_UI> GetListUI(string strTableName)
        {
            StringBuilder sb       = new StringBuilder();
            Bse_UIDAL     bseUidal = GlobalHelp.GetUiHelper();

            if (bseUidal == null)
            {
                throw new Exception("Bse_UIDAL 为NULL");
            }
            List <Bse_UI> lstBseUis = bseUidal.GetListArray("TableName = '" + strTableName + "'").OrderBy(t => int.Parse(t.ControlSort)).ToList();;

            return(lstBseUis);
        }
Ejemplo n.º 3
0
 public static Bse_UIDAL GetUiHelper()
 {
     if (_bseUidal == null)
     {
         lock (SyncObject)
         {
             if (_bseUidal == null)
             {
                 _bseUidal = new Bse_UIDAL();
             }
         }
     }
     return(_bseUidal);
 }