//更新数据
 public int Update(plant_info obj)
 {
     try
     {
         string sql = "Update fimp.plant_info set city_id={0},plant_name_en='{1}',plant_name_tw=N'{2}',plant_name_cn=N'{3}' where plant_id={4}";
         sql = string.Format(sql, obj.city_id, obj.plant_name_en, obj.plant_name_tw, obj.plant_name_cn, obj.plant_id);
         int count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 //插入数据
 public int Insert(plant_info obj)
 {
     try
     {
         string sql = "insert into fimp.plant_info(city_id,plant_name_en,plant_name_tw,plant_name_cn)values({0},'{1}',N'{2}',N'{3}')";
         sql = string.Format(sql, obj.city_id, obj.plant_name_en, obj.plant_name_tw, obj.plant_name_cn);
         int count = PostgreHelper.ExecuteNonQuery(sql);
         return(count);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 //查询单笔数据,通过厂区id
 public plant_info SelectSingle(int id)
 {
     try
     {
         plant_info obj = new plant_info();
         string     sql = "SELECT * FROM fimp.plant_info where plant_id='{0}' order by city_id,plant_id";
         sql = string.Format(sql, id);
         obj = PostgreHelper.GetSingleEntity <plant_info>(sql);
         return(obj);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #4
0
        public int Update(plant_info obj)
        {
            int count = PIS.Update(obj);

            return(count);
        }
Пример #5
0
        public int Insert(plant_info obj)
        {
            int count = PIS.Insert(obj);

            return(count);
        }
Пример #6
0
        public plant_info SelectSingle(int id)
        {
            plant_info obj = PIS.SelectSingle(id);

            return(obj);
        }