Example #1
0
 // 根据主键cityName返回指定的City实体
 public static CityBusEntity GetEntity(string cityName)
 {
     CityByPK exec = new CityByPK();
     exec.CityName = cityName;
     CityBusEntity obj = new CityBusEntity();
     obj.MetaDataTable = exec.ExecDataTable();
     return obj;
 }
Example #2
0
        // 根据主键cityName返回指定的City实体
        public static CityBusEntity GetEntity(string cityName)
        {
            CityByPK exec = new CityByPK();

            exec.CityName = cityName;
            CityBusEntity obj = new CityBusEntity();

            obj.MetaDataTable = exec.ExecDataTable();
            return(obj);
        }
Example #3
0
 // 公用静态方法,插入一条记录 InsertCity
 public static bool InsertEntity(CityBusEntity obj)
 {
     CityInsert exec = new CityInsert();
     try
     {
         exec.ReceiveParameter(obj);
         exec.ExecNoQuery();
         return true;
     }
     catch (Exception ex)
     {
         //throw ex;
         return false;
     }
     finally
     {
         obj = null;
     }
 }
Example #4
0
        // 公用静态方法,插入一条记录 InsertCity
        public static bool InsertEntity(CityBusEntity obj)
        {
            CityInsert exec = new CityInsert();

            try
            {
                exec.ReceiveParameter(obj);
                exec.ExecNoQuery();
                return(true);
            }
            catch (Exception ex)
            {
                //throw ex;
                return(false);
            }
            finally
            {
                obj = null;
            }
        }
Example #5
0
 // 公用静态方法,修改一条记录 UpdateCity
 public static bool UpdateEntity(CityBusEntity obj)
 {
     if (obj == null || obj.IsEmpty)
     {
         return false;
     }
     CityUpdate exec = new CityUpdate();
     try
     {
         exec.ReceiveParameter(obj);
         exec.ExecNoQuery();
         return true;
     }
     catch (Exception ex)
     {
         //throw ex;
         return false;
     }
     finally
     {
         obj = null;
     }
 }
Example #6
0
        // 公用静态方法,修改一条记录 UpdateCity
        public static bool UpdateEntity(CityBusEntity obj)
        {
            if (obj == null || obj.IsEmpty)
            {
                return(false);
            }
            CityUpdate exec = new CityUpdate();

            try
            {
                exec.ReceiveParameter(obj);
                exec.ExecNoQuery();
                return(true);
            }
            catch (Exception ex)
            {
                //throw ex;
                return(false);
            }
            finally
            {
                obj = null;
            }
        }
Example #7
0
 // 修改由实体指定的一条记录 ModifyCity
 public bool Modify(CityBusEntity obj)
 {
     return(UpdateEntity(obj));
 }
Example #8
0
 // 添加由实体指定的一条记录 AddCity
 public bool Add(CityBusEntity obj)
 {
     return(InsertEntity(obj));
 }
Example #9
0
 // 修改由实体指定的一条记录 ModifyCity
 public bool Modify(CityBusEntity obj)
 {
     return UpdateEntity(obj);
 }
Example #10
0
 // 添加由实体指定的一条记录 AddCity
 public bool Add(CityBusEntity obj)
 {
     return InsertEntity(obj);
 }