当前位置: 首页>>代码示例>>C#>>正文


C# ResultSet.GetSize方法代码示例

本文整理汇总了C#中ResultSet.GetSize方法的典型用法代码示例。如果您正苦于以下问题:C# ResultSet.GetSize方法的具体用法?C# ResultSet.GetSize怎么用?C# ResultSet.GetSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ResultSet的用法示例。


在下文中一共展示了ResultSet.GetSize方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AwardCertificationForm

        public AwardCertificationForm()
        {
            InitializeComponent();

            customerResults = new ResultSet(cyclingDAL.GetDataReader("[CustomerTable]"));

            // Set the suggestions of the SuggestingTextBox to the Customer Names and add a Suggestion clicked listener to call SuggestionChosen
            CustomerNameSuggestingTextBox.SetSuggestions(customerResults.GetColumnData(1));
            CustomerNameSuggestingTextBox.SuggestionClickedEvent += new SuggestingTextBox.SuggestionClickedEventArgs(SuggestionChosen);
            CustomerNameSuggestingTextBox.textBox.TextChanged += new EventHandler(CustomerNameSuggestingTextBox_TextChanged);

            // Read and store the displayedResultSet data
            displayedResults = UpdateResultSet("CertificationBookingsTable JOIN ChildTable ON CertificationBookingsTable.ChildID = ChildTable.ChildID JOIN CustomerTable ON ChildTable.CustomerID = CustomerTable.CustomerID ", "1=1", "[CustomerTable].CustomerID, CustomerName, [ChildTable].ChildID, ChildName, CertificationBookingID, Level, Price");

            if (displayedResults.GetSize() > 0)
            {
                ShowRecord(0); // Shows the first record of this ResultSet.
            }
        }
开发者ID:StefanKennedy,项目名称:NorthCoast,代码行数:19,代码来源:AwardCertificationForm.cs

示例2: CancelBookingForm

        bool settingSuggestedText = false; // Used to prevent the built in WinForms event call of TextChanged changing the Displayed Results

        #endregion Fields

        #region Constructors

        public CancelBookingForm()
        {
            InitializeComponent();

            bookingResults = UpdateResultSet("[dbo].[BookingTable]"); // Extract data from different tables and save them as ResultSets
            customerResults = UpdateResultSet("[dbo].[CustomerTable]");
            campingResults = UpdateResultSet("[dbo].[CampingBookingsTable]");
            pitchResults = UpdateResultSet("[dbo].[PitchBookingsTable]");

            displayedResultSet = UpdateResultSet("BookingTable JOIN CustomerTable ON BookingTable.CustomerID = CustomerTable.CustomerID", "1=1", "BookingID, BookingTable.CustomerID, CustomerName, StartDate, NightsStayed, PricePerNight, TotalPrice"); // Display all of the booking results as we are not yet filtering them

            CustomerNameSuggestingTextBox.SetSuggestions(customerResults.GetColumnData(1)); // Set the customer names as the suggestions for the SuggestingTextBox
            CustomerNameSuggestingTextBox.SuggestionClickedEvent += new SuggestingTextBox.SuggestionClickedEventArgs(CustomerNameSuggestingTextBox_SuggestionChosen); // When a suggestion is chosen run the CustomerNameSuggestingTextBox_SuggestionChosen method
            CustomerNameSuggestingTextBox.textBox.TextChanged += new EventHandler(CustomerNameSuggestingTextBox_TextChanged);

            if (customerResults.GetSize() > 0)
            {
                ShowRecord(0); // Shows the first record of this ResultSet. Does not depend on a bookingID
            }
        }
开发者ID:StefanKennedy,项目名称:NorthCoast,代码行数:26,代码来源:CancelBookingForm.cs

示例3: ReturnEquipmentForm

        public ReturnEquipmentForm()
        {
            InitializeComponent();

            equipmentLoansResults = UpdateResultSet("[dbo].[EquipmentLoansTable]"); // Read and store the data from the EquipmentLoansTable

            // Read and store the displayedResultSet data
            displayedResultSet = UpdateResultSet("[dbo].[EquipmentLoansTable] JOIN [dbo].[CustomerTable] ON EquipmentLoansTable.CustomerID = CustomerTable.CustomerID JOIN [dbo].[EquipmentTable] ON EquipmentLoansTable.EquipmentID = EquipmentTable.EquipmentID", "1=1", "EquipmentLoanID, EquipmentLoansTable.EquipmentID, EquipmentName, CustomerTable.CustomerID, CustomerName, StartDate, Duration, Quantity, RentalPrice, StockLevel");

            originalDisplayedResults = displayedResultSet;

            // Set the suggestions of the SuggestingTextBox to the Customer Names and add a Suggestion clicked listener to call CustomerNameSuggestingTextBox_SuggestionChosen
            CustomerNameSuggestingTextBox.SetSuggestions(displayedResultSet.GetColumnData(4));
            CustomerNameSuggestingTextBox.SuggestionClickedEvent += new SuggestingTextBox.SuggestionClickedEventArgs(CustomerNameSuggestingTextBox_SuggestionChosen);
            CustomerNameSuggestingTextBox.textBox.TextChanged += new EventHandler(CustomerNameSuggestingTextBox_TextChanged);

            if (equipmentLoansResults.GetSize() > 0)
            {
                ShowRecord(0); // Shows the first record of this ResultSet.
            }
        }
