Пример #1
0
        StatusTable IOrderService.GetStatusTable(string TableID)
        {
            StatusTable st = new StatusTable();
            st.Complete = -1;

            var status = _context.ORDER_DATE.Where(x => x.FloorID == TableID && x.Status != 1 && x.Status != 4 && x.CreateDate.Year == DateTime.Now.Year && x.CreateDate.Month == DateTime.Now.Month && x.CreateDate.Day == DateTime.Now.Day).SingleOrDefault();
            if (status != null)
            {
                st.Complete = status.Status;
                st.OrderID = status.OrderID;
                st.TableID = status.FloorID.ToString();
                st.SubTotal = status.TotalAmount.ToString();
                st.Time = status.CreateDate.ToString();
                st.OrderNum = status.OrderNumber??0;
            }
            return st;
        }
Пример #2
0
 public StatusTable GetStatusTablePrinBill(string TableID)
 {
     StatusTable st = new StatusTable();
     try
     {
         st.Complete = -1;
         var status = _context.ORDER_DATE.Where(x => x.FloorID == TableID && x.Status != 1 && x.Status != 4 && x.CreateDate.Year==DateTime.Now.Year && x.CreateDate.Month==DateTime.Now.Month && x.CreateDate.Day==DateTime.Now.Day)
             .Select(x => new OrderDateModel
             {
                 Status = x.Status,
                 OrderID = x.OrderID,
                 FloorID = x.FloorID,
                 TotalAmount = x.TotalAmount,
                 CreateDate = x.CreateDate
             }).ToList();
         if (status.Count > 0)
         {
             foreach (OrderDateModel item in status)
             {
                 st.Complete = item.Status;
                 st.OrderID = item.OrderID;
                 st.TableID = item.FloorID.ToString();
                 st.SubTotal = item.TotalAmount.ToString();
                 st.Time = item.CreateDate.ToString();
             }
         }
     }
     catch (Exception ex)
     {
         LogPOS.WriteLog("OrderService::::::::::::::::::::::::GetStatusTablePrinBill::::::::::::::::::" + ex.Message);
     }
     return st;
 }