Exemple #1
0
 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);
     }
 }
Exemple #2
0
        //------------------------------------------
        #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);
            }
        }
Exemple #3
0
        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));
        }
Exemple #4
0
 //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 public static List <ItemsFilesEntity> GetAll(int itemID, int moduleTypeID, ItemFileTypes fileType)
 {
     return(GetAll(itemID, moduleTypeID, fileType, -1));
 }
Exemple #5
0
 public static List <ItemsFilesEntity> GetLast(int itemID, int moduleTypeID, ItemFileTypes fileType, int count, int CategoryID)
 {
     return(ItemsFilesSqlDataPrvider.Instance.GetLast(itemID, moduleTypeID, fileType, count, CategoryID));
 }
Exemple #6
0
 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));
 }
Exemple #7
0
 //------------------------------------
 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));
 }
Exemple #8
0
 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));
 }