예제 #1
0
파일: RoleLogic.cs 프로젝트: ramyothman/RBM
 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;
 }
예제 #2
0
파일: RoleLogic.cs 프로젝트: ramyothman/RBM
 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;
 }
예제 #3
0
파일: RoleLogic.cs 프로젝트: ramyothman/RBM
 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);
 }
예제 #4
0
파일: RoleLogic.cs 프로젝트: ramyothman/RBM
 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;
 }
예제 #5
0
파일: RoleLogic.cs 프로젝트: ramyothman/RBM
 public void Delete(int Original_RoleId)
 {
     RoleDAC roleComponent = new RoleDAC();
     roleComponent.DeleteRole(Original_RoleId);
 }
예제 #6
0
파일: RoleLogic.cs 프로젝트: ramyothman/RBM
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     RoleDAC rolecomponent = new RoleDAC();
     return rolecomponent.UpdateDataset(dataset);
 }
예제 #7
0
파일: RoleLogic.cs 프로젝트: ramyothman/RBM
 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);
 }
예제 #8
0
파일: RoleLogic.cs 프로젝트: ramyothman/RBM
 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);
 }