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

C# TList类代码示例

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

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



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

示例1: Process

		public static void Process (TList<EmailMessage> list)
		{			
			if ( list != null)
			{
                if (list.Count > 0)
                    ProcessFailureProvider.Instance().Process(list);
			}
		}
开发者ID:chibuk,项目名称:krooe,代码行数:8,代码来源:ProcessFailure.cs


示例2: Bind

        /// <summary>
        /// Bind control
        /// </summary>
        public void Bind(TList<Cart> cart)
        {
            if (cart != null)
            {
                repOrdered.DataSource = cart;
                repOrdered.DataBind();
            }

        }
开发者ID:netTiers,项目名称:netTiers,代码行数:12,代码来源:CartList.ascx.cs


示例3: Main

        static void Main(string[] args)
        {
            int A = 0;

            Console.Write("Podaj ilosc liczb A: ");
            A = int.Parse(Console.ReadLine());
            Console.Write("Podaj max wartosc M: ");
            int M = int.Parse(Console.ReadLine());
            Heap<int> heap = new Heap<int>(A);
            TList<int> list = new TList<int>();

            Console.Write("Podaj ilosc liczb B: ");
            int B = int.Parse(Console.ReadLine());
            Console.Write("Podaj max wartosc N: ");
            int N = int.Parse(Console.ReadLine());

            Random r = new Random(DateTime.Now.Millisecond);
            Console.WriteLine("Kopiec :)");
            var time = Stopwatch.StartNew();
            for(var i=A;i>0;i--)
            {
                var tmp = r.Next(0, M);
                heap.Push(tmp,tmp);
            }
            for(var i= B;i>0;i--)
            {
                var tmp = r.Next(0, N);
                heap.DeleteMax();
                heap.Push(tmp,tmp);
            }
            time.Stop();
            var timeMs = time.ElapsedMilliseconds;
            Console.WriteLine("Uplynelo {0} ms", timeMs);
            Console.ReadLine();

            Console.WriteLine("Lista :(");
            time = Stopwatch.StartNew();
            for (var i = A; i > 0; i--)
            {
                var tmp = r.Next(0, M);
                list.Push(tmp,tmp);
            }
            for (var i = B; i > 0; i--)
            {
                list.DeleteAt(list.MinIndex());
                var tmp = r.Next(0, N);
                list.Push(tmp, tmp);
            }
            time.Stop();
            timeMs = time.ElapsedMilliseconds;
            Console.WriteLine("Uplynelo {0} ms", timeMs);
            Console.ReadLine();
        }
开发者ID:aisdecentralatel,项目名称:aisdecentrala_repo,代码行数:53,代码来源:Program.cs


示例4: CreateMockInstance_Generated

        ///<summary>
        ///  Returns a Typed Region Entity with mock values.
        ///</summary>
        public static Region CreateMockInstance_Generated(TransactionManager tm)
        {
            Region mock = new Region();

            mock.RegionId = TestUtility.Instance.RandomNumber();
            mock.RegionDescription = TestUtility.Instance.RandomString(24, false);;

            // create a temporary collection and add the item to it
            TList<Region> tempMockCollection = new TList<Region>();
            tempMockCollection.Add(mock);
            tempMockCollection.Remove(mock);

               return (Region)mock;
        }
开发者ID:jdaigle,项目名称:nettiers,代码行数:17,代码来源:RegionTest.generated.cs


示例5: Recieve

        public override TList<EmailMessage> Recieve( )
		{
            //
            TList<EmailMessage> list = new TList<EmailMessage>();

            string connectionString = ConfigurationManager.ConnectionStrings["SmartMassEmailConnectionString2005"].ConnectionString;
            string queueSchema = "dbo";
            string queueName = "SMEPostQueue";

            // Create the connection and service objects.
            //
            SqlConnection conn = new SqlConnection(connectionString);
            GroupCommitService service = new GroupCommitService(
                conn, queueSchema, queueName);

            // Time interval to wait for messages to arrive on a queue before giving up
            // and returning from the receive loop.
            //
            service.QueueEmptyTimeout = TimeSpan.FromSeconds(10);


            // Time interval to receive additional batches of messages (i.e. lock
            // additional conversation group) from the time we receive first set
            // of messages.
            //
            service.GroupCommitTimeout = TimeSpan.FromSeconds(3);

            // At most we are willing to lock 5 conversation (groups) in a single
            // transaction.
            //
            service.ReceivesPerTransaction = 5;

            try
            {
                conn.Open();

                // Loop to receive and process incoming messages.
                //
                list = service.Run();

                conn.Close();
            }
            catch (SqlException se)
            {
                Console.Error.WriteLine("Exception thrown by SqlClient: {0}", se.Message);
            }
           
            return list;
		}
