Beispiel #1
0
 public List<Role> GetAll()
 {
     RoleDAC _roleComponent = new RoleDAC();
      IDataReader reader =  _roleComponent.GetAllRole().CreateDataReader();
      List<Role> _roleList = new List<Role>();
      while(reader.Read())
      {
      if(_roleList == null)
          _roleList = new List<Role>();
          Role _role = new Role();
          if(reader["RoleId"] != DBNull.Value)
              _role.RoleId = Convert.ToInt32(reader["RoleId"]);
          if(reader["Name"] != DBNull.Value)
              _role.Name = Convert.ToString(reader["Name"]);
          if(reader["IsActive"] != DBNull.Value)
              _role.IsActive = Convert.ToBoolean(reader["IsActive"]);
          if(reader["RowGuid"] != DBNull.Value)
              _role.RowGuid = new Guid(reader["RowGuid"].ToString());
          if(reader["ModifiedDate"] != DBNull.Value)
              _role.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
      _role.NewRecord = false;
      _roleList.Add(_role);
      }             reader.Close();
      return _roleList;
 }
Beispiel #2
0
 public Role GetByID(int _roleId)
 {
     RoleDAC _roleComponent = new RoleDAC();
      IDataReader reader = _roleComponent.GetByIDRole(_roleId);
      Role _role = null;
      while(reader.Read())
      {
          _role = new Role();
          if(reader["RoleId"] != DBNull.Value)
              _role.RoleId = Convert.ToInt32(reader["RoleId"]);
          if(reader["Name"] != DBNull.Value)
              _role.Name = Convert.ToString(reader["Name"]);
          if(reader["IsActive"] != DBNull.Value)
              _role.IsActive = Convert.ToBoolean(reader["IsActive"]);
          if(reader["RowGuid"] != DBNull.Value)
              _role.RowGuid = new Guid(reader["RowGuid"].ToString());
          if(reader["ModifiedDate"] != DBNull.Value)
              _role.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
      _role.NewRecord = false;             }             reader.Close();
      return _role;
 }
Beispiel #3
0
 public bool Insert( ref int RoleId,  string Name,  bool IsActive,  Guid RowGuid,  DateTime ModifiedDate)
 {
     RoleDAC roleComponent = new RoleDAC();
     return roleComponent.InsertNewRole( ref RoleId,  Name,  IsActive,  Guid.NewGuid(),  DateTime.Now);
 }
Beispiel #4
0
 public bool Insert(Role role)
 {
     int autonumber = 0;
     RoleDAC roleComponent = new RoleDAC();
     bool endedSuccessfuly = roleComponent.InsertNewRole( ref autonumber,  role.Name,  role.IsActive,  Guid.NewGuid(),  DateTime.Now);
     if(endedSuccessfuly)
     {
         role.RoleId = autonumber;
     }
     return endedSuccessfuly;
 }
Beispiel #5
0
 public void Delete(int Original_RoleId)
 {
     RoleDAC roleComponent = new RoleDAC();
     roleComponent.DeleteRole(Original_RoleId);
 }
Beispiel #6
0
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     RoleDAC rolecomponent = new RoleDAC();
     return rolecomponent.UpdateDataset(dataset);
 }
Beispiel #7
0
 public bool Update( string Name,  bool IsActive,  Guid RowGuid,  DateTime ModifiedDate,  int Original_RoleId)
 {
     RoleDAC roleComponent = new RoleDAC();
     return roleComponent.UpdateRole( Name,  IsActive,  RowGuid,  DateTime.Now,  Original_RoleId);
 }
Beispiel #8
0
 public bool Update(Role role ,int old_roleId)
 {
     RoleDAC roleComponent = new RoleDAC();
     return roleComponent.UpdateRole( role.Name,  role.IsActive,  role.RowGuid,  DateTime.Now,  old_roleId);
 }