예제 #1
0
        /// <summary>
        /// 获取表格的列定义
        /// </summary>
        /// <returns></returns>
        public List <GridColumnEntity> GetGridColumns()
        {
            StringBuilder sql = new StringBuilder();

            sql.AppendFormat(@" 
            select
            *
            from MobileBussinessDefined
            where ISNULL(ViewOrder,0)!=0 and IsDelete=0 and CustomerID='{0}' and TableName='{1}' and TypeId=1
            order by ViewOrder asc", CurrentUserInfo.ClientID, _pTableName);
            DataTable dt = this.GetDefind(sql.ToString()).Tables[0];
            List <GridColumnEntity> l = new List <GridColumnEntity>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                GridColumnEntity m = new GridColumnEntity();
                m.ColumnText        = Convert.ToString(dt.Rows[i]["ColumnDesc"]);
                m.DataIndex         = Convert.ToString(dt.Rows[i]["ColumnName"]);
                m.ColumnControlType = Convert.ToInt32(dt.Rows[i]["ControlType"]);
                if (dt.Rows[i]["CorrelationValue"] != DBNull.Value)
                {
                    m.CorrelationValue = Convert.ToString(dt.Rows[i]["CorrelationValue"]);
                }
                l.Add(m);
            }
            return(l);
        }
예제 #2
0
        /// <summary>
        /// 获取表格的列定义
        /// </summary>
        /// <returns></returns>
        public List <GridColumnEntity> GetGridColumns()
        {
            StringBuilder sql = new StringBuilder();

            sql.AppendFormat(@" select * 
                                from ClientBussinessDefined 
                                where isnull(ListOrder,0)!=0  and isdelete=0 and ClientID='{0}' and TableName='{1}'
                                order by  ListOrder asc
                              ", _pUserInfo.ClientID, _pTableName);
            DataTable dt = _currentDAO.GetDefind(sql.ToString()).Tables[0];
            List <GridColumnEntity> l = new List <GridColumnEntity>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                GridColumnEntity m = new GridColumnEntity();
                if (dt.Rows[i]["ColumnDesc"] != DBNull.Value)
                {
                    m.ColumnText = Convert.ToString(dt.Rows[i]["ColumnDesc"]);
                }
                if (dt.Rows[i]["GridWidth"] != DBNull.Value)
                {
                    m.ColumnWdith = Convert.ToInt32(dt.Rows[i]["GridWidth"]);
                }
                if (dt.Rows[i]["ColumnName"] != DBNull.Value)
                {
                    m.DataIndex = Convert.ToString(dt.Rows[i]["ColumnName"]);
                }
                if (dt.Rows[i]["ControlType"] != DBNull.Value)
                {
                    m.ColumnControlType = Convert.ToInt32(dt.Rows[i]["ControlType"]);
                }
                if (dt.Rows[i]["CorrelationValue"] != DBNull.Value)
                {
                    m.CorrelationValue = Convert.ToString(dt.Rows[i]["CorrelationValue"]);
                }
                if (!string.IsNullOrEmpty(dt.Rows[i]["IsMustDo"].ToString()))
                {
                    m.IsMustDo = Convert.ToInt32(dt.Rows[i]["IsMustDo"]);
                }
                l.Add(m);
            }
            return(l);
        }