开发者ID:StefanKennedy,项目名称:NorthCoast,代码行数:21,代码来源:ReturnEquipmentForm.cs

示例4: CustomerSuggestionChosen

        // When a customer name suggestion is chosen
        private void CustomerSuggestionChosen(string suggestion)
        {
            string command = "CustomerName = '" + suggestion + "'";
            ResultSet resultSet = new ResultSet(busDal.GetDataReader("[dbo].[CustomerTable]", command, "CustomerID")); // Get the data related to the chosen customer name
            busDal.CloseConnection();

            // Update the CustomerIDComboBox to show only the CustomerID's relating to the chosen customer name
            CustomerIDComboBox.Items.Clear();

            for (int i = 0; i < resultSet.GetSize(); i++)
            {
                CustomerIDComboBox.Items.Add(resultSet.GetData<int>(0, i) + "");
            }

            if (CustomerIDComboBox.Items.Count > 0)
            {
                CustomerIDComboBox.Text = CustomerIDComboBox.Items[0] + "";
            }
        }
开发者ID:StefanKennedy,项目名称:NorthCoast,代码行数:20,代码来源:BookSightseeingBusForm.cs

示例5: UpdateDisplayedResults

 // Used to Change the results that are displayed to the contents of a ResultSet
 private void UpdateDisplayedResults(ResultSet rs)
 {
     displayedResults = rs;
     Console.WriteLine(rs.GetSize());
     PreviousChildButton.Enabled = false;
     if (rs.GetSize() == 1) // If there is only one result don't allow the user to move to the next result
     {
         NextChildButton.Enabled = false;
     }
     else
     {
         NextChildButton.Enabled = true;
     }
     ShowRecord(0); // Show the first available record
 }
开发者ID:StefanKennedy,项目名称:NorthCoast,代码行数:16,代码来源:AwardCertificationForm.cs

示例6: SuggestionChosen

        // When a suggested Customer Name is chosen
        private void SuggestionChosen(string suggestion)
        {
            // Obtain the data that relates to the chosen customer name
            string command = "CustomerName = '" + suggestion + "'";
            ResultSet resultSet = new ResultSet(cyclingDAL.GetDataReader("[dbo].[CustomerTable]", command, "CustomerID"));

            // Make the CustomerIDComboBox show only the customerID's relating to the chosen Customer Name
            CustomerIDComboBox.Items.Clear();

            for (int i = 0; i < resultSet.GetSize(); i++)
            {
                CustomerIDComboBox.Items.Add(resultSet.GetData<int>(0, i) + "");
            }

            if (CustomerIDComboBox.Items.Count > 0)
            {
                CustomerIDComboBox.Text = CustomerIDComboBox.Items[0] + "";
            }

            CustomerIDComboBox_SelectedIndexChanged(CustomerNameSuggestingTextBox, new EventArgs());
        }
开发者ID:StefanKennedy,项目名称:NorthCoast,代码行数:22,代码来源:BookCyclingCertificationForm.cs

示例7: CustomerSuggestionChosen

        // When a customer name suggestion is chosen
        private void CustomerSuggestionChosen(string suggestion)
        {
            string command = "CustomerName = '" + suggestion + "'";
            ResultSet resultSet = new ResultSet(cyclingDAL.GetDataReader("[dbo].[CustomerTable]", command, "CustomerID"));

            // Update the CustomerIDComboBox with the ID's of the customers relating to the suggested customer name
            CustomerIDComboBox.Items.Clear();

            for (int i = 0; i < resultSet.GetSize(); i++)
            {
                CustomerIDComboBox.Items.Add(resultSet.GetData<int>(0, i) + "");
            }

            if (CustomerIDComboBox.Items.Count > 0)
            {
                CustomerIDComboBox.Text = CustomerIDComboBox.Items[0] + "";
            }
        }