开发者ID:chibuk,项目名称:krooe,代码行数:49,代码来源:Sql2005EmailDeQueueProvider.cs


示例6: CreateMockInstance_Generated

        ///<summary>
        ///  Returns a Typed Categories Entity with mock values.
        ///</summary>
        public static Categories CreateMockInstance_Generated(TransactionManager tm)
        {
            Categories mock = new Categories();

            mock.CategoryName = TestUtility.Instance.RandomString(6, false);;
            mock.Description = TestUtility.Instance.RandomString(2, false);;
            mock.Picture = new byte[] { TestUtility.Instance.RandomByte() };

            // create a temporary collection and add the item to it
            TList<Categories> tempMockCollection = new TList<Categories>();
            tempMockCollection.Add(mock);
            tempMockCollection.Remove(mock);

               return (Categories)mock;
        }
开发者ID:jdaigle,项目名称:nettiers,代码行数:18,代码来源:CategoriesTest.generated.cs


示例7: AttributeConversion

 /// <summary>
 /// 法宝技能——属性转换
 /// </summary>
 /// <param name="userID"></param>
 /// <returns></returns>
 public static TList<GeneralProperty> AttributeConversion(string userID, decimal powerNum, decimal soulNum, decimal intellectNum)
 {
     decimal changeNum = 0;
     TList<GeneralProperty> propertyList = new TList<GeneralProperty>();
     UserGeneral general = UserGeneral.GetMainGeneral(userID);
     if (general == null)
     {
         return propertyList;
     }
     UserTrump userTrump = new GameDataCacheSet<UserTrump>().FindKey(userID, TrumpInfo.CurrTrumpID);
     if (userTrump != null && userTrump.LiftNum > 0 && userTrump.SkillInfo.Count > 0)
     {
         foreach (SkillInfo skillInfo in userTrump.SkillInfo)
         {
             AbilityInfo abilityInfo = new ConfigCacheSet<AbilityInfo>().FindKey(skillInfo.AbilityID);
             if (abilityInfo != null && abilityInfo.AttackType == AttackType.Change)
             {
                 SkillLvInfo skillLvInfo = new ConfigCacheSet<SkillLvInfo>().FindKey(skillInfo.AbilityID, skillInfo.AbilityLv);
                 if (skillLvInfo == null)
                 {
                     break;
                 }
                 switch (abilityInfo.ChangeAbility)
                 {
                     case AbilityType.PowerNum:
                         changeNum = powerNum;
                         break;
                     case AbilityType.SoulNum:
                         changeNum = soulNum;
                         break;
                     case AbilityType.IntelligenceNum:
                         changeNum = intellectNum;
                         break;
                     default:
                         changeNum = 0;
                         break;
                 }
                 GeneralProperty property = new GeneralProperty();
                 property.AbilityType = abilityInfo.AfterAbility;
                 property.AbilityValue = changeNum * skillLvInfo.Coefficient;
                 propertyList.Add(property);
             }
         }
     }
     return propertyList;
 }
开发者ID:rongxiong,项目名称:Scut,代码行数:51,代码来源:TrumpAbilityAttack.cs


示例8: validateUser

 public Customers validateUser(string Email, string Password)
 {
     TList<Customers> objcust = new TList<Customers>();
     Email.Trim();
     Password.Trim();
     //string whereclaus = CustomersColumn.EmailId + " LIKE '" + SearchPanel1.Username + "%'  and Usertype=7";
     //string whereclaus = CustomersColumn.EmailId + " LIKE '" + username + "%' and "+CustomersColumn.Password+ "='" + Password + "' and " +CustomersColumn.IsActive +"=1";
     string whereclaus = CustomersColumn.EmailId + " ='" + Email + "' and " + CustomersColumn.Password + "='" + Password + "' and " + CustomersColumn.IsActive + "=1";
     int Total = 0;
     string orderby = string.Empty;
     objcust = DataRepository.CustomersProvider.GetPaged(whereclaus, orderby, 0, int.MaxValue, out Total);
     //DataRepository.CustomersProvider.DeepLoad(objcust, true);
     if ((objcust != null) && (objcust.Count > 0))
     {
         return objcust.First();
     }
     return null;
 }
