• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ResultSet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: MapRow

		private static void MapRow(DbDataReader dr, int numberOfColumns, ResultSet table) {
			var row = new object[numberOfColumns];
			for (int i = 0; i < numberOfColumns; i++) {
				row[i] = (DBNull.Value.Equals(dr[i])) ? null : dr[i];
			}
			table.AddRow(row);
		}
开发者ID:SharpTools,项目名称:sharpdata,代码行数:7,代码来源:DataReaderToResultSetMapper.cs


示例2: DataHandler

        public JsonResult DataHandler(DTParameters param)
        {
            try
            {
                var dtsource = new List<Customer>();
                using (dataSetEntities dc = new dataSetEntities())
                {
                    dtsource = dc.Customers.ToList();
                }

                List<String> columnSearch = new List<string>();

                foreach (var col in param.Columns)
                {
                    columnSearch.Add(col.Search.Value);
                }

                List<Customer> data = new ResultSet().GetResult(param.Search.Value, param.SortOrder, param.Start, param.Length, dtsource, columnSearch);
                int count = new ResultSet().Count(param.Search.Value, dtsource, columnSearch);
                DTResult<Customer> result = new DTResult<Customer>
                {
                    draw = param.Draw,
                    data = data,
                    recordsFiltered = count,
                    recordsTotal = count
                };
                return Json(result);
            }
            catch (Exception ex)
            {
                return Json(new { error = ex.Message });
            }
        }
开发者ID:rakeshkohale,项目名称:jquery-datatables1.10-mvc5-serverside,代码行数:33,代码来源:HomeController.cs


示例3: ReportForm

        private ResultSet reportedResultSet; // Stores the result set that is reported by this report

        #endregion Fields

        #region Constructors

        // Create a new report form with a Variable Number of column names
        public ReportForm(ResultSet reportedResults, params string[] names)
        {
            InitializeComponent();
            reportedResultSet = reportedResults; // Store the result set
            columnNames = names; // Store the column names
            CreateTable(); // Create the table from the column names and the result set
        }
开发者ID:StefanKennedy,项目名称:NorthCoast,代码行数:14,代码来源:ReportForm.cs


示例4: DataReader

 internal DataReader(ResultSet resultSet)
 {
     ResultIndex = -1;
     m_resultSet = resultSet;
     NextResult();
     
 }
开发者ID:mdcuesta,项目名称:anito.net,代码行数:7,代码来源:DataReader.cs


示例5: Constructor_ResultsModifiedAfter_ResultSetNotModified

		public void Constructor_ResultsModifiedAfter_ResultSetNotModified()
		{
			ResultSet<PalasoTestItem> resultSet = new ResultSet<PalasoTestItem>(_dataMapper, _results);
			_results.Add(new RecordToken<PalasoTestItem>(_dataMapper, _resultSet[2].Id));
			Assert.AreNotEqual(_results.Count, resultSet.Count);

		}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:7,代码来源:ResultSetTests.cs