开发者ID:StefanKennedy,项目名称:NorthCoast,代码行数:19,代码来源:BookCyclingTourForm.cs

示例8: NameSuggestionChosen

        // When a customer name suggestion was chosen
        private void NameSuggestionChosen(string suggestion)
        {
            string command = "CustomerName = '"+ suggestion + "'";
            ResultSet resultSet = new ResultSet(dal.GetDataReader("[dbo].[CustomerTable]", command, "CustomerID")); // Obtaing details about CustomerIDs
            //dal.CloseConnection();

            // Set the CustomerIDComboBox to display CustomerIDs that apply to this customer name
            CustomerIDComboBox.Items.Clear();

            for(int i = 0; i < resultSet.GetSize(); i++){
                CustomerIDComboBox.Items.Add(resultSet.GetData<int>(0, i) + "");
            }

            if (CustomerIDComboBox.Items.Count > 0)
            {
                CustomerIDComboBox.Text = CustomerIDComboBox.Items[0] + "";
            }
        }
开发者ID:StefanKennedy,项目名称:NorthCoast,代码行数:19,代码来源:HireEquipmentForm.cs

示例9: UpdateDisplayedResults

 // Used to Change the results that are displayed to the contents of a ResultSet
 private void UpdateDisplayedResults(ResultSet rs)
 {
     displayedResultSet = rs;
     CustomerNameSuggestingTextBox.SetSuggestions(rs.GetColumnData(2));
     PreviousBookingButton.Enabled = false;
     if (rs.GetSize() == 1) // If there is only one result don't allow the user to move to the next result
     {
         NextBookingButton.Enabled = false;
     }
     else
     {
         NextBookingButton.Enabled = true;
     }
     ShowRecord(0); // Show the first available record
 }
开发者ID:StefanKennedy,项目名称:NorthCoast,代码行数:16,代码来源:CancelBookingForm.cs

示例10: GetNumberAttendingLesson

 // Returns the number of children registered for a specific lesson
 public int GetNumberAttendingLesson(DateTime date, string timeSlot)
 {
     // Run a query to find the number of children attending the lesson at the specified date and time slot
     string query = string.Format("[Date] = '{0}' AND TimeSlot = '{1}'", string.Format("{0:MM-dd-yy}", date), timeSlot);
     ResultSet lessonResults = new ResultSet(GetDataReader("[CyclingLessonTable]", query, "NumberChildren"));
     CloseConnection();
     if (lessonResults.GetSize() == 0)
     {
         return 0;
     }
     return lessonResults.GetData<int>(0, 0);
 }
开发者ID:StefanKennedy,项目名称:NorthCoast,代码行数:13,代码来源:CyclingDAL.cs

示例11: GetBicyclesLeft

 // Returns the number of bicycles that have not yet been hired for a specific lesson
 public int GetBicyclesLeft(DateTime date, string timeSlot)
 {
     // Run a query to find the number of bicylces left for the lesson at the specified date and time slot
     string query = string.Format("[Date] = '{0}' AND TimeSlot = '{1}'", string.Format("{0:MM-dd-yy}", date), timeSlot);
     ResultSet tourResults = new ResultSet(GetDataReader("[CyclingTourTable]", query, "NumberBicycles"));
     CloseConnection();
     if (tourResults.GetSize() == 0)
     {
         return 15;
     }
     else
     {
         return (15 - tourResults.GetData<int>(0, 0));
     }
 }
开发者ID:StefanKennedy,项目名称:NorthCoast,代码行数:16,代码来源:CyclingDAL.cs

示例12: GetNumberSignedUp

 // Method to determine the number of people that have signed up for a tour on a specific time slot on a specific date
 public int GetNumberSignedUp(DateTime date, string timeSlot)
 {
     OpenConnection();
     // Run a query to find the number of cyclists registered for the specified time slot and specified date
     string query = string.Format("[CyclingTourTable].Date = '{0}' AND [CyclingTourTable].TimeSlot = '{1}'", string.Format("{0:MM-dd-yy}", date), timeSlot);
     ResultSet tourResults = new ResultSet(GetDataReader("[CyclingTourTable]", query, "NumberCyclists"));
     CloseConnection();
     if (tourResults.GetSize() == 0)
     {
         return 0;
     }
     return tourResults.GetData<int>(0, 0);
 }
开发者ID:StefanKennedy,项目名称:NorthCoast,代码行数:14,代码来源:CyclingDAL.cs


注:本文中的ResultSet.GetSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。