// 根据主键coalVarietyID返回指定的PinZhong实体 public static PinZhongBusEntity GetEntity(int coalVarietyID) { PinZhongByPK exec = new PinZhongByPK(); exec.CoalVarietyID = coalVarietyID; PinZhongBusEntity obj = new PinZhongBusEntity(); obj.MetaDataTable = exec.ExecDataTable(); return obj; }
// 公用静态方法,插入一条记录 InsertPinZhong public static bool InsertEntity(PinZhongBusEntity obj) { PinZhongInsert exec = new PinZhongInsert(); try { exec.ReceiveParameter(obj); exec.ExecNoQuery(); return true; } catch (Exception ex) { //throw ex; return false; } finally { obj = null; } }
// 公用静态方法,修改一条记录 UpdatePinZhong public static bool UpdateEntity(PinZhongBusEntity obj) { if (obj == null || obj.IsEmpty) { return false; } PinZhongUpdate exec = new PinZhongUpdate(); try { exec.ReceiveParameter(obj); exec.ExecNoQuery(); return true; } catch (Exception ex) { //throw ex; return false; } finally { obj = null; } }
// 修改由实体指定的一条记录 ModifyPinZhong public bool Modify(PinZhongBusEntity obj) { return UpdateEntity(obj); }
// 添加由实体指定的一条记录 AddPinZhong public bool Add(PinZhongBusEntity obj) { return InsertEntity(obj); }