Пример #1
0
 public bool Insert(VacationType vacationtype)
 {
     int autonumber = 0;
     VacationTypeDAC vacationtypeComponent = new VacationTypeDAC();
     bool endedSuccessfuly = vacationtypeComponent.InsertNewVacationType( ref autonumber,  vacationtype.Name);
     if(endedSuccessfuly)
     {
         vacationtype.VacationTypeID = autonumber;
     }
     return endedSuccessfuly;
 }
Пример #2
0
 public VacationType GetByID(int _vacationTypeID)
 {
     VacationTypeDAC _vacationTypeComponent = new VacationTypeDAC();
      IDataReader reader = _vacationTypeComponent.GetByIDVacationType(_vacationTypeID);
      VacationType _vacationType = null;
      while(reader.Read())
      {
          _vacationType = new VacationType();
          if(reader["VacationTypeID"] != DBNull.Value)
              _vacationType.VacationTypeID = Convert.ToInt32(reader["VacationTypeID"]);
          if(reader["Name"] != DBNull.Value)
              _vacationType.Name = Convert.ToString(reader["Name"]);
      _vacationType.NewRecord = false;             }             reader.Close();
      return _vacationType;
 }
Пример #3
0
 public List<VacationType> GetAll()
 {
     VacationTypeDAC _vacationTypeComponent = new VacationTypeDAC();
      IDataReader reader =  _vacationTypeComponent.GetAllVacationType().CreateDataReader();
      List<VacationType> _vacationTypeList = new List<VacationType>();
      while(reader.Read())
      {
      if(_vacationTypeList == null)
          _vacationTypeList = new List<VacationType>();
          VacationType _vacationType = new VacationType();
          if(reader["VacationTypeID"] != DBNull.Value)
              _vacationType.VacationTypeID = Convert.ToInt32(reader["VacationTypeID"]);
          if(reader["Name"] != DBNull.Value)
              _vacationType.Name = Convert.ToString(reader["Name"]);
      _vacationType.NewRecord = false;
      _vacationTypeList.Add(_vacationType);
      }             reader.Close();
      return _vacationTypeList;
 }
Пример #4
0
 public bool Update(VacationType vacationtype ,int old_vacationTypeID)
 {
     VacationTypeDAC vacationtypeComponent = new VacationTypeDAC();
     return vacationtypeComponent.UpdateVacationType( vacationtype.Name,  old_vacationTypeID);
 }
Пример #5
0
        public bool Insert( string Name)
        {
            VacationTypeDAC vacationtypeComponent = new VacationTypeDAC();
            int VacationTypeID = 0;

            return vacationtypeComponent.InsertNewVacationType( ref VacationTypeID,  Name);
        }
Пример #6
0
 public void Delete(int Original_VacationTypeID)
 {
     VacationTypeDAC vacationtypeComponent = new VacationTypeDAC();
     vacationtypeComponent.DeleteVacationType(Original_VacationTypeID);
 }
Пример #7
0
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     VacationTypeDAC vacationtypecomponent = new VacationTypeDAC();
     return vacationtypecomponent.UpdateDataset(dataset);
 }
Пример #8
0
 public bool Update( string Name,  int Original_VacationTypeID)
 {
     VacationTypeDAC vacationtypeComponent = new VacationTypeDAC();
     return vacationtypeComponent.UpdateVacationType( Name,  Original_VacationTypeID);
 }