// 根据主键ID返回指定的PinDaoSheZhi实体 public static PinDaoSheZhiBusEntity GetEntity(int ID) { PinDaoSheZhiByPK exec = new PinDaoSheZhiByPK(); exec.ID = ID; PinDaoSheZhiBusEntity obj = new PinDaoSheZhiBusEntity(); obj.MetaDataTable = exec.ExecDataTable(); return obj; }
// 公用静态方法,插入一条记录 InsertPinDaoSheZhi public static bool InsertEntity(PinDaoSheZhiBusEntity obj) { PinDaoSheZhiInsert exec = new PinDaoSheZhiInsert(); try { exec.ReceiveParameter(obj); exec.ExecNoQuery(); return true; } catch (Exception ex) { //throw ex; return false; } finally { obj = null; } }
// 公用静态方法,修改一条记录 UpdatePinDaoSheZhi public static bool UpdateEntity(PinDaoSheZhiBusEntity obj) { if (obj == null || obj.IsEmpty) { return false; } PinDaoSheZhiUpdate exec = new PinDaoSheZhiUpdate(); try { exec.ReceiveParameter(obj); exec.ExecNoQuery(); return true; } catch (Exception ex) { //throw ex; return false; } finally { obj = null; } }
// 修改由实体指定的一条记录 ModifyPinDaoSheZhi public bool Modify(PinDaoSheZhiBusEntity obj) { return UpdateEntity(obj); }
// 添加由实体指定的一条记录 AddPinDaoSheZhi public bool Add(PinDaoSheZhiBusEntity obj) { return InsertEntity(obj); }