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


C# Product.Select方法代码示例

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


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

示例1: SaveProducts

		public Task SaveProducts(Product[] products)
		{
			var entities = products.Select(_entityConverter.Convert).ToArray();
			return _repository.UpdateProducts(entities);
		}
开发者ID:abatishchev,项目名称:ab,代码行数:5,代码来源:AzureProductProvider.cs

示例2: LaunchDocumentationUpdate

		void LaunchDocumentationUpdate (Product [] products, string informative)
		{
			var infoDialog = new NSAlert {
				AlertStyle = NSAlertStyle.Informational,
				MessageText = "Documentation update available",
				InformativeText = informative + "\n\nWarning: If you have not downloaded the documentation with Xcode, this program will download the documentation from Apple servers which can take a long time.\n\nWould you like to update the documentation now?"
			};
			
			infoDialog.AddButton ("Update now");
			infoDialog.AddButton ("Remind me later");
			var dialogResult = infoDialog.RunModal ();
			// If Cancel was clicked, just return
			if (dialogResult == (int)NSAlertButtonReturn.Second)
				return;

			var mergerTasks = products.Select (p => Task.Factory.StartNew (() => {
				var mergeToolPath = ProductUtils.GetMergeToolForProduct (p);

				var psi = new System.Diagnostics.ProcessStartInfo (mergeToolPath, null);
				return ProcessUtils.StartProcess (psi, null, null, CancellationToken.None);
			}).Unwrap ());

			// No Task.WhenAll yet
			var tcs = new TaskCompletionSource<int> ();
			Task.Factory.ContinueWhenAll (mergerTasks.ToArray (), ts => {
				var faulteds = ts.Where (t => t.IsFaulted);
				if (faulteds.Any ())
					tcs.SetException (faulteds.Select (t => t.Exception));
				else
					tcs.SetResult (ts.Select (t => t.Result).FirstOrDefault (r => r != 0));
			});

			var mergeController = new AppleDocMergeWindowController ();
			mergeController.TrackProcessTask (tcs.Task);
			mergeController.ShowWindow (this);
			mergeController.Window.Center ();
		}
开发者ID:Anomalous-Software,项目名称:monomac,代码行数:37,代码来源:AppDelegate.cs

示例3: btnSubmit_Click

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(ddlTicketBeijing.SelectedValue))
                {
                    Member m = new Member();
                    m.MemberID = this.MID;
                    m.Select();

                    // Update Current Member Info
                    m.IDCardNo = tbIDCardNo.Text.Trim();

                    #region Get Member Nation & Region
                    string _nation = ddlNation.SelectedValue;

                    if (!string.IsNullOrEmpty(_nation))
                    {
                        if (_nation.Equals("中国"))
                        {
                            m.Nation = _nation;
                            if (!string.IsNullOrEmpty(tbRegion1.Text.Trim()))
                            {
                                if (!string.IsNullOrEmpty(tbRegion2.Text.Trim()))
                                {
                                    m.Region = string.Format("{0}|{1}", tbRegion1.Text.Trim(), tbRegion2.Text.Trim());
                                }
                                else
                                {
                                    m.Region = tbRegion1.Text.Trim();
                                }
                            }
                            else
                            {
                                m.Region = string.Empty;
                            }
                        }
                        else if (!string.IsNullOrEmpty(tbNation.Text.Trim()))
                        {
                            m.Nation = tbNation.Text.Trim();
                            m.Region = string.Empty;
                        }
                        else
                        {
                            m.Nation = _nation;
                            m.Region = string.Empty;
                        }
                    }
                    else
                    {
                        m.Nation = string.Empty;
                        m.Region = string.Empty;
                    }
                    #endregion

                    m.Update();

                    //New Order
                    Order o = new Order();

                    o.MemberID = m.MemberID;
                    o.MemberName = m.Name;
                    o.Mobile = tbOrderMobile.Text.Trim();
                    o.Address = string.Empty;
                    o.Payment = "{" + rblOrderPayment.SelectedValue + "|" + tbAlipay.Text.Trim() + tbBankName.Text.Trim() + tbBankAccount.Text.Trim() + "}";
                    o.Price = 0f;
                    o.Sale = null;
                    o.Deposit = null;
                    o.Postage = 0f;
                    o.Status = OrderStatus.Draft;
                    o.Rate = 0;
                    o.CreateTime = DateTime.Now;
                    o.UpdateTime = DateTime.Now;
                    o.IsActive = true;
                    o.Description = tbOrderDescription.Text.Trim();
                    o.Remark = string.Empty;

                    //Get the Order ID after Insert new one
                    o.Insert();
                    o.Select();

                    if (o.OrderID > 0)
                    {
                        //New Order Item for Tickets
                        Product pTicketBeijing = new Product();
                        pTicketBeijing.ProductGuid = new Guid(ddlTicketBeijing.SelectedValue);
                        pTicketBeijing.Select();

                        if (pTicketBeijing == null)
                            throw new Exception("无相关商品或缺货,请联系管理员");

                        string oiRemark = string.Empty;

                        if (cbDaytimeEvent.Checked)
                            oiRemark += (" {" + cbDaytimeEvent.Text.Trim() + "}");

                        if (cbEveningEvent.Checked)
                            oiRemark += " {" + cbEveningEvent.Text.Trim() + "}";

                        OrderItem.WishOrderItem(m, pTicketBeijing, o, ddlSeatLevel.SelectedValue, Convert.ToInt32(tbQuantity.Text.Trim()), null, oiRemark.Trim());
//.........这里部分代码省略.........
开发者ID:CyranoChen,项目名称:Arsenalcn,代码行数:101,代码来源:iArsenalOrder_TicketBeijing.aspx.cs

示例4: ddlTicketBeijing_DataBound

        protected void ddlTicketBeijing_DataBound(object sender, EventArgs e)
        {
            foreach (ListItem li in (sender as DropDownList).Items)
            {
                Product p = new Product();
                p.ProductGuid = new Guid(li.Value);
                p.Select();

                li.Text = string.Format("({0}) {1} - 售价{3}元", p.Code, p.DisplayName, p.Name, Product.Cache.GetProductPriceByID(p.ProductGuid).ToString("f2"));
            }
        }
开发者ID:CyranoChen,项目名称:Arsenalcn,代码行数:11,代码来源:iArsenalOrder_TicketBeijing.aspx.cs

示例5: bindData

 private void bindData(Product[] products)
 {
     var arrDisplay = products.Select(a => new { a.Name, a.Price, a.Quantity, a.PromotionPrice, a.Promotion }).ToArray();
     gvProduct.DataSource = arrDisplay;
 }
开发者ID:hungnguyen101,项目名称:BookStoreWinform,代码行数:5,代码来源:Product.cs


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