Пример #1
0
 public UctChooseFood(DictionaryDataSet.OrderDetailRow itemRow)
 {
     InitializeComponent();
     if (itemRow != null)
     {
         OrderDetailRow = itemRow;
     }
 }
Пример #2
0
        /// <summary>
        /// Load món ăn
        /// </summary>
        /// <param name="inventoryItem"></param>
        /// <returns></returns>
        private UctChooseFood CreateUctChooseFoodByOrderDetail(DictionaryDataSet.OrderDetailRow orderDetail)
        {
            var uct = new UctChooseFood(orderDetail);

            uct.Click           += ChooseFood_Click;
            uct.CalculateAmount += new EventHandler(CalculateAmount);
            if (!IsSendKitchen && uct.IsSendKitchen)
            {
                IsSendKitchen = true;
            }
            return(uct);
        }
Пример #3
0
 public DataRow InitNewRowDetail(DictionaryDataSet.OrderDetailDataTable table, DictionaryDataSet.OrderRow master, Guid inventoryItemID)
 {
     DictionaryDataSet.OrderDetailRow drNewRow = table.NewOrderDetailRow();
     drNewRow.OrderDetailID     = Guid.NewGuid();
     drNewRow.OrderID           = master.OrderID;
     drNewRow.InventoryItemID   = inventoryItemID;
     drNewRow.Quantity          = 1;
     drNewRow.SortOrder         = table.Rows.Count + 1;
     drNewRow.CookedQuantity    = 0;
     drNewRow.ServedQuantity    = 0;
     drNewRow.ServedQuantity    = 0;
     drNewRow.CookingQuantity   = 0;
     drNewRow.OrderDetailStatus = 0;
     table.Rows.InsertAt(drNewRow, 0);
     return(drNewRow);
 }
Пример #4
0
        /// <summary>
        /// Thêm mới món ăn
        /// </summary>
        /// <param name="inventoryItem"></param>
        /// <returns></returns>
        private UctChooseFood CreateUctChooseFood(DictionaryDataSet.InventoryItemRow inventoryItem)
        {
            DictionaryDataSet.OrderRow master = (DictionaryDataSet.OrderRow)dsDictionary.Order.FindByOrderID(OrderID);
            var row = dsDictionary.OrderDetail.FirstOrDefault((t) => t.RowState != DataRowState.Deleted && t.InventoryItemID == inventoryItem.InventoryItemID && t.OrderDetailStatus == (int)EnumOrderDetailStatus.Ordering);

            if (row != null)
            {
                row.Quantity += 1;
                return(null);
            }
            else
            {
                DictionaryDataSet.OrderDetailRow orderDetail = (DictionaryDataSet.OrderDetailRow)_oBL.InitNewRowDetail(dsDictionary.OrderDetail, master, inventoryItem.InventoryItemID);
                var uct = new UctChooseFood(orderDetail);
                uct.Click           += ChooseFood_Click;
                uct.CalculateAmount += new EventHandler(CalculateAmount);
                return(uct);
            }
        }