예제 #1
0
 public List<Position> GetAllBySiteID(int SiteID)
 {
     PositionDAC _positionComponent = new PositionDAC();
     IDataReader reader = _positionComponent.GetAllPosition("SiteID = " + SiteID).CreateDataReader();
     List<Position> _positionList = new List<Position>();
     while (reader.Read())
     {
         if (_positionList == null)
             _positionList = new List<Position>();
         Position _position = new Position();
         if (reader["PositionID"] != DBNull.Value)
             _position.PositionID = Convert.ToInt32(reader["PositionID"]);
         if (reader["SiteID"] != DBNull.Value)
             _position.SiteID = Convert.ToInt32(reader["SiteID"]);
         if (reader["Name"] != DBNull.Value)
             _position.Name = Convert.ToString(reader["Name"]);
         if (reader["Code"] != DBNull.Value)
             _position.Code = Convert.ToString(reader["Code"]);
         _position.NewRecord = false;
         _positionList.Add(_position);
     } reader.Close();
     return _positionList;
 }
예제 #2
0
 public Position GetByID(int _positionID)
 {
     PositionDAC _positionComponent = new PositionDAC();
     IDataReader reader = _positionComponent.GetByIDPosition(_positionID);
     Position _position = null;
     while (reader.Read())
     {
         _position = new Position();
         if (reader["PositionID"] != DBNull.Value)
             _position.PositionID = Convert.ToInt32(reader["PositionID"]);
         if (reader["SiteID"] != DBNull.Value)
             _position.SiteID = Convert.ToInt32(reader["SiteID"]);
         if (reader["Name"] != DBNull.Value)
             _position.Name = Convert.ToString(reader["Name"]);
         if (reader["Code"] != DBNull.Value)
             _position.Code = Convert.ToString(reader["Code"]);
         _position.NewRecord = false;
     } reader.Close();
     return _position;
 }
예제 #3
0
 public void Delete(int Original_PositionID)
 {
     PositionDAC positionComponent = new PositionDAC();
     positionComponent.DeletePosition(Original_PositionID);
 }
예제 #4
0
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     PositionDAC positioncomponent = new PositionDAC();
     return positioncomponent.UpdateDataset(dataset);
 }
예제 #5
0
 public bool Update(int SiteID, string Name, string Code, int Original_PositionID)
 {
     PositionDAC positionComponent = new PositionDAC();
     return positionComponent.UpdatePosition(SiteID, Name, Code, Original_PositionID);
 }
예제 #6
0
 public bool Update(Position position, int old_positionID)
 {
     PositionDAC positionComponent = new PositionDAC();
     return positionComponent.UpdatePosition(position.SiteID, position.Name, position.Code, old_positionID);
 }
예제 #7
0
        public bool Insert(int SiteID, string Name, string Code)
        {
            PositionDAC positionComponent = new PositionDAC();
            int PositionID = 0;

            return positionComponent.InsertNewPosition(ref PositionID, SiteID, Name, Code);
        }
예제 #8
0
 public bool Insert(Position position)
 {
     int autonumber = 0;
     PositionDAC positionComponent = new PositionDAC();
     bool endedSuccessfuly = positionComponent.InsertNewPosition(ref autonumber, position.SiteID, position.Name, position.Code);
     if (endedSuccessfuly)
     {
         position.PositionID = autonumber;
     }
     return endedSuccessfuly;
 }