示例6: ChangeBooking

        private void ChangeBooking(string customerName)
        {
            bookingResults = new ResultSet(dal.GetDataReader("BookingTable", "CustomerID = " + CustomerIDComboBox.Text));

            ClearExpensesLabels(); // Remove any labels explaining expenses

            //Obtain prices from all aspect of the database. Calculating price through C# prevents data duplication / redundancy
            float equipmentLoansPrice = dal.ReadPrice("EquipmentLoansTable JOIN EquipmentTable ON EquipmentLoansTable.EquipmentID = EquipmentTable.EquipmentID", "CustomerID = " + CustomerIDComboBox.Text, "(RentalPrice * Duration)");
            float sightseeingBusPrice = dal.ReadPrice("[Customer-BusTripTable]", "CustomerID = " + CustomerIDComboBox.Text, "Price");
            float cyclingTourPrice = dal.ReadPrice("[Customer-CyclingTourTable]", "CustomerID = " + CustomerIDComboBox.Text, "Price");
            float cyclingLessonPrice = dal.ReadPrice("[Child-CyclingLessonTable] JOIN [ChildTable] ON [Child-CyclingLessonTable].ChildID = ChildTable.ChildID", "ChildTable.CustomerID = " + CustomerIDComboBox.Text, "[Child-CyclingLessonTable].Price");
            float cyclingCertificationPrice = dal.ReadPrice("CertificationBookingsTable JOIN ChildTable ON CertificationBookingsTable.ChildID = ChildTable.ChildID", "ChildTable.CustomerID = " + CustomerIDComboBox.Text, "[CertificationBookingsTable].Price");
            dal.OpenConnection(); // Connection is opened and closed manually for a GetCount call because this can save on lag caused by connecting to database.
            float cyclingAwardPrice = dal.GetCount("[CyclingAwardsTable] JOIN ChildTable ON CyclingAwardsTable.ChildID = ChildTable.ChildID", "CustomerID = " + CustomerIDComboBox.Text) * 20.0f;
            dal.CloseConnection();

            // For each expense, if it is relevant display a label explaining the expense
            if (equipmentLoansPrice > 0)
            {
                AddExpensesLabel("Charge for Hiring Equipment: £" + Program.ToCurrency(equipmentLoansPrice));
            }
            if (sightseeingBusPrice > 0)
            {
                AddExpensesLabel("Charge for Sightseeing Trip(s): £" + Program.ToCurrency(sightseeingBusPrice));
            }
            if (cyclingTourPrice > 0)
            {
                AddExpensesLabel("Charge for Cycling Tour(s): £" + Program.ToCurrency(cyclingTourPrice));
            }
            if (cyclingLessonPrice > 0)
            {
                AddExpensesLabel("Charge for Cycling Lesson(s): £" + Program.ToCurrency(cyclingLessonPrice));
            }
            if (cyclingCertificationPrice > 0)
            {
                AddExpensesLabel("Charge for Cycling Certification(s): £" + Program.ToCurrency(cyclingCertificationPrice));
            }
            if (cyclingAwardPrice > 0)
            {
                AddExpensesLabel("Charge for Cycling Award(s): £" + Program.ToCurrency(cyclingAwardPrice));
            }

            //Set the chosen customer name and id straight from the SuggestiveTextBox and ComboBox
            CustomerNameLabel.Text = "Customer Name: " + customerName;
            CustomerIDLabel.Text = "Customer ID: " + CustomerIDComboBox.Text + "";
            try
            {
                BookingIDLabel.Text = "Booking ID: " + bookingResults.GetData<int>(0, 0); // Retrieve and display the bookingID
            }
            catch (Exception e)
            {
                Console.WriteLine("No data found for this customer. Check "); // Should never be called.
            }

            // Sum all of the prices to give a total price
            float totalPrice = equipmentLoansPrice + sightseeingBusPrice + cyclingTourPrice + cyclingLessonPrice + cyclingCertificationPrice + cyclingAwardPrice;

            TotalPriceLabel.Text = "Total Price: £" + Program.ToCurrency(totalPrice);
        }
开发者ID:StefanKennedy,项目名称:NorthCoast,代码行数:59,代码来源:InvoiceReportForm.cs


示例7: FromResultSet

 internal static MessagePagingInfo FromResultSet(ResultSet resultSet)
 {
     return new MessagePagingInfo
         {
             PagingCookig = resultSet.PagingCookie,
             HasMoreRecords = Convert.ToBoolean(resultSet.MoreRecords, CultureInfo.InvariantCulture)
         };
 }
开发者ID:snugglesftw,项目名称:Crm,代码行数:8,代码来源:MessagePagingInfo.cs