开发者ID:pratik1988,项目名称:VedicKart,代码行数:18,代码来源:AccountValidation.cs


示例9: SaveOrderLineItems

        /// <summary>
        /// Saves the new order line items
        /// </summary>
        /// <param name="orderId">The order id of the item</param>
	    /// <param name="cartItems">The cart items</param>
	    public void SaveOrderLineItems(int orderId, TList<Cart> cartItems)
	    {
            var lineItemService = new LineItemService();
            var lineNum = 0;

            foreach (var item in cartItems)
            {
                var lineItem = new LineItem
                                   {
                                       OrderId = orderId,
                                       ItemId = item.ItemId,
                                       LineNum = ++lineNum,
                                       Quantity = item.Quantity,
                                       UnitPrice = item.Price
                                   };

                lineItemService.Save(lineItem);
            }

	    }
开发者ID:netTiers,项目名称:netTiers,代码行数:25,代码来源:CartService.cs


示例10: CreateMockInstance_Generated

        ///<summary>
        ///  Returns a Typed CustomerCustomerDemo Entity with mock values.
        ///</summary>
        public static CustomerCustomerDemo CreateMockInstance_Generated(TransactionManager tm)
        {
            CustomerCustomerDemo mock = new CustomerCustomerDemo();

            //OneToOneRelationship
            CustomerDemographics mockCustomerDemographicsByCustomerTypeId = CustomerDemographicsTest.CreateMockInstance(tm);
            DataRepository.CustomerDemographicsProvider.Insert(tm, mockCustomerDemographicsByCustomerTypeId);
            mock.CustomerTypeId = mockCustomerDemographicsByCustomerTypeId.CustomerTypeId;
            //OneToOneRelationship
            Customers mockCustomersByCustomerId = CustomersTest.CreateMockInstance(tm);
            DataRepository.CustomersProvider.Insert(tm, mockCustomersByCustomerId);
            mock.CustomerId = mockCustomersByCustomerId.CustomerId;

            // create a temporary collection and add the item to it
            TList<CustomerCustomerDemo> tempMockCollection = new TList<CustomerCustomerDemo>();
            tempMockCollection.Add(mock);
            tempMockCollection.Remove(mock);

               return (CustomerCustomerDemo)mock;
        }
开发者ID:jdaigle,项目名称:nettiers,代码行数:23,代码来源:CustomerCustomerDemoTest.generated.cs


示例11: Main

        internal static void Main()
        {
            //// adding element + AutoGrow()
            TList<int> somelist = new TList<int>(2);
            somelist.Add(1);
            somelist.Add(2);
            somelist.Add(3);

            //// removing element by index
            somelist.RemoveAt(1);

            //// inserting element at given position
            somelist.InsertAt(0, 0);

            //// accessing element by index (I feel so sleepy that I dont't see 2)
            for (int i = 0; i < somelist.Count; i++)
            {
                Console.WriteLine(somelist[i]);
            }

            //// finding element by its value
            Console.WriteLine(somelist.Contains(3));

            ////ToString override
            Console.WriteLine(somelist.ToString());

            //// Min and max value
            int minValue = somelist.Min();
            int maxValue = somelist.Max();

            Console.WriteLine("MinValue = {0}\nMaxValue = {1}\n", minValue, maxValue);

            ////Clear list - List is empty & nothing is printed
            somelist.Clear();
            for (int i = 0; i < somelist.Count; i++)
            {
                Console.WriteLine(somelist[i]);
            }
        }
开发者ID:rusekov,项目名称:HomeWorksOOP,代码行数:39,代码来源:TestList_Main.cs


示例12: Process

        public override void Process(TList<EmailMessage> list )
		{
            //            
            //
            foreach (EmailMessage em in list)
            {
                
                if (em.NumberOfRetry < em.MaximumRetry)
                {
                    em.Status = (int)EmailMessage.EmailMessageStatus.Pending;
                    em.NumberOfRetry = em.NumberOfRetry + 1;
                    //ReTry again after 10 min
                    em.RetryTime = em.RetryTime.AddMinutes(10);
                    DataRepository.EmailMessageProvider.Update(em);
                }
                else 
                {
                    //Delete the Message
                    DataRepository.EmailMessageProvider.Delete(em);
                }
            }
		}
