本文整理汇总了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);
}
示例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 ();
}
示例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());
//.........这里部分代码省略.........
示例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"));
}
}
示例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;
}