internal OCL.VideoStorageServers AllVisibleVideoStorageServers(OCL.User AccessingUser) { string sSQL = ""; if(AccessingUser.mvarIsSuperUser) { sSQL = "SELECT ID FROM tblVideoStorageServer WHERE IsDefault = 0"; } else { sSQL = "SELECT DISTINCT tblGroupTokens.ObjectId FROM tblGroupTokens LEFT OUTER JOIN tblVideoStorageServer ON tblGroupTokens.ObjectId = tblVideoStorageServer.Id WHERE UserId = " + AccessingUser.ID + " AND tblGroupTokens.ObjectTypeId = " + Convert.ToInt32(OCL.OysterObjectType.VideoStorageServer) + " AND tblGroupTokens.IsVisible <> 0"; } VideoStorageServers X = new VideoStorageServers(); System.Data.DataSet DS = null; try { DS = RF.GetDataSet(sSQL); DataTable DT = DS.Tables[0]; ; foreach(DataRow R in DT.Rows) { VideoStorageServer V = null; V = GetVideoStorageServer(Convert.ToInt32((object)R[0])); if(V != null) X.Add(V); } } catch(SqlException Err) { throw new Exception(Err.Message,Err.InnerException); } return X; }
/// <summary> /// Return all Video Storage Servers currently in the System /// </summary> /// <returns></returns> internal VideoStorageServers ALLVideoStorageServers() { try { VideoStorageServers X = new VideoStorageServers(); string sSQL = "Select * FROM tblVideoStorageServer"; DataSet DS = RF.GetDataSet(sSQL); DataTable DT = DS.Tables[0]; foreach(DataRow R in DT.Rows) { VideoStorageServer V = null; V = GetVideoStorageServer(Convert.ToInt32((object)R[0])); if(V != null) X.Add(V); } return X; } catch(Exception Err) { throw new ApplicationException(Err.Message); } }