public List <ItemsFilesEntity> GetLast(int itemID, int moduleTypeID, ItemFileTypes fileType, int count, int CategoryID) { using (SqlConnection myConnection = GetSqlConnection()) { List <ItemsFilesEntity> ItemsFilesList = new List <ItemsFilesEntity>(); ItemsFilesEntity ItemsFiles; SqlCommand myCommand = new SqlCommand("ItemsFiles_GetLast", myConnection); myCommand.CommandType = CommandType.StoredProcedure; // Set the parameters myCommand.Parameters.Add("@ItemID", SqlDbType.Int, 4).Value = itemID; myCommand.Parameters.Add("@CategoryID", SqlDbType.Int, 4).Value = CategoryID; myCommand.Parameters.Add("@FileType", SqlDbType.Int, 4).Value = (int)fileType; myCommand.Parameters.Add("@ModuleTypeID", SqlDbType.Int, 8).Value = (int)moduleTypeID; myCommand.Parameters.Add("@Count", SqlDbType.Int, 4).Value = count; //---------------------------------------------------------------------------------------------- //OwnerID myCommand.Parameters.Add("@OwnerID", SqlDbType.UniqueIdentifier).Value = SitesHandler.GetOwnerIDAsGuid(); //---------------------------------------------------------------------------------------------- // Execute the command SqlDataReader dr; myConnection.Open(); dr = myCommand.ExecuteReader(CommandBehavior.CloseConnection); while (dr.Read()) { (ItemsFiles) = PopulateItemsFilesEntityFromIDataReader(dr); ItemsFilesList.Add(ItemsFiles); } dr.Close(); myConnection.Close(); return(ItemsFilesList); } }
//------------------------------------------ #endregion #region --------------GetAll-------------- public List <ItemsFilesEntity> GetAll(int itemID, int moduleTypeID, ItemFileTypes FileType, int pageIndex, int pageSize, out int totalRecords, int CategoryID) { using (SqlConnection myConnection = GetSqlConnection()) { List <ItemsFilesEntity> ItemsFilesList = new List <ItemsFilesEntity>(); ItemsFilesEntity ItemsFiles; SqlCommand myCommand = new SqlCommand("ItemsFiles_GetAll", myConnection); myCommand.CommandType = CommandType.StoredProcedure; // Set the parameters myCommand.Parameters.Add("@ItemID", SqlDbType.Int, 4).Value = itemID; myCommand.Parameters.Add("@CategoryID", SqlDbType.Int, 4).Value = CategoryID; myCommand.Parameters.Add("@FileType", SqlDbType.Int, 4).Value = (int)FileType; myCommand.Parameters.Add("@ModuleTypeID", SqlDbType.Int, 8).Value = (int)moduleTypeID; myCommand.Parameters.Add("@pageIndex", SqlDbType.Int, 4).Value = pageIndex; myCommand.Parameters.Add("@pageSize", SqlDbType.Int, 4).Value = pageSize; myCommand.Parameters.Add("@TotalRecords", SqlDbType.Int, 4).Direction = ParameterDirection.Output; //---------------------------------------------------------------------------------------------- //OwnerID myCommand.Parameters.Add("@OwnerID", SqlDbType.UniqueIdentifier).Value = SitesHandler.GetOwnerIDAsGuid(); //---------------------------------------------------------------------------------------------- // Execute the command SqlDataReader dr; myConnection.Open(); dr = myCommand.ExecuteReader(CommandBehavior.CloseConnection); while (dr.Read()) { (ItemsFiles) = PopulateItemsFilesEntityFromIDataReader(dr); ItemsFilesList.Add(ItemsFiles); } dr.Close(); myConnection.Close(); //Gets result rows count totalRecords = (int)myCommand.Parameters["@TotalRecords"].Value; if (totalRecords < 0) { totalRecords = ItemsFilesList.Count; } //---------------------------------------------------------------- return(ItemsFilesList); } }
public static List <ItemsFilesEntity> GetAll(int itemID, int moduleTypeID, ItemFileTypes fileType, int CategoryID) { int totalRecords = 0; return(ItemsFilesSqlDataPrvider.Instance.GetAll(itemID, moduleTypeID, fileType, -1, -1, out totalRecords, CategoryID)); }
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX public static List <ItemsFilesEntity> GetAll(int itemID, int moduleTypeID, ItemFileTypes fileType) { return(GetAll(itemID, moduleTypeID, fileType, -1)); }
public static List <ItemsFilesEntity> GetLast(int itemID, int moduleTypeID, ItemFileTypes fileType, int count, int CategoryID) { return(ItemsFilesSqlDataPrvider.Instance.GetLast(itemID, moduleTypeID, fileType, count, CategoryID)); }
public static List <ItemsFilesEntity> GetAll(int itemID, int moduleTypeID, ItemFileTypes fileType, int pageIndex, int pageSize, out int totalRecords, int CategoryID) { return(ItemsFilesSqlDataPrvider.Instance.GetAll(itemID, moduleTypeID, fileType, pageIndex, pageSize, out totalRecords, CategoryID)); }
//------------------------------------ public static List <ItemsFilesEntity> GetAll(int itemID, int moduleTypeID, ItemFileTypes fileType, int pageIndex, int pageSize, out int totalRecords) { return(GetAll(itemID, moduleTypeID, fileType, pageIndex, pageSize, out totalRecords, -1)); }
public static List <ItemsFilesEntity> GetAll(int itemID, ItemFileTypes fileType, int pageIndex, int pageSize, out int totalRecords, int CategoryID) { return(GetAll(itemID, (int)StandardItemsModuleTypes.UnKnowen, fileType, pageIndex, pageSize, out totalRecords, CategoryID)); }