Пример #1
0
        public static List <BCCondiColumn> GetCondiColumn(SqlConnection conn, string bcOid)
        {
            List <BCCondiColumn> columns = new List <BCCondiColumn>();
            StringBuilder        sql     = new StringBuilder("select ");

            sql.Append("FieldName,LeftBracket,RightBracket,OperationIndent,CondiFieldValue,");
            sql.Append("fIsFunctionValue,valueFunction,logicConnect,fFreeWhere,SQL");
            sql.Append(" from BsuiCompCondiDataSet ");
            sql.Append("where BusinessTableOID='" + bcOid + "'");

            SqlCommand    cmd    = new SqlCommand(sql.ToString(), conn);
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                BCCondiColumn column = new BCCondiColumn();

                column.FieldName        = Util.GetPropString(reader, 0);
                column.LeftBracket      = Util.GetPropString(reader, 1);
                column.RightBracket     = Util.GetPropString(reader, 2);
                column.Operation        = Util.GetProperInt(reader, 3);
                column.CondiFieldValue  = Util.GetPropString(reader, 4);
                column.fCondiField      = true;
                column.fIsFunctionValue = Util.GetPropBool(reader, 5);
                column.valueFunction    = Util.GetPropString(reader, 6);
                column.Logic            = Util.GetProperInt(reader, 7);
                column.fFreeWhere       = Util.GetPropBool(reader, 8);
                column.SQL = Util.GetPropString(reader, 9);

                columns.Add(column);
            }
            reader.Close();
            return(columns);
        }
Пример #2
0
        public static List<BCCondiColumn> GetCondiColumn(SqlConnection conn, string bcOid)
        {
            List<BCCondiColumn> columns = new List<BCCondiColumn>();
            StringBuilder sql = new StringBuilder("select ");
            sql.Append("FieldName,LeftBracket,RightBracket,OperationIndent,CondiFieldValue,");
            sql.Append("fIsFunctionValue,valueFunction,logicConnect,fFreeWhere,SQL");
            sql.Append(" from BsuiCompCondiDataSet ");
            sql.Append("where BusinessTableOID='" + bcOid + "'");

            SqlCommand cmd = new SqlCommand(sql.ToString(), conn);
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                BCCondiColumn column = new BCCondiColumn();

                column.FieldName = Util.GetPropString(reader, 0);
                column.LeftBracket = Util.GetPropString(reader, 1);
                column.RightBracket = Util.GetPropString(reader, 2);
                column.Operation = Util.GetProperInt(reader, 3);
                column.CondiFieldValue = Util.GetPropString(reader, 4);
                column.fCondiField = true;
                column.fIsFunctionValue = Util.GetPropBool(reader, 5);
                column.valueFunction = Util.GetPropString(reader, 6);
                column.Logic = Util.GetProperInt(reader, 7);
                column.fFreeWhere = Util.GetPropBool(reader, 8);
                column.SQL = Util.GetPropString(reader, 9);

                columns.Add(column);
            }
            reader.Close();
            return columns;
        }