コード例 #1
0
ファイル: Operations.cs プロジェクト: CserTamasJanos/Queries
        public static bool ProductsOrderedMoreThanGivenNumberDowmnload(int referenceNumber, out List <ListViewItem> productsOrderedMoreThanGivenNumberListViewItemList)
        {
            productsOrderedMoreThanGivenNumberListViewItemList = new List <ListViewItem>();

            try
            {
                using (SqlConnection connection = new SqlConnection(QueryStrings.ServerConnetion))
                {
                    SqlCommand command = new SqlCommand(string.Format(Operations.QueryStrings.ProductsOrderedMoreThanGivenNumberDowmnload, referenceNumber), connection);

                    connection.Open();

                    SqlDataReader reader = command.ExecuteReader();

                    while (reader.Read())
                    {
                        ProductCategoryCount aNewProductCategoryCount = new ProductCategoryCount(reader[0].ToString(), Convert.ToInt32(reader[1]));

                        productsOrderedMoreThanGivenNumberListViewItemList.Add(aNewProductCategoryCount.ListViewItemForTable);
                    }
                }
            }
            catch (Exception a)
            {
                if (ErrorHappenedevent != null)
                {
                    ErrorHappenedevent.Invoke(ErrorMessageText(DataQueries.ProductsOrderMoreThanGivenNumber, a.Message));
                }
                return(false);
            }
            return(true);
        }
コード例 #2
0
ファイル: Operations.cs プロジェクト: CserTamasJanos/Queries
        public static bool CountOfProductAccordingToProductCategoryDownload(out List <ListViewItem> countOfProductAccordingToProductCategoryListViewItemList)
        {
            countOfProductAccordingToProductCategoryListViewItemList = new List <ListViewItem>();

            try
            {
                using (SqlConnection connection = new SqlConnection(QueryStrings.ServerConnetion))
                {
                    SqlCommand command = new SqlCommand(Operations.QueryStrings.CountOfProductAccordingToProductCategoryDownload, connection);

                    connection.Open();

                    SqlDataReader reader = command.ExecuteReader();

                    while (reader.Read())
                    {
                        ProductCategoryCount aNewProductCategoryCount = new ProductCategoryCount(reader[0].ToString(), Convert.ToInt32(reader[1]));

                        countOfProductAccordingToProductCategoryListViewItemList.Add(aNewProductCategoryCount.ListViewItemForTable);
                    }
                }
            }
            catch (Exception a)
            {
                if (ErrorHappenedevent != null)
                {
                    ErrorHappenedevent.Invoke(ErrorMessageText(DataQueries.CountOfProductAccordingToProductCategory, a.Message));
                }
                return(false);
            }
            return(true);
        }