public void Copy(TAppOrderItem item) { DishId = item.DishId; Id = item.Id; DishName = item.DishName; Price = item.Price; Amount = item.Amount; Text = item.Text; Order = item.Order; }
protected void Button1_Click(object sender, EventArgs e) { //insert one item into the order // <asp:Parameter Name="sessionid" Type="Int32" /> // <asp:Parameter Name="item" Type="Object" /> RestaurantApp.TAppOrderItem item = new RestaurantApp.TAppOrderItem(); item.DishName = " fried rice"; //RestaurantApp.OrderObj.insertOrderItem((int)Session["SessionID"], item); form1.DataBind(); }
public void ChipIn1For5() { int count = Items.Count; for (int i = 0; i < count; i++) { int chipIn = ((int)Items[i].Amount) / 5; if (chipIn > 0) { TAppOrderItem chipInItem = new TAppOrderItem(); chipInItem.Copy(Items[i]); chipInItem.Amount = chipIn; chipInItem.Price = 0; Items.Add(chipInItem); } } }