Ejemplo n.º 1
0
        private void showOrderDetails(string orderID)
        {
            SystemManager sysManager = new SystemManager();
            List<CArchiveItemDetails> oItemList = new List<CArchiveItemDetails>();
            int p_orderID = int.Parse(orderID);
            oItemList = sysManager.GetOrderDetailInfo(p_orderID);

            DataTable dtResult = new DataTable();
            dtResult.Columns.Add("Item name", typeof(string));
            dtResult.Columns.Add("Quantity", typeof(int));
            dtResult.Columns.Add("Amount", typeof(double));
            dtResult.Columns.Add("Remarks", typeof(string));
            dtResult.Columns.Add("Food type", typeof(string));
               // dtResult.Columns.Add("Table name", typeof(string));
               // dtResult.Columns.Add("Guest no", typeof(int));
            dtResult.Columns.Add("Order time", typeof(DateTime));
            dtResult.Columns.Add("Order taken by", typeof(string));

            for (int i = 0; i < oItemList.Count; i++)
            {
                dtResult.Rows.Add(oItemList[i].ItemName,
                    oItemList[i].Quantity,
                    oItemList[i].Amount,
                    oItemList[i].Remarks,
                    oItemList[i].FoodType,
                    //oItemList[i].TableName,
                    //oItemList[i].GuestCount,
                    new DateTime(Int64.Parse(oItemList[i].ItemOrderTime.ToString())),
                    oItemList[i].UserName);
            }

            dgvOrderDetails.DataSource = dtResult;
        }