/// <summary> /// KhoaHT added 4/4/2008 /// Add a new stattic method /// </summary> /// <returns></returns> public static DataSet RetrieveAll() { ConnectionFactory Connection = InternalGlobal.MakeConnectionFactory(); PrArea area = new PrArea(Connection); try { Connection.Open(); return area.Search(); } catch (Exception exp) { throw exp; } finally { Connection.Close(); } }
/// <summary> /// @author : TrungMT /// @CreateDate:04/03/2008 /// @Description: Delete 1 area with area_id /// </summary> public int Delete(Area pArea) { PrArea area = new PrArea(Connection); int intRowAffected = 0; try { Open(); intRowAffected = area.Delete(pArea); Commit(); } catch (Exception exp) { Rollback(); throw exp; } finally { Close(); } return intRowAffected; }
/// <summary> /// @author : TrungMT /// @CreateDate:04/03/2008 /// @Description: Insert 1 area and return area_id auto increment /// </summary> public int Add(Area pArea) { PrArea area = new PrArea(Connection); int intAreaID = -1; try { Open(); intAreaID = area.Create(pArea); Commit(); } catch (Exception exp) { Rollback(); throw exp; } finally { Close(); } return intAreaID; }
/// <summary> /// @author : TrungMT /// @CreateDate:04/03/2008 /// @Description: Retrieves all area /// </summary> public DataSet Retrieves(Area pArea) { PrArea area = new PrArea(Connection); try { Open(); return area.Search(pArea); } catch (Exception exp) { throw exp; } finally { Close(); } }