示例#1
0
        /// <summary>
        /// Load lại dữ liệu tránh dữ liệu bị thay đổi
        /// </summary>
        public void LoadData()
        {
            var table = new Desktop.BL.BLArea().GetTableMappingDetailByTableID(TableID, Today);

            if (table != null)
            {
                if (table.Rows.Count > 0)
                {
                    Empty();
                    TableStatus = (EnumTableStatus)table.Rows[0][ColumnName.TableStatus];
                    if (TableStatus == EnumTableStatus.Booking)
                    {
                        BookingID = Guid.Parse(table.Rows[0][ColumnName.BookingID].ToString());
                        FromTime  = DateTime.Parse(table.Rows[0][ColumnName.FromTime].ToString());
                        OrderID   = Guid.Empty;
                        OrderDate = DateTime.MinValue;
                    }
                    if (TableStatus == EnumTableStatus.Using)
                    {
                        OrderID   = Guid.Parse(table.Rows[0][ColumnName.OrderID].ToString());
                        OrderDate = DateTime.Parse(table.Rows[0][ColumnName.OrderDate].ToString());
                        BookingID = Guid.Empty;
                        FromTime  = DateTime.MinValue;
                    }
                }
            }
        }
        /// <summary>
        /// Load Khu vực
        /// </summary>
        /// <param name="force"></param>
        public static void LoadArea(bool force = false)
        {
            var oBL = new BLArea();

            if (force)
            {
                DsDictionary.Area.Clear();
                DsDictionary.Area.Merge(oBL.Get());
            }
            else
            {
                if (DsDictionary.Area.Rows.Count == 0)
                {
                    DsDictionary.Area.Merge(oBL.Get());
                }
            }
        }