/// <summary> /// 加载餐桌定位---餐桌类型定位 /// </summary> private void LoaderTableTypeLocation(string[] values) { flag = false; List <TableType> types = _TableStatusService.GetAllTypes(); TableLocationItems.Clear(); if (types != null) { foreach (var tt in types) { BaseTableModel ttm = new BaseTableModel(tt.TableTypeId, tt.Name); if (!flag) { LocationSelectedItem = ttm; flag = true; } if (values != null) { foreach (var value in values) { if (string.IsNullOrEmpty(value)) { continue; } if (tt.TableTypeId == int.Parse(value)) { ttm.Checked = true; } } } TableLocationItems.Add(ttm); } } }
/// <summary> /// 加载区域 /// </summary> /// <param name="locations"></param> private void LoaderLocation(List <Location> locations, int status) { TableItems.Clear(); if (locations != null && locations.Count > 0) { foreach (var location in locations) { if (status == 0) { BaseTableModel ttms = new BaseTableModel(location.LocationId, location.Code, location.Name); TypeItems.Add(ttms); } ICollection <Table> tables = location.Table; LoaderTableItem(tables); } } }
/// <summary> /// 加载餐桌类型 /// </summary> /// <param name="types"></param> /// /// <param name="status">status=0表示初始化加载,status=1表示点击类型加载对应桌台</param> private void LoaderTableType(List <TableType> types, int status) { TableItems.Clear(); if (types != null && types.Count > 0) { foreach (var type in types) { if (status == 0) { BaseTableModel ttms = new BaseTableModel(type.TableTypeId, type.Code, type.Name); TypeItems.Add(ttms); } ICollection <Table> tables = type.Table; LoaderTableItem(tables); } } }