public static void UpdateSelectedTicket(Table table) { Debug.Assert(SelectedTicket == null); if (table.TicketId == 0) TicketViewModel.AssignTableToSelectedTicket(table.Id); //AppServices.MainDataContext.AssignTableToSelectedTicket(table.Id);); else AppServices.MainDataContext.OpenTicket(table.TicketId); RefreshSelectedTicket(); }
void TableScreenViewModelTableSelectedEvent(Table selectedTable) { //Id #10: Gün sonu yapıldıysa iptal et. if (!AppServices.MainDataContext.IsCurrentWorkPeriodOpen) { ShowFeedback(Resources.WorkPeriodEnded); return; } if (DataContext.SelectedTicket != null) { if (DataContext.SelectedTicket.SelectedItems.Count == 0) { TicketViewModel.AssignTableToSelectedTicket(selectedTable.Id); //AppServices.MainDataContext.AssignTableToSelectedTicket(selectedTable.Id); //{LocText TicketMovedToTable_f} ShowFeedback(string.Format(Resources.TicketMovedToTable_f, "", selectedTable.Name)); } else { MoveSelectedItems(selectedTable.Id); ShowFeedback(string.Format(Resources.ItemsMovedToTable_f, selectedTable.Name)); } CloseSelectedTicket(); ActivateTableView(); } else ActivateTicketView(selectedTable); }
private void ActivateTicketView(Table table) { if (table != null) { DataContext.UpdateSelectedTicket(table); if (table.TicketId == 0) { ActivateMenuItemSelector(); return; } } LoggedInUserViewModel.Refresh(); TicketEditorViewModel.Refresh(); SelectedIndex = 3; }
private void OnSelectTable(Table obj) { InvokeOnTableSelected(obj); }
public void InvokeOnTableSelected(Table table) { var handler = TableSelectedEvent; if (handler != null) handler(table); }
public IEnumerable<Table> BatchCreateTables(string[] values, IWorkspace workspace) { IList<Table> result = new List<Table>(); if (values.Length > 0) { var currentCategory = Resources.Common; foreach (var value in values) { if (value.StartsWith("#")) { currentCategory = value.Trim('#', ' '); } else { var tableName = value; var count = Dao.Count<Table>(y => y.Name == tableName.Trim()); if (count == 0) { var table = new Table { Name = value.Trim(), Category = currentCategory }; if (result.Count(x => x.Name.ToLower() == table.Name.ToLower()) == 0) { result.Add(table); workspace.Add(table); } } } } } return result; }
public TableScreenItemViewModel(Table model, TableScreen screen, ICommand actionCommand) { _actionCommand = actionCommand; _screen = screen; Model = model; }
public TableScreenItemViewModel(Table model, TableScreen screen) : this(model, screen, null) { }
public void AddScreenItem(Table choosenValue) { if (!Tables.Contains(choosenValue)) Tables.Add(choosenValue); }