开发者ID:chibuk,项目名称:krooe,代码行数:22,代码来源:Sql2000ProcessFailureProvider.cs


示例13: CreateMockInstance_Generated

        ///<summary>
        ///  Returns a Typed Suppliers Entity with mock values.
        ///</summary>
        public static Suppliers CreateMockInstance_Generated(TransactionManager tm)
        {
            Suppliers mock = new Suppliers();

            mock.CompanyName = TestUtility.Instance.RandomString(19, false);;
            mock.ContactName = TestUtility.Instance.RandomString(14, false);;
            mock.ContactTitle = TestUtility.Instance.RandomString(14, false);;
            mock.Address = TestUtility.Instance.RandomString(29, false);;
            mock.City = TestUtility.Instance.RandomString(6, false);;
            mock.Region = TestUtility.Instance.RandomString(6, false);;
            mock.PostalCode = TestUtility.Instance.RandomString(10, false);;
            mock.Country = TestUtility.Instance.RandomString(6, false);;
            mock.Phone = TestUtility.Instance.RandomString(11, false);;
            mock.Fax = TestUtility.Instance.RandomString(11, false);;
            mock.HomePage = TestUtility.Instance.RandomString(2, false);;

            // create a temporary collection and add the item to it
            TList<Suppliers> tempMockCollection = new TList<Suppliers>();
            tempMockCollection.Add(mock);
            tempMockCollection.Remove(mock);

               return (Suppliers)mock;
        }
开发者ID:jdaigle,项目名称:nettiers,代码行数:26,代码来源:SuppliersTest.generated.cs


示例14: CreateMockInstance_Generated

        ///<summary>
        ///  Returns a Typed Territories Entity with mock values.
        ///</summary>
        public static Territories CreateMockInstance_Generated(TransactionManager tm)
        {
            Territories mock = new Territories();

            mock.TerritoryId = TestUtility.Instance.RandomString(9, false);;
            mock.TerritoryDescription = TestUtility.Instance.RandomString(24, false);;

            int count0 = 0;
            TList<Region> _collection0 = DataRepository.RegionProvider.GetPaged(tm, 0, 10, out count0);
            //_collection0.Shuffle();
            if (_collection0.Count > 0)
            {
                mock.RegionId = _collection0[0].RegionId;

            }

            // create a temporary collection and add the item to it
            TList<Territories> tempMockCollection = new TList<Territories>();
            tempMockCollection.Add(mock);
            tempMockCollection.Remove(mock);

               return (Territories)mock;
        }
开发者ID:jdaigle,项目名称:nettiers,代码行数:26,代码来源:TerritoriesTest.generated.cs


示例15: CreateMockInstance_Generated

        ///<summary>
        ///  Returns a Typed Employees Entity with mock values.
        ///</summary>
        public static Employees CreateMockInstance_Generated(TransactionManager tm)
        {
            Employees mock = new Employees();

            mock.LastName = TestUtility.Instance.RandomString(9, false);;
            mock.FirstName = TestUtility.Instance.RandomString(10, false);;
            mock.Title = TestUtility.Instance.RandomString(14, false);;
            mock.TitleOfCourtesy = TestUtility.Instance.RandomString(11, false);;
            mock.BirthDate = TestUtility.Instance.RandomDateTime();
            mock.HireDate = TestUtility.Instance.RandomDateTime();
            mock.Address = TestUtility.Instance.RandomString(29, false);;
            mock.City = TestUtility.Instance.RandomString(6, false);;
            mock.Region = TestUtility.Instance.RandomString(6, false);;
            mock.PostalCode = TestUtility.Instance.RandomString(10, false);;
            mock.Country = TestUtility.Instance.RandomString(6, false);;
            mock.HomePhone = TestUtility.Instance.RandomString(11, false);;
            mock.Extension = TestUtility.Instance.RandomString(4, false);;
            mock.Photo = new byte[] { TestUtility.Instance.RandomByte() };
            mock.Notes = TestUtility.Instance.RandomString(2, false);;
            mock.PhotoPath = TestUtility.Instance.RandomString(126, false);;

            int count0 = 0;
            TList<Employees> _collection0 = DataRepository.EmployeesProvider.GetPaged(tm, 0, 10, out count0);
            //_collection0.Shuffle();
            if (_collection0.Count > 0)
            {
                mock.ReportsTo = _collection0[0].EmployeeId;

            }

            // create a temporary collection and add the item to it
            TList<Employees> tempMockCollection = new TList<Employees>();
            tempMockCollection.Add(mock);
            tempMockCollection.Remove(mock);

               return (Employees)mock;
        }
