// 根据主键ID返回指定的XiangMuFenLei实体 public static XiangMuFenLeiBusEntity GetEntity(int ID) { XiangMuFenLeiByPK exec = new XiangMuFenLeiByPK(); exec.ID = ID; XiangMuFenLeiBusEntity obj = new XiangMuFenLeiBusEntity(); obj.MetaDataTable = exec.ExecDataTable(); return obj; }
// 公用静态方法,插入一条记录 InsertXiangMuFenLei public static bool InsertEntity(XiangMuFenLeiBusEntity obj) { XiangMuFenLeiInsert exec = new XiangMuFenLeiInsert(); try { exec.ReceiveParameter(obj); exec.ExecNoQuery(); return true; } catch (Exception ex) { //throw ex; return false; } finally { obj = null; } }
// 公用静态方法,修改一条记录 UpdateXiangMuFenLei public static bool UpdateEntity(XiangMuFenLeiBusEntity obj) { if (obj == null || obj.IsEmpty) { return false; } XiangMuFenLeiUpdate exec = new XiangMuFenLeiUpdate(); try { exec.ReceiveParameter(obj); exec.ExecNoQuery(); return true; } catch (Exception ex) { //throw ex; return false; } finally { obj = null; } }
// 修改由实体指定的一条记录 ModifyXiangMuFenLei public bool Modify(XiangMuFenLeiBusEntity obj) { return UpdateEntity(obj); }
// 添加由实体指定的一条记录 AddXiangMuFenLei public bool Add(XiangMuFenLeiBusEntity obj) { return InsertEntity(obj); }