示例#1
0
 // 公用静态方法,删除一条记录 DeleteCity
 public static bool DeleteEntity(CityBusEntity obj)
 {
     if (obj == null || obj.IsEmpty)
     {
         return false;
     }
     CityDelete exec = new CityDelete();
     try
     {
         exec.ReceiveParameter(obj);
         exec.ExecNoQuery();
         return true;
     }
     catch (Exception ex)
     {
         //throw ex;
         return false;
     }
     finally
     {
         obj = null;
     }
 }
示例#2
0
 // 物理删除由主键cityName指定的一条记录 DeleteCity
 public bool Delete(string cityName)
 {
     CityDelete exec = new CityDelete();
     try
     {
         exec.CityName = cityName;
         exec.ExecNoQuery();
         return true;
     }
     catch (Exception ex)
     {
         //throw ex;
         return false;
     }
     finally
     {
         exec = null;
     }
 }