// 根据主键userID返回指定的LianXiXinXi实体 public static LianXiXinXiBusEntity GetEntity(int userID) { LianXiXinXiByPK exec = new LianXiXinXiByPK(); exec.UserID = userID; LianXiXinXiBusEntity obj = new LianXiXinXiBusEntity(); obj.MetaDataTable = exec.ExecDataTable(); return obj; }
// 公用静态方法,插入一条记录 InsertLianXiXinXi public static bool InsertEntity(LianXiXinXiBusEntity obj) { LianXiXinXiInsert exec = new LianXiXinXiInsert(); try { exec.ReceiveParameter(obj); exec.ExecNoQuery(); return true; } catch (Exception ex) { //throw ex; return false; } finally { obj = null; } }
// 公用静态方法,修改一条记录 UpdateLianXiXinXi public static bool UpdateEntity(LianXiXinXiBusEntity obj) { if (obj == null || obj.IsEmpty) { return false; } LianXiXinXiUpdate exec = new LianXiXinXiUpdate(); try { exec.ReceiveParameter(obj); exec.ExecNoQuery(); return true; } catch (Exception ex) { //throw ex; return false; } finally { obj = null; } }
// 修改由实体指定的一条记录 ModifyLianXiXinXi public bool Modify(LianXiXinXiBusEntity obj) { return UpdateEntity(obj); }
// 添加由实体指定的一条记录 AddLianXiXinXi public bool Add(LianXiXinXiBusEntity obj) { return InsertEntity(obj); }