Ejemplo n.º 1
0
        private void ImportTables(Department department)
        {
            var fileName = string.Format("{0}/Imports/table{1}.txt", LocalSettings.AppPath, "_" + LocalSettings.CurrentLanguage);

            if (!File.Exists(fileName))
                fileName = string.Format("{0}/Imports/table.txt", LocalSettings.AppPath);

            if (!File.Exists(fileName)) return;

            var lines = File.ReadAllLines(fileName);
            var items = BatchCreateTables(lines, _workspace);
            _workspace.CommitChanges();

            var screen = new TableScreen { Name = Resources.AllTables, ColumnCount = 8 };
            _workspace.Add(screen);

            foreach (var table in items)
                screen.AddScreenItem(table);

            _workspace.CommitChanges();

            department.TableScreenId = screen.Id;
        }
Ejemplo n.º 2
0
        public void UpdateTableData(TableScreen selectedTableScreen, int pageNo)
        {
            var set = selectedTableScreen.Tables.Select(x => x.Id);
            if (selectedTableScreen.PageCount > 1)
            {
                set = selectedTableScreen.Tables
                    .OrderBy(x => x.Order)
                    .Skip(pageNo * selectedTableScreen.ItemCountPerPage)
                    .Take(selectedTableScreen.ItemCountPerPage)
                    .Select(x => x.Id);
            }

            var result = Dao.Select<Table, dynamic>(x => new { x.Id, Tid = x.TicketId, Locked = x.IsTicketLocked },
                                                   x => set.Contains(x.Id));
            foreach (var td in result)
            {
                var tid = td.Id;
                var table = selectedTableScreen.Tables.Single(x => x.Id == tid);
                table.TicketId = td.Tid;
                table.IsTicketLocked = td.Locked;
            }
        }
Ejemplo n.º 3
0
        public TableScreenItemViewModel(Table model, TableScreen screen)
            : this(model, screen, null)
        {

        }
Ejemplo n.º 4
0
 public TableScreenItemViewModel(Table model, TableScreen screen, ICommand actionCommand)
 {
     _actionCommand = actionCommand;
     _screen = screen;
     Model = model;
 }
Ejemplo n.º 5
0
 private void OnSelectTableCategoryExecuted(TableScreen obj)
 {
     UpdateTables(obj.Id);
 }