Beispiel #1
0
 public List<RolePrivilege> GetAll(int RoleID)
 {
     RolePrivilegeDAC _rolePrivilegeComponent = new RolePrivilegeDAC();
     IDataReader reader = _rolePrivilegeComponent.GetAllRolePrivilege("RoleId="+RoleID).CreateDataReader();
     List<RolePrivilege> _rolePrivilegeList = new List<RolePrivilege>();
     while (reader.Read())
     {
         if (_rolePrivilegeList == null)
             _rolePrivilegeList = new List<RolePrivilege>();
         RolePrivilege _rolePrivilege = new RolePrivilege();
         if (reader["RolePrivilegeId"] != DBNull.Value)
             _rolePrivilege.RolePrivilegeId = Convert.ToInt32(reader["RolePrivilegeId"]);
         if (reader["RoleId"] != DBNull.Value)
             _rolePrivilege.RoleId = Convert.ToInt32(reader["RoleId"]);
         if (reader["ContentEntityId"] != DBNull.Value)
             _rolePrivilege.ContentEntityId = Convert.ToInt32(reader["ContentEntityId"]);
         if (reader["SystemFunctionId"] != DBNull.Value)
             _rolePrivilege.SystemFunctionId = Convert.ToInt32(reader["SystemFunctionId"]);
         if (reader["HasAccess"] != DBNull.Value)
             _rolePrivilege.HasAccess = Convert.ToBoolean(reader["HasAccess"]);
         if (reader["ModifiedDate"] != DBNull.Value)
             _rolePrivilege.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
         _rolePrivilege.NewRecord = false;
         _rolePrivilegeList.Add(_rolePrivilege);
     } reader.Close();
     return _rolePrivilegeList;
 }
Beispiel #2
0
 public RolePrivilege GetByID(int _rolePrivilegeId)
 {
     RolePrivilegeDAC _rolePrivilegeComponent = new RolePrivilegeDAC();
      IDataReader reader = _rolePrivilegeComponent.GetByIDRolePrivilege(_rolePrivilegeId);
      RolePrivilege _rolePrivilege = null;
      while(reader.Read())
      {
          _rolePrivilege = new RolePrivilege();
          if(reader["RolePrivilegeId"] != DBNull.Value)
              _rolePrivilege.RolePrivilegeId = Convert.ToInt32(reader["RolePrivilegeId"]);
          if(reader["RoleId"] != DBNull.Value)
              _rolePrivilege.RoleId = Convert.ToInt32(reader["RoleId"]);
          if(reader["ContentEntityId"] != DBNull.Value)
              _rolePrivilege.ContentEntityId = Convert.ToInt32(reader["ContentEntityId"]);
          if(reader["SystemFunctionId"] != DBNull.Value)
              _rolePrivilege.SystemFunctionId = Convert.ToInt32(reader["SystemFunctionId"]);
          if(reader["HasAccess"] != DBNull.Value)
              _rolePrivilege.HasAccess = Convert.ToBoolean(reader["HasAccess"]);
          if(reader["ModifiedDate"] != DBNull.Value)
              _rolePrivilege.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
      _rolePrivilege.NewRecord = false;             }             reader.Close();
      return _rolePrivilege;
 }
Beispiel #3
0
 public void Delete(int Original_RolePrivilegeId)
 {
     RolePrivilegeDAC roleprivilegeComponent = new RolePrivilegeDAC();
     roleprivilegeComponent.DeleteRolePrivilege(Original_RolePrivilegeId);
 }
Beispiel #4
0
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     RolePrivilegeDAC roleprivilegecomponent = new RolePrivilegeDAC();
     return roleprivilegecomponent.UpdateDataset(dataset);
 }
Beispiel #5
0
 public bool Update( int RoleId,  int ContentEntityId,  int SystemFunctionId,  bool HasAccess,  DateTime ModifiedDate,  int Original_RolePrivilegeId)
 {
     RolePrivilegeDAC roleprivilegeComponent = new RolePrivilegeDAC();
     HasAccess = true;
     return roleprivilegeComponent.UpdateRolePrivilege( RoleId,  ContentEntityId,  SystemFunctionId,  HasAccess,  DateTime.Now,  Original_RolePrivilegeId);
 }
Beispiel #6
0
 public bool Update(RolePrivilege roleprivilege ,int old_rolePrivilegeId)
 {
     RolePrivilegeDAC roleprivilegeComponent = new RolePrivilegeDAC();
     roleprivilege.HasAccess = true;
     return roleprivilegeComponent.UpdateRolePrivilege( roleprivilege.RoleId,  roleprivilege.ContentEntityId,  roleprivilege.SystemFunctionId,  roleprivilege.HasAccess,  DateTime.Now,  old_rolePrivilegeId);
 }
Beispiel #7
0
 public bool Insert( int RoleId,  int ContentEntityId,  int SystemFunctionId,  bool HasAccess,  DateTime ModifiedDate)
 {
     ModifiedDate = DateTime.Now;
     RolePrivilegeDAC roleprivilegeComponent = new RolePrivilegeDAC();
     int RolePrivilegeId = 0;
     HasAccess = true;
     return roleprivilegeComponent.InsertNewRolePrivilege( ref RolePrivilegeId,  RoleId,  ContentEntityId,  SystemFunctionId,  HasAccess,  DateTime.Now);
 }
Beispiel #8
0
 public bool Insert(RolePrivilege roleprivilege)
 {
     int autonumber = 0;
     RolePrivilegeDAC roleprivilegeComponent = new RolePrivilegeDAC();
     roleprivilege.HasAccess = true;
     bool endedSuccessfuly = roleprivilegeComponent.InsertNewRolePrivilege( ref autonumber,  roleprivilege.RoleId,  roleprivilege.ContentEntityId,  roleprivilege.SystemFunctionId,  roleprivilege.HasAccess,  DateTime.Now);
     if(endedSuccessfuly)
     {
         roleprivilege.RolePrivilegeId = autonumber;
     }
     return endedSuccessfuly;
 }