示例8: CancelBookingButton_Click

 // When the cancel booking button is pressed
 private void CancelBookingButton_Click(object sender, EventArgs e)
 {
     bookingDAL.MoveBookingToHistory(bookingID); // Move the cancelled booking to history
     bookingResults = UpdateResultSet("[dbo].[BookingTable]");
     UpdateDisplayedResults(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.Text = ""; // Reset the display to show all booking still not cancelled
     ShowRecord(0);
 }
开发者ID:StefanKennedy,项目名称:NorthCoast,代码行数:9,代码来源:CancelBookingForm.cs


示例9: CampingBookingsHistoryReport_Click

 private void CampingBookingsHistoryReport_Click(object sender, EventArgs e)
 {
     ResultSet rs = new ResultSet(dal.GetDataReader("BookingHistoryTable JOIN CustomerTable ON BookingHistoryTable.CustomerID = CustomerTable.CustomerID", "1=1", "BookingID, CustomerTable.CustomerID, CustomerName, StartDate, GroupSize, PricePerNight, TotalPrice, NightsStayed"));
     ReportForm reportForm = new ReportForm(rs, "Booking ID", "Customer ID", "Customer Name", "Start Date", "Group Size", "Price per Night", "Total Price", "Nights Stayed");
     reportForm.SetFormTitle("Booking History Report");
     reportForm.SetDateFilterColumn(3);
     OpenForm(reportForm);
 }
开发者ID:StefanKennedy,项目名称:NorthCoast,代码行数:8,代码来源:MainMenuForm.cs


示例10: Map

		public static ResultSet Map(DbDataReader dr) {
			int numberOfColumns = dr.FieldCount;
			string[] colNames = GetColumnNames(dr, numberOfColumns);
			var table = new ResultSet(colNames);
			while (dr.Read()) {
				MapRow(dr, numberOfColumns, table);
			}
			return table;
		}
开发者ID:SharpTools,项目名称:sharpdata,代码行数:9,代码来源:DataReaderToResultSetMapper.cs


示例11: ExecuteReader

 public DataReader ExecuteReader()
 {
     var cursor = MongoConnection.MongoDatabase.GetCollection(CollectionName).FindAll();            
     Result result = new Result(cursor);
     ResultSet resultSet = new ResultSet();
     resultSet.Add(result);
     DataReader reader = new DataReader(resultSet);
     return reader;
 }
开发者ID:mdcuesta,项目名称:anito.net,代码行数:9,代码来源:Command.cs


示例12: Yahoo_PlaceFinder_ResultSetQualityCategory_ShouldBeArea_WhenQualityIsLessThan70

        public void Yahoo_PlaceFinder_ResultSetQualityCategory_ShouldBeArea_WhenQualityIsLessThan70()
        {
            var model = new ResultSet
            {
                Quality = 69,
            };

            model.QualityCategory().ShouldEqual(QualityCategory.Area);
        }
开发者ID:eastlands,项目名称:NGeo,代码行数:9,代码来源:QualityExtensionsTests.cs


示例13: Item

 /// <summary>
 /// Create a new Item with a result set from the database
 /// </summary>
 /// <param name="set"></param>
 public Item(ResultSet set)
 {
     this.Id = set.Read<Int32>("ItemId");
     this.CreatorId = set.Read<Int32>("CreatorId");
     this.Slot = (Byte)set.Read<Int32>("Slot");
     this.Quantity = (UInt32)set.Read<Int32>("Quantity");
     this.Equiped = set.Read<Boolean>("Equiped");
     Attributes = new Byte[17];
     Attributes[0] = 0x40;
 }
开发者ID:Eastrall,项目名称:Meteor,代码行数:14,代码来源:Item.cs


示例14: ResultSetToStringArrayList

 /// <summary>
 /// Gets the result set as list of string arrays.
 /// </summary>
 /// <param name="resultSet">The result set to convert to a string array list.</param>
 /// <returns>A list of string arrays representing the result set.</returns>
 public static List<String[]> ResultSetToStringArrayList(ResultSet resultSet) {
   List<string[]> stringArrayList = new List<string[]>();
   stringArrayList.Add(GetColumnLabels(resultSet));
   if (resultSet.rows != null) {
     foreach (Row row in resultSet.rows) {
       stringArrayList.Add(GetRowStringValues(row));
     }
   }
   return stringArrayList;
 }
开发者ID:markgmarkg,项目名称:googleads-dotnet-lib,代码行数:15,代码来源:PqlUtilities.cs


示例15: Handle

      internal void Handle(GetTrafficEvents input) {
         var output = new ResultSet<TrafficEvent>();

         BplCollection<TrafficEventInfo> dbEvents;

         using (var dbConn = DatabaseManager.DbConn()) {
            if ((input.Region == null) || (input.Region.IsEmpty)) {
               dbEvents = dbConn.ExecuteBpl(new TrafficEventGetByOperator { Operator = input.Operator });
            } else {
               dbEvents = dbConn.ExecuteBpl(
                  new TrafficEventGetByOperatorRegion {
                     Operator = input.Operator,
                     North = input.Region.North,
                     South = input.Region.South,
                     West = input.Region.West,
                     East = input.Region.East
                  });
            }

            foreach (var ei in dbEvents) {
               var oe = new Mpcr.Model.Vehicles.TrafficEvent();

               oe.Id = ei.EventId;
               oe.Codes = ei.Codes;
               oe.Direction = ei.Direction;
               oe.Extent = ei.Extent;
               oe.IsTwoWay = ei.IsTwoWay;

               oe.Origin = new TrafficLocation();
               oe.Origin.LocationCode = ei.OriginLocationCode;
               oe.Origin.CountryCode = ei.OriginCountryCode;
               oe.Origin.LocationTableNumber = ei.OriginLocationTableNumber;
               oe.Origin.Location = ei.OriginLocation;

               if (ei.DestinationLocation != ei.OriginLocation) {
                  oe.Destination = new TrafficLocation();
                  oe.Destination.LocationCode = ei.DestinationLocationCode;
                  oe.Destination.CountryCode = ei.DestinationCountryCode;
                  oe.Destination.LocationTableNumber = ei.DestinationLocationTableNumber;
                  oe.Destination.Location = ei.DestinationLocation;
               }

               oe.ApproximatedDelay = ei.ApproximatedDelay;
               oe.ApproximatedSpeed = ei.ApproximatedSpeed;
               oe.LastUpdate = ei.LastUpdate.DateTime;
               oe.Length = ei.Length;
               oe.Load = ei.Load;

               output.result.Add(oe);
            }
         }

         Reply(output);
      }
开发者ID:borkaborka,项目名称:gmit,代码行数:54,代码来源:GetTrafficEvents.cs


示例16: BuildResultSet

        public ResultSet BuildResultSet(SqlQuery query, IEnumerable<Entity> entities)
        {
            var entityType = Type.GetType(String.Format("{0}.{1}", typeof(Entity).Namespace, query.Entity), true, true);
            var columnHeaders = GetColumnHeaders(query, entityType);

            var set = new ResultSet(columnHeaders);
            foreach (var entity in entities)
                set.Add(BuildResultSetRow(columnHeaders, entity).ToList());

            return set;
        }
开发者ID:erikdietrich,项目名称:AutotaskQueryExplorer,代码行数:11,代码来源:ResultSetBuilder.cs


示例17: Setup

		public void Setup()
		{
			_repository = new MemoryRepository<TestItem>();
			_results = new List<RecordToken<TestItem>>();

			_results.Add(new RecordToken<TestItem>(_repository, new TestRepositoryId(8)));
			_results.Add(new RecordToken<TestItem>(_repository, new TestRepositoryId(12)));
			_results.Add(new RecordToken<TestItem>(_repository, new TestRepositoryId(1)));
			_results.Add(new RecordToken<TestItem>(_repository, new TestRepositoryId(3)));

			_resultSet = new ResultSet<TestItem>(_repository, _results);
		}
开发者ID:bbriggs,项目名称:wesay,代码行数:12,代码来源:ResultSetTests.cs


示例18: Setup

		public void Setup()
		{
			_dataMapper = new MemoryDataMapper<PalasoTestItem>();
			_results = new List<RecordToken<PalasoTestItem>>();

			_results.Add(new RecordToken<PalasoTestItem>(_dataMapper, new TestRepositoryId(8)));
			_results.Add(new RecordToken<PalasoTestItem>(_dataMapper, new TestRepositoryId(12)));
			_results.Add(new RecordToken<PalasoTestItem>(_dataMapper, new TestRepositoryId(1)));
			_results.Add(new RecordToken<PalasoTestItem>(_dataMapper, new TestRepositoryId(3)));

			_resultSet = new ResultSet<PalasoTestItem>(_dataMapper, _results);
		}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:12,代码来源:ResultSetTests.cs


示例19: Fill

 void Fill(ResultSet resultSet)
 {
     foreach (var result in resultSet.Results)
     {
         if ((result.SdkMessageId != Guid.Empty) && !MessageCollection.ContainsKey(result.SdkMessageId))
         {
             var message = new SdkMessage(result.SdkMessageId, result.Name, result.IsPrivate);
             MessageCollection.Add(result.SdkMessageId, message);
         }
         MessageCollection[result.SdkMessageId].Fill(result);
     }
 }
开发者ID:snugglesftw,项目名称:Crm,代码行数:12,代码来源:SdkMessages.cs


示例20: Handle

      internal void Handle(GetDiagnosticsTasks input) {
         var result = new ResultSet<DiagnosticsTask>();

         using (var dbConn = DatabaseManager.DbConn()) {
            var dtasks = dbConn.ExecuteBpl(new DiagnosticsTaskDeviceGetByDeviceId { DeviceId = input.DeviceId });
            foreach (var dtask in dtasks) {
               result.result.Add(dtask.ToDiagnosticsTask());
            }
         }

         Reply(result.result);
      }
开发者ID:borkaborka,项目名称:gmit,代码行数:12,代码来源:GetDiagnosticsTasks.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ResultState类代码示例发布时间:2022-05-24
下一篇:
C# ResultPoint类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap