本文整理汇总了C#中Order.Find方法的典型用法代码示例。如果您正苦于以下问题:C# Order.Find方法的具体用法?C# Order.Find怎么用?C# Order.Find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Order
的用法示例。
在下文中一共展示了Order.Find方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PayTest
public void PayTest()
{
Order target = new Order();
string name = "hj ahmad bin abdul halim";
Order expected = target.Find(name);
expected.Status = TransactionStage.Pay;
expected.Save();
Order actual = target.Find(name);
Assert.AreEqual(expected.Status, actual.Status);
}
示例2: FindTest
public void FindTest()
{
Order target = new Order();
string name = "Ramli13 bin Taib";
Order actual = target.Find(name);
Assert.IsNotNull(actual);
Assert.AreEqual(name, (actual.Stock as Nisan).Name);
}
示例3: FindOrderByCustomerTest
public void FindOrderByCustomerTest()
{
Order target = new Order();
string name = "Ramli89 bin Taib";
Order actual = target.Find(name);
Assert.IsNotNull(actual);
Assert.AreEqual(name, (actual.Stock as Nisan).Name);
Assert.AreEqual("[email protected]", actual.Customer.Email,"It is direct ordered by a customer");
}
示例4: FindOrderByAgentTest
public void FindOrderByAgentTest()
{
Order target = new Order();
string name = "Che Som58 bin Said";
Order actual = target.Find(name);
Assert.IsNotNull(actual);
Assert.AreEqual(name, (actual.Stock as Nisan).Name);
Assert.AreEqual("W002", actual.Agent.Code, "It is under agent W002");
}
示例5: FindNisanCheNahBtAbdullahTest
public void FindNisanCheNahBtAbdullahTest()
{
Order target = new Order();
string name = "che nah bt abdullah";
Order actual = target.Find(name);
Assert.IsNotNull(actual);
Assert.AreEqual(name, (actual.Stock as Nisan).Name);
Assert.AreEqual("W002", actual.Agent.Code, "It is under agent W002");
}
示例6: LoadOrder
private void LoadOrder(string name)
{
order = new Order();
order = order.Find(name);
if (order == null) return;
if ((order.Stock as Nisan) == null) return;
imgStatus.ImageUrl = string.Format("Images/{0}.png", order.Status.ToString().ToLower());
Nisan nisan = order.Stock as Nisan;
ddlStock.SelectedValue = new Stock(order.Stock.Type).Id.ToString();//todo: why not just order.Stock.Id
txtName.Text = nisan.Name;
txtJawi.Text = nisan.Jawi;
txtDeath.Text = nisan.Death.ToString("dd/MM/yyyy");
ddlDay.Text = nisan.Deathm.Day.ToString();
ddlMonth.SelectedIndex = nisan.Deathm.Month - 1;
txtYear.Text = nisan.Deathm.Year.ToString();
txtRemarks.Text = nisan.Remarks;
if (order.Agent == null)
{
txtAgent.Text = string.Empty;
lblAgent.Text = string.Empty;
}
else
{
txtAgent.Text = order.Agent.Code;
lblAgent.Text = order.Agent.Name;
//define customer field first
//if contains customer it will be overwrite later
txtCustomer.Text = order.Agent.Name;
txtEmail.Text = order.Agent.Email;
txtPhone.Text = order.Agent.Phone;
}
if (order.Customer != null)
{
txtCustomer.Text = order.Customer.Name;
txtEmail.Text = order.Customer.Email;
txtPhone.Text = order.Customer.Phone;
}
if (order.ShipTo != null)
{
txtAddress.Text = order.ShipTo.Street;
txtPostal.Text = order.ShipTo.Postal;
ddlState.SelectedValue = order.ShipTo.State;
}
EnableForm(false);
btnSubmit.Visible = false;
}