// 根据主键cityName返回指定的City实体 public static CityBusEntity GetEntity(string cityName) { CityByPK exec = new CityByPK(); exec.CityName = cityName; CityBusEntity obj = new CityBusEntity(); obj.MetaDataTable = exec.ExecDataTable(); return obj; }
// 根据主键cityName返回指定的City实体 public static CityBusEntity GetEntity(string cityName) { CityByPK exec = new CityByPK(); exec.CityName = cityName; CityBusEntity obj = new CityBusEntity(); obj.MetaDataTable = exec.ExecDataTable(); return(obj); }
// 公用静态方法,插入一条记录 InsertCity public static bool InsertEntity(CityBusEntity obj) { CityInsert exec = new CityInsert(); try { exec.ReceiveParameter(obj); exec.ExecNoQuery(); return true; } catch (Exception ex) { //throw ex; return false; } finally { obj = null; } }
// 公用静态方法,插入一条记录 InsertCity public static bool InsertEntity(CityBusEntity obj) { CityInsert exec = new CityInsert(); try { exec.ReceiveParameter(obj); exec.ExecNoQuery(); return(true); } catch (Exception ex) { //throw ex; return(false); } finally { obj = null; } }
// 公用静态方法,修改一条记录 UpdateCity public static bool UpdateEntity(CityBusEntity obj) { if (obj == null || obj.IsEmpty) { return false; } CityUpdate exec = new CityUpdate(); try { exec.ReceiveParameter(obj); exec.ExecNoQuery(); return true; } catch (Exception ex) { //throw ex; return false; } finally { obj = null; } }
// 公用静态方法,修改一条记录 UpdateCity public static bool UpdateEntity(CityBusEntity obj) { if (obj == null || obj.IsEmpty) { return(false); } CityUpdate exec = new CityUpdate(); try { exec.ReceiveParameter(obj); exec.ExecNoQuery(); return(true); } catch (Exception ex) { //throw ex; return(false); } finally { obj = null; } }
// 修改由实体指定的一条记录 ModifyCity public bool Modify(CityBusEntity obj) { return(UpdateEntity(obj)); }
// 添加由实体指定的一条记录 AddCity public bool Add(CityBusEntity obj) { return(InsertEntity(obj)); }
// 修改由实体指定的一条记录 ModifyCity public bool Modify(CityBusEntity obj) { return UpdateEntity(obj); }
// 添加由实体指定的一条记录 AddCity public bool Add(CityBusEntity obj) { return InsertEntity(obj); }