public bool Insert(SecurityAccessType securityaccesstype)
 {
     int autonumber = 0;
     SecurityAccessTypeDAC securityaccesstypeComponent = new SecurityAccessTypeDAC();
     bool endedSuccessfuly = securityaccesstypeComponent.InsertNewSecurityAccessType( ref autonumber,  securityaccesstype.Name,  securityaccesstype.RowGuid,  securityaccesstype.ModifiedDate);
     if(endedSuccessfuly)
     {
         securityaccesstype.SecurityAccessTypeId = autonumber;
     }
     return endedSuccessfuly;
 }
 public SecurityAccessType GetByID(int _securityAccessTypeId)
 {
     SecurityAccessTypeDAC _securityAccessTypeComponent = new SecurityAccessTypeDAC();
      IDataReader reader = _securityAccessTypeComponent.GetByIDSecurityAccessType(_securityAccessTypeId);
      SecurityAccessType _securityAccessType = null;
      while(reader.Read())
      {
          _securityAccessType = new SecurityAccessType();
          if(reader["SecurityAccessTypeId"] != DBNull.Value)
              _securityAccessType.SecurityAccessTypeId = Convert.ToInt32(reader["SecurityAccessTypeId"]);
          if(reader["Name"] != DBNull.Value)
              _securityAccessType.Name = Convert.ToString(reader["Name"]);
          if(reader["RowGuid"] != DBNull.Value)
              _securityAccessType.RowGuid = new Guid(reader["RowGuid"].ToString());
          if(reader["ModifiedDate"] != DBNull.Value)
              _securityAccessType.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
      _securityAccessType.NewRecord = false;             }             reader.Close();
      return _securityAccessType;
 }
 public List<SecurityAccessType> GetAll()
 {
     SecurityAccessTypeDAC _securityAccessTypeComponent = new SecurityAccessTypeDAC();
      IDataReader reader =  _securityAccessTypeComponent.GetAllSecurityAccessType().CreateDataReader();
      List<SecurityAccessType> _securityAccessTypeList = new List<SecurityAccessType>();
      while(reader.Read())
      {
      if(_securityAccessTypeList == null)
          _securityAccessTypeList = new List<SecurityAccessType>();
          SecurityAccessType _securityAccessType = new SecurityAccessType();
          if(reader["SecurityAccessTypeId"] != DBNull.Value)
              _securityAccessType.SecurityAccessTypeId = Convert.ToInt32(reader["SecurityAccessTypeId"]);
          if(reader["Name"] != DBNull.Value)
              _securityAccessType.Name = Convert.ToString(reader["Name"]);
          if(reader["RowGuid"] != DBNull.Value)
              _securityAccessType.RowGuid = new Guid(reader["RowGuid"].ToString());
          if(reader["ModifiedDate"] != DBNull.Value)
              _securityAccessType.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
      _securityAccessType.NewRecord = false;
      _securityAccessTypeList.Add(_securityAccessType);
      }             reader.Close();
      return _securityAccessTypeList;
 }
 public bool Update(SecurityAccessType securityaccesstype ,int old_securityAccessTypeId)
 {
     SecurityAccessTypeDAC securityaccesstypeComponent = new SecurityAccessTypeDAC();
     return securityaccesstypeComponent.UpdateSecurityAccessType( securityaccesstype.Name,  securityaccesstype.RowGuid,  securityaccesstype.ModifiedDate,  old_securityAccessTypeId);
 }