示例#1
0
        /// <summary>
        /// ������Ϣ��ID ��ѯ������Ϣ
        /// </summary>
        /// <param name="itemID"></param>
        /// <returns></returns>
        public List<BuilderObject> GetBuilderInfo(string ObjectID)
        {
            SqlHelper sh = new SqlHelper();
            ds = new DataSet();

            ds = sh.selectAll("builderObject", "buildObjectID='" + ObjectID + "'");
            list = new List<BuilderObject>();
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                BuilderObject boTemp = new BuilderObject();
                boTemp.BuilId           = int.Parse(ds.Tables[0].Rows[i][0].ToString());
                boTemp.BuilName         = ds.Tables[0].Rows[i][1].ToString();
                //������ǵ�i�еĵ�1�е�����
               // boTemp.BuilItemID       = ds.Tables[0].Rows[i][2].ToString();
                boTemp.BuilHeight       = ds.Tables[0].Rows[i][2].ToString();
                boTemp.BuilArea         = ds.Tables[0].Rows[i][3].ToString();
                boTemp.BuilInfo         = ds.Tables[0].Rows[i][4].ToString();
                boTemp.BuilLongitude    = ds.Tables[0].Rows[i][5].ToString();
                boTemp.BuilLatitude     = ds.Tables[0].Rows[i][6].ToString();
                boTemp.BuidObjectID = ds.Tables[0].Rows[i][7].ToString();
                //Tables��Rows���Ǽ��ϣ��������ǿ���ͨ���������������еij�Ա
                list.Add(boTemp);
            }

            return list;
        }
示例#2
0
        /// <summary>
        /// 根据条件查询建筑列表
        /// </summary>
        /// <param name="where"></param>
        /// <returns></returns>
        public List <BuilderObject> GetBuilderByName(string where)
        {
            SqlHelper sh = new SqlHelper();

            ds = new DataSet();

            ds = sh.selectAll("builderObject", "buildName like '%" + where + "%'");

            list = new List <BuilderObject>();
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                BuilderObject boTemp = new BuilderObject();
                boTemp.BuilId   = int.Parse(ds.Tables[0].Rows[i][0].ToString());
                boTemp.BuilName = ds.Tables[0].Rows[i][1].ToString();
                // boTemp.BuilItemID = ds.Tables[0].Rows[i][2].ToString();
                boTemp.BuilHeight    = ds.Tables[0].Rows[i][2].ToString();
                boTemp.BuilArea      = ds.Tables[0].Rows[i][3].ToString();
                boTemp.BuilInfo      = ds.Tables[0].Rows[i][4].ToString();
                boTemp.BuilLongitude = ds.Tables[0].Rows[i][5].ToString();
                boTemp.BuilLatitude  = ds.Tables[0].Rows[i][6].ToString();
                boTemp.BuidObjectID  = ds.Tables[0].Rows[i][7].ToString();
                list.Add(boTemp);
            }

            return(list);
        }
示例#3
0
        /// <summary>
        /// ����������ѯ�����б�
        /// </summary>
        /// <param name="where"></param>
        /// <returns></returns>
        public List<BuilderObject> GetBuilderByName(string where)
        {
            SqlHelper sh = new SqlHelper();
            ds = new DataSet();

            ds = sh.selectAll("builderObject", "buildName like '%" + where + "%'");

            list = new List<BuilderObject>();
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                BuilderObject boTemp = new BuilderObject();
                boTemp.BuilId = int.Parse(ds.Tables[0].Rows[i][0].ToString());
                boTemp.BuilName = ds.Tables[0].Rows[i][1].ToString();
               // boTemp.BuilItemID = ds.Tables[0].Rows[i][2].ToString();
                boTemp.BuilHeight = ds.Tables[0].Rows[i][2].ToString();
                boTemp.BuilArea = ds.Tables[0].Rows[i][3].ToString();
                boTemp.BuilInfo = ds.Tables[0].Rows[i][4].ToString();
                boTemp.BuilLongitude = ds.Tables[0].Rows[i][5].ToString();
                boTemp.BuilLatitude = ds.Tables[0].Rows[i][6].ToString();
                boTemp.BuidObjectID = ds.Tables[0].Rows[i][7].ToString();
                list.Add(boTemp);
            }

            return list;
        }
示例#4
0
        /// <summary>
        /// 根据信息树ID 查询物体信息
        /// </summary>
        /// <param name="itemID"></param>
        /// <returns></returns>
        public List <BuilderObject> GetBuilderInfo(string ObjectID)
        {
            SqlHelper sh = new SqlHelper();

            ds = new DataSet();


            ds   = sh.selectAll("builderObject", "buildObjectID='" + ObjectID + "'");
            list = new List <BuilderObject>();
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                BuilderObject boTemp = new BuilderObject();
                boTemp.BuilId   = int.Parse(ds.Tables[0].Rows[i][0].ToString());
                boTemp.BuilName = ds.Tables[0].Rows[i][1].ToString();
                //输出的是第i行的第1列的数据
                // boTemp.BuilItemID       = ds.Tables[0].Rows[i][2].ToString();
                boTemp.BuilHeight    = ds.Tables[0].Rows[i][2].ToString();
                boTemp.BuilArea      = ds.Tables[0].Rows[i][3].ToString();
                boTemp.BuilInfo      = ds.Tables[0].Rows[i][4].ToString();
                boTemp.BuilLongitude = ds.Tables[0].Rows[i][5].ToString();
                boTemp.BuilLatitude  = ds.Tables[0].Rows[i][6].ToString();
                boTemp.BuidObjectID  = ds.Tables[0].Rows[i][7].ToString();
                //Tables、Rows都是集合,所以它们可以通过索引来访问其中的成员
                list.Add(boTemp);
            }

            return(list);
        }