예제 #1
0
 // 根据主键coalClassID返回指定的MeiZhong实体
 public static MeiZhongBusEntity GetEntity(int coalClassID)
 {
     MeiZhongByPK exec = new MeiZhongByPK();
     exec.CoalClassID = coalClassID;
     MeiZhongBusEntity obj = new MeiZhongBusEntity();
     obj.MetaDataTable = exec.ExecDataTable();
     return obj;
 }
예제 #2
0
 // 公用静态方法,插入一条记录 InsertMeiZhong
 public static bool InsertEntity(MeiZhongBusEntity obj)
 {
     MeiZhongInsert exec = new MeiZhongInsert();
     try
     {
         exec.ReceiveParameter(obj);
         exec.ExecNoQuery();
         return true;
     }
     catch (Exception ex)
     {
         //throw ex;
         return false;
     }
     finally
     {
         obj = null;
     }
 }
예제 #3
0
 // 公用静态方法,修改一条记录 UpdateMeiZhong
 public static bool UpdateEntity(MeiZhongBusEntity obj)
 {
     if (obj == null || obj.IsEmpty)
     {
         return false;
     }
     MeiZhongUpdate exec = new MeiZhongUpdate();
     try
     {
         exec.ReceiveParameter(obj);
         exec.ExecNoQuery();
         return true;
     }
     catch (Exception ex)
     {
         //throw ex;
         return false;
     }
     finally
     {
         obj = null;
     }
 }
예제 #4
0
 // 修改由实体指定的一条记录 ModifyMeiZhong
 public bool Modify(MeiZhongBusEntity obj)
 {
     return UpdateEntity(obj);
 }
예제 #5
0
 // 添加由实体指定的一条记录 AddMeiZhong
 public bool Add(MeiZhongBusEntity obj)
 {
     return InsertEntity(obj);
 }