开发者ID:jdaigle,项目名称:nettiers,代码行数:40,代码来源:EmployeesTest.generated.cs


示例16: CreateMockInstance_Generated

        ///<summary>
        ///  Returns a Typed Products Entity with mock values.
        ///</summary>
        public static Products CreateMockInstance_Generated(TransactionManager tm)
        {
            Products mock = new Products();

            mock.ProductName = TestUtility.Instance.RandomString(19, false);;
            mock.QuantityPerUnit = TestUtility.Instance.RandomString(9, false);;
            mock.UnitPrice = TestUtility.Instance.RandomShort();
            mock.UnitsInStock = TestUtility.Instance.RandomShort();
            mock.UnitsOnOrder = TestUtility.Instance.RandomShort();
            mock.ReorderLevel = TestUtility.Instance.RandomShort();
            mock.Discontinued = TestUtility.Instance.RandomBoolean();

            int count0 = 0;
            TList<Categories> _collection0 = DataRepository.CategoriesProvider.GetPaged(tm, 0, 10, out count0);
            //_collection0.Shuffle();
            if (_collection0.Count > 0)
            {
                mock.CategoryId = _collection0[0].CategoryId;

            }
            int count1 = 0;
            TList<Suppliers> _collection1 = DataRepository.SuppliersProvider.GetPaged(tm, 0, 10, out count1);
            //_collection1.Shuffle();
            if (_collection1.Count > 0)
            {
                mock.SupplierId = _collection1[0].SupplierId;

            }

            // create a temporary collection and add the item to it
            TList<Products> tempMockCollection = new TList<Products>();
            tempMockCollection.Add(mock);
            tempMockCollection.Remove(mock);

               return (Products)mock;
        }
开发者ID:jdaigle,项目名称:nettiers,代码行数:39,代码来源:ProductsTest.generated.cs


示例17: rptmnctg_ItemDataBound

 protected void rptmnctg_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         ProdCategory objproddtabound = e.Item.DataItem as ProdCategory;
         LinkButton lnkmainCTG = (LinkButton)e.Item.FindControl("lnkmainCTG");
         Repeater rptsubctg = (Repeater)e.Item.FindControl("rptsubctg");
         TList<ProdSubcategory> objprodsubctglist1 = new TList<ProdSubcategory>();
         List<int> objsubctgID = new List<int>();
         objsubctgID = ObjprodClass.GetAllProdmapBymainCtgID(objproddtabound.Id);
         if (objsubctgID != null)
         {
             foreach (int a in objsubctgID)
             {
                 objprodctg = null;
                 objprodctg = ObjprodClass.GetProdSubcategoryByID(a);
                 objprodsubctglist1.Add(objprodctg);
             }
         }
         rptsubctg.DataSource = objprodsubctglist1;
         rptsubctg.DataBind();
         lnkmainCTG.Text = objproddtabound.Name;
     }
 }
开发者ID:pratik1988,项目名称:VedicKart,代码行数:24,代码来源:Header.ascx.cs


示例18: CreateMockInstance_Generated

        ///<summary>
        ///  Returns a Typed OrderDetails Entity with mock values.
        ///</summary>
        public static OrderDetails CreateMockInstance_Generated(TransactionManager tm)
        {
            OrderDetails mock = new OrderDetails();

            mock.UnitPrice = TestUtility.Instance.RandomShort();
            mock.Quantity = TestUtility.Instance.RandomShort();
            mock.Discount = (float)TestUtility.Instance.RandomNumber();

            //OneToOneRelationship
            Orders mockOrdersByOrderId = OrdersTest.CreateMockInstance(tm);
            DataRepository.OrdersProvider.Insert(tm, mockOrdersByOrderId);
            mock.OrderId = mockOrdersByOrderId.OrderId;
            //OneToOneRelationship
            Products mockProductsByProductId = ProductsTest.CreateMockInstance(tm);
            DataRepository.ProductsProvider.Insert(tm, mockProductsByProductId);
            mock.ProductId = mockProductsByProductId.ProductId;

            // create a temporary collection and add the item to it
            TList<OrderDetails> tempMockCollection = new TList<OrderDetails>();
            tempMockCollection.Add(mock);
            tempMockCollection.Remove(mock);

               return (OrderDetails)mock;
        }
开发者ID:jdaigle,项目名称:nettiers,代码行数:27,代码来源:OrderDetailsTest.generated.cs


示例19: BulkInsert

		/// <summary>
		/// Lets you efficiently bulk insert many entities to the database.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="entities">The entities.</param>
		/// <remarks>
		///		After inserting into the datasource, the Nettiers.AdventureWorks.Entities.TransactionHistory object will be updated
		/// 	to refelect any changes made by the datasource. (ie: identity or computed columns)
		/// </remarks>	
		public override void BulkInsert(TransactionManager transactionManager, TList<Nettiers.AdventureWorks.Entities.TransactionHistory> entities)
		{
			//System.Data.SqlClient.SqlBulkCopy bulkCopy = new System.Data.SqlClient.SqlBulkCopy(this._connectionString, System.Data.SqlClient.SqlBulkCopyOptions.CheckConstraints); //, null);
			
			System.Data.SqlClient.SqlBulkCopy bulkCopy = null;
	
			if (transactionManager != null && transactionManager.IsOpen)
			{			
				System.Data.SqlClient.SqlConnection cnx = transactionManager.TransactionObject.Connection as System.Data.SqlClient.SqlConnection;
				System.Data.SqlClient.SqlTransaction transaction = transactionManager.TransactionObject as System.Data.SqlClient.SqlTransaction;
				bulkCopy = new System.Data.SqlClient.SqlBulkCopy(cnx, System.Data.SqlClient.SqlBulkCopyOptions.CheckConstraints, transaction); //, null);
			}
			else
			{
				bulkCopy = new System.Data.SqlClient.SqlBulkCopy(this._connectionString, System.Data.SqlClient.SqlBulkCopyOptions.CheckConstraints); //, null);
			}
			
			bulkCopy.BulkCopyTimeout = 360;
			bulkCopy.DestinationTableName = "TransactionHistory";
			
			DataTable dataTable = new DataTable();
			DataColumn col0 = dataTable.Columns.Add("TransactionID", typeof(System.Int32));
			col0.AllowDBNull = false;		
			DataColumn col1 = dataTable.Columns.Add("ProductID", typeof(System.Int32));
			col1.AllowDBNull = false;		
			DataColumn col2 = dataTable.Columns.Add("ReferenceOrderID", typeof(System.Int32));
			col2.AllowDBNull = false;		
			DataColumn col3 = dataTable.Columns.Add("ReferenceOrderLineID", typeof(System.Int32));
			col3.AllowDBNull = false;		
			DataColumn col4 = dataTable.Columns.Add("TransactionDate", typeof(System.DateTime));
			col4.AllowDBNull = false;		
			DataColumn col5 = dataTable.Columns.Add("TransactionType", typeof(System.String));
			col5.AllowDBNull = false;		
			DataColumn col6 = dataTable.Columns.Add("Quantity", typeof(System.Int32));
			col6.AllowDBNull = false;		
			DataColumn col7 = dataTable.Columns.Add("ActualCost", typeof(System.Decimal));
			col7.AllowDBNull = false;		
			DataColumn col8 = dataTable.Columns.Add("ModifiedDate", typeof(System.DateTime));
			col8.AllowDBNull = false;		
			
			bulkCopy.ColumnMappings.Add("TransactionID", "TransactionID");
			bulkCopy.ColumnMappings.Add("ProductID", "ProductID");
			bulkCopy.ColumnMappings.Add("ReferenceOrderID", "ReferenceOrderID");
			bulkCopy.ColumnMappings.Add("ReferenceOrderLineID", "ReferenceOrderLineID");
			bulkCopy.ColumnMappings.Add("TransactionDate", "TransactionDate");
			bulkCopy.ColumnMappings.Add("TransactionType", "TransactionType");
			bulkCopy.ColumnMappings.Add("Quantity", "Quantity");
			bulkCopy.ColumnMappings.Add("ActualCost", "ActualCost");
			bulkCopy.ColumnMappings.Add("ModifiedDate", "ModifiedDate");
			
			foreach(Nettiers.AdventureWorks.Entities.TransactionHistory entity in entities)
			{
				if (entity.EntityState != EntityState.Added)
					continue;
					
				DataRow row = dataTable.NewRow();
				
					row["TransactionID"] = entity.TransactionId;
							
				
					row["ProductID"] = entity.ProductId;
							
				
					row["ReferenceOrderID"] = entity.ReferenceOrderId;
							
				
					row["ReferenceOrderLineID"] = entity.ReferenceOrderLineId;
							
				
					row["TransactionDate"] = entity.TransactionDate;
							
				
					row["TransactionType"] = entity.TransactionType;
							
				
					row["Quantity"] = entity.Quantity;
							
				
					row["ActualCost"] = entity.ActualCost;
							
				
					row["ModifiedDate"] = entity.ModifiedDate;
							
				
				dataTable.Rows.Add(row);
			}		
			
			// send the data to the server		
			bulkCopy.WriteToServer(dataTable);		
			
			// update back the state
//.........这里部分代码省略.........
开发者ID:WildGenie,项目名称:NetTiers,代码行数:101,代码来源:SqlTransactionHistoryProviderBase.generated.cs


示例20: GetByTransactionId

		/// <summary>
		/// 	Gets rows from the datasource based on the PK_TransactionHistory_TransactionID index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_transactionId">Primary key for TransactionHistory records.</param>
		/// <param name="start">Row number at which to start reading.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query.</param>
		/// <returns>Returns an instance of the <see cref="Nettiers.AdventureWorks.Entities.TransactionHistory"/> class.</returns>
		/// <remarks></remarks>
        /// <exception cref="System.Exception">The command could not be executed.</exception>
        /// <exception cref="System.Data.DataException">The <paramref name="transactionManager"/> is not open.</exception>
        /// <exception cref="System.Data.Common.DbException">The command could not be executed.</exception>
		public override Nettiers.AdventureWorks.Entities.TransactionHistory GetByTransactionId(TransactionManager transactionManager, System.Int32 _transactionId, int start, int pageLength, out int count)
		{
			SqlDatabase database = new SqlDatabase(this._connectionString);
			DbCommand commandWrapper = StoredProcedureProvider.GetCommandWrapper(database, "Production.usp_adwTiers_TransactionHistory_GetByTransactionId", _useStoredProcedure);
			
				database.AddInParameter(commandWrapper, "@TransactionId", DbType.Int32, _transactionId);
			
			IDataReader reader = null;
			TList<TransactionHistory> tmp = new TList<TransactionHistory>();
			try
			{
				//Provider Data Requesting Command Event
				OnDataRequesting(new CommandEventArgs(commandWrapper, "GetByTransactionId", tmp)); 

				if (transactionManager != null)
				{
					reader = Utility.ExecuteReader(transactionManager, commandWrapper);
				}
				else
				{
					reader = Utility.ExecuteReader(database, commandWrapper);
				}		
		
				//Create collection and fill
				Fill(reader, tmp, start, pageLength);
				count = -1;
				if(reader.NextResult())
				{
					if(reader.Read())
					{
						count = reader.GetInt32(0);
					}
				}
				
				//Provider Data Requested Command Event
				OnDataRequested(new CommandEventArgs(commandWrapper, "GetByTransactionId", tmp));
			}
			finally 
			{
				if (reader != null) 
					reader.Close();
					
				commandWrapper = null;
			}
			
			if (tmp.Count == 1)
			{
				return tmp[0];
			}
			else if (tmp.Count == 0)
			{
				return null;
			}
			else
			{
				throw new DataException("Cannot find the unique instance of the class.");
			}
			
			//return rows;
		}
开发者ID:WildGenie,项目名称:NetTiers,代码行数:73,代码来源:SqlTransactionHistoryProviderBase.generated.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# TOKEN类代码示例发布时间:2022-05-24
下一篇:
C# TKChart类代码示例发布时间: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