// 根据主键ID返回指定的BaoJiaFangShi实体 public static BaoJiaFangShiBusEntity GetEntity(int ID) { BaoJiaFangShiByPK exec = new BaoJiaFangShiByPK(); exec.ID = ID; BaoJiaFangShiBusEntity obj = new BaoJiaFangShiBusEntity(); obj.MetaDataTable = exec.ExecDataTable(); return obj; }
// 公用静态方法,插入一条记录 InsertBaoJiaFangShi public static bool InsertEntity(BaoJiaFangShiBusEntity obj) { BaoJiaFangShiInsert exec = new BaoJiaFangShiInsert(); try { exec.ReceiveParameter(obj); exec.ExecNoQuery(); return true; } catch (Exception ex) { //throw ex; return false; } finally { obj = null; } }
// 公用静态方法,修改一条记录 UpdateBaoJiaFangShi public static bool UpdateEntity(BaoJiaFangShiBusEntity obj) { if (obj == null || obj.IsEmpty) { return false; } BaoJiaFangShiUpdate exec = new BaoJiaFangShiUpdate(); try { exec.ReceiveParameter(obj); exec.ExecNoQuery(); return true; } catch (Exception ex) { //throw ex; return false; } finally { obj = null; } }
// 修改由实体指定的一条记录 ModifyBaoJiaFangShi public bool Modify(BaoJiaFangShiBusEntity obj) { return UpdateEntity(obj); }
// 添加由实体指定的一条记录 AddBaoJiaFangShi public bool Add(BaoJiaFangShiBusEntity obj) { return InsertEntity(obj); }