Exemple #1
0
 public StoreHouse GetStoreHouses(string regionid,string housenumber)
 {
     DBHelper db=new DBHelper();
     string sql = "select * from storehouse where regionid='" + regionid + "' and house_no='"+housenumber+"'";
     DbCommand cmd = db.GetSqlStringCommond(sql);
     comm.SaveLog("1",DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")+ "获取StoreHouse" + cmd.CommandText);
     DataTable dt = db.ExecuteDataTable(cmd);
     foreach (DataRow dataRow in dt.Rows)
     {
         StoreHouse storeHouse=new StoreHouse();
         storeHouse.RegionCode = dataRow["RegionCode"].ToString();
         storeHouse.RegionId =Guid.Parse(dataRow["RegionId"].ToString());
         storeHouse.air_hum_pos =Convert.ToInt32(dataRow["air_hum_pos"].ToString());
         storeHouse.air_tem_pos =Convert.ToInt32(dataRow["air_tem_pos"].ToString());
         storeHouse.angle =Convert.ToDecimal(dataRow["angle"].ToString());
         storeHouse.cable_x =Convert.ToInt32(dataRow["RegionCode"].ToString());
         storeHouse.cable_y =Convert.ToInt32(dataRow["cable_y"].ToString());
         storeHouse.cklx = dataRow["cklx"].ToString();
         storeHouse.depot_hum_pos = Convert.ToInt32(dataRow["depot_hum_pos"]);
         storeHouse.depot_tem_pos = Convert.ToInt32(dataRow["depot_tem_pos"]);
         storeHouse.dim1 = Convert.ToInt32(dataRow["dim1"]);
         storeHouse.dim2 = Convert.ToInt32(dataRow["dim2"]);
         storeHouse.dim3 = Convert.ToInt32(dataRow["dim3"]);
         storeHouse.dirx = Convert.ToInt32(dataRow["dirx"]);
         storeHouse.diry = Convert.ToInt32(dataRow["diry"]);
         storeHouse.distr_no = Convert.ToInt32(dataRow["distr_no"]);
         storeHouse.house_no = Convert.ToInt32(dataRow["house_no"]);
         storeHouse.housename = Convert.ToString(dataRow["housename"]);
         storeHouse.memo = Convert.ToString(dataRow["memo"]);
         storeHouse.node_z = Convert.ToInt32(dataRow["node_z"]);
         storeHouse.regionName = Convert.ToString(dataRow["regionName"]);
         storeHouse.storecount = Convert.ToInt32(dataRow["storecount"]);
         storeHouse.typecode = Convert.ToInt32(dataRow["typecode"]);
        // storeHouse.uploadTime = Convert.ToDateTime(dataRow["uploadTime"]);
         storeHouse.x_scale = Convert.ToInt32(dataRow["x_scale"]);
         storeHouse.y_scale = Convert.ToInt32(dataRow["y_scale"]);
         comm.SaveLog("1","获取数据成功");
         return storeHouse;
     }
     return null;
 }
Exemple #2
0
 public Hashtable GetStoreSign()
 {
     Hashtable ht=new Hashtable();
     DBHelper db=new DBHelper();
     string sql = "SELECT RegionCode,[sign] FROM storename";
     DbCommand cmd = db.GetSqlStringCommond(sql);
     DataTable dt = db.ExecuteDataTable(cmd);
     foreach (DataRow dataRow in dt.Rows)
     {
         ht.Add(dataRow["RegionCode"].ToString(), dataRow["sign"].ToString());
     }
     return ht;
 }
Exemple #3
0
 public IList<HighBack> SelectHighBackBeanList(String where)
 {
     IList<HighBack> list = new List<HighBack>();
     DBHelper db = new DBHelper();
     DbCommand cmd = db.GetSqlStringCommond("SELECT * FROM HighBack WHERE " + where);
     DataTable dt = db.ExecuteDataTable(cmd);
     foreach (DataRow row in dt.Rows)
     {
         list.Add(this.DataRowToBean(row));
     }
     return list;
 }
Exemple #4
0
        public IList<TestData> GetTestDataList(string sqlWhere)
        {
            IList<TestData> list=new List<TestData>();
            DBHelper db=new DBHelper();

            DbCommand cmd = db.GetSqlStringCommond("select * from testdata where 1=1 " + sqlWhere);
            DataTable dt = db.ExecuteDataTable(cmd);
            foreach (DataRow dataRow in dt.Rows)
            {
                TestData testData=new TestData();
                testData.RegionCode = dataRow["RegionCode"].ToString();
                testData.RegionId =Guid.Parse(dataRow["RegionId"].ToString());
                testData.air_hum =Convert.ToInt16(dataRow["air_hum"].ToString());
                testData.air_tem =Convert.ToInt16(dataRow["air_tem"].ToString());
                testData.aver_tem =Convert.ToInt16(dataRow["aver_tem"].ToString());
                testData.depot_hum =Convert.ToInt16(dataRow["depot_hum"].ToString());
                testData.depot_tem =Convert.ToInt16(dataRow["depot_tem"].ToString());
                testData.house_no =Convert.ToInt16(dataRow["house_no"].ToString());
                testData.regionName = dataRow["regionName"].ToString();
                testData.temperatureset = dataRow["temperatureset"].ToString();
                testData.testdatetime = Convert.ToDateTime(dataRow["testdatetime"].ToString());
                list.Add(testData);
            }
            return list;
        }