// Items list public static IReadOnlyList <IGuidesItem> GetDataGridGuidesItems(MenuNavigatorItem MenuItem) { switch (MenuItem.Id) { case GuidesElements.Enterprises: return(GetEnterprisesList()); case GuidesElements.Posts: return(GetPostsList()); case GuidesElements.Workers: return(GetWorkersList()); case GuidesElements.Users: return(GetUsersList()); case GuidesElements.CarTypes: return(GetCarTypesList()); case GuidesElements.Cars: return(GetCarsList()); case GuidesElements.PointTypes: return(GetPointsList()); case GuidesElements.Points: return(GetPointTypesList()); case GuidesElements.Routes: return(GetRoutesList()); default: return(null); } }
// Datagrid header public static ObservableCollection <DataGridColumn> GetDataGridGuidesColumns(MenuNavigatorItem MenuItem) { switch (MenuItem.Id) { case GuidesElements.Enterprises: return(new ObservableCollection <DataGridColumn> { new DataGridTextColumn() { Header = "ID", Width = 50, Binding = new Binding() { Path = new PropertyPath("Id") } }, new DataGridTextColumn() { Header = "NAME", Width = new DataGridLength(100, DataGridLengthUnitType.Star), Binding = new Binding() { Path = new PropertyPath("Name") } }, new DataGridTextColumn() { Header = "INN", Width = 100, Binding = new Binding() { Path = new PropertyPath("Inn") } } }); case GuidesElements.Posts: return(new ObservableCollection <DataGridColumn> { new DataGridTextColumn() { Header = "ID", Width = 50, Binding = new Binding() { Path = new PropertyPath("Id") } }, new DataGridTextColumn() { Header = "NAME", Width = new DataGridLength(100, DataGridLengthUnitType.Star), Binding = new Binding() { Path = new PropertyPath("Name") } } }); case GuidesElements.Workers: return(new ObservableCollection <DataGridColumn> { new DataGridTextColumn() { Header = "ID", Width = 50, Binding = new Binding() { Path = new PropertyPath("Id") } }, new DataGridTextColumn() { Header = "FIRSTNAME", Width = new DataGridLength(100, DataGridLengthUnitType.Star), Binding = new Binding() { Path = new PropertyPath("FirstName") } }, new DataGridTextColumn() { Header = "NAME", Width = new DataGridLength(100, DataGridLengthUnitType.Star), Binding = new Binding() { Path = new PropertyPath("Name") } }, new DataGridTextColumn() { Header = "LASTNAME", Width = new DataGridLength(100, DataGridLengthUnitType.Star), Binding = new Binding() { Path = new PropertyPath("LastName") } }, new DataGridTextColumn() { Header = "POST", Width = new DataGridLength(100, DataGridLengthUnitType.Star), Binding = new Binding() { Path = new PropertyPath("Posts.Name") } }, new DataGridTextColumn() { Header = "ENTERPRISE", Width = new DataGridLength(100, DataGridLengthUnitType.Star), Binding = new Binding() { Path = new PropertyPath("Enterprises.Name") } } }); case GuidesElements.Users: return(new ObservableCollection <DataGridColumn> { new DataGridTextColumn() { Header = "ID", Width = 50, Binding = new Binding() { Path = new PropertyPath("Id") } }, new DataGridTextColumn() { Header = "LOGIN", Width = new DataGridLength(100, DataGridLengthUnitType.Star), Binding = new Binding() { Path = new PropertyPath("Login") } }, new DataGridTextColumn() { Header = "NAME", Width = new DataGridLength(100, DataGridLengthUnitType.Star), Binding = new Binding() { Path = new PropertyPath("Name") } }, new DataGridTextColumn() { Header = "POST", Width = 100, Binding = new Binding() { Path = new PropertyPath("Posts.Name") } } }); case GuidesElements.CarTypes: return(new ObservableCollection <DataGridColumn> { new DataGridTextColumn() { Header = "ID", Width = 50, Binding = new Binding() { Path = new PropertyPath("Id") } }, new DataGridTextColumn() { Header = "NAME", Width = new DataGridLength(100, DataGridLengthUnitType.Star), Binding = new Binding() { Path = new PropertyPath("Name") } } }); case GuidesElements.Cars: return(new ObservableCollection <DataGridColumn> { new DataGridTextColumn() { Header = "ID", Width = 50, Binding = new Binding() { Path = new PropertyPath("Id") } }, new DataGridTextColumn() { Header = "INOMER", Width = 100, Binding = new Binding() { Path = new PropertyPath("INomer") } }, new DataGridTextColumn() { Header = "SNOMER", Width = 100, Binding = new Binding() { Path = new PropertyPath("SNomer") } }, new DataGridTextColumn() { Header = "CARTYPE", Width = new DataGridLength(100, DataGridLengthUnitType.Star), Binding = new Binding() { Path = new PropertyPath("CarTypes.Name") } }, new DataGridTextColumn() { Header = "ENTERPRISE", Width = new DataGridLength(100, DataGridLengthUnitType.Star), Binding = new Binding() { Path = new PropertyPath("Enterprises.Name") } } }); case GuidesElements.PointTypes: return(new ObservableCollection <DataGridColumn> { new DataGridTextColumn() { Header = "ID", Width = 50, Binding = new Binding() { Path = new PropertyPath("Id") } }, new DataGridTextColumn() { Header = "NAME", Width = new DataGridLength(100, DataGridLengthUnitType.Star), Binding = new Binding() { Path = new PropertyPath("Name") } }, new DataGridTextColumn() { Header = "SHORTNAME", Width = new DataGridLength(100, DataGridLengthUnitType.Star), Binding = new Binding() { Path = new PropertyPath("ShortName") } } }); case GuidesElements.Points: return(new ObservableCollection <DataGridColumn> { new DataGridTextColumn() { Header = "ID", Width = 50, Binding = new Binding() { Path = new PropertyPath("Id") } }, new DataGridTextColumn() { Header = "POINTYPE", Width = 100, Binding = new Binding() { Path = new PropertyPath("PointTypes.ShortName") } }, new DataGridTextColumn() { Header = "NAME", Width = new DataGridLength(100, DataGridLengthUnitType.Star), Binding = new Binding() { Path = new PropertyPath("Name") } } }); case GuidesElements.Routes: return(new ObservableCollection <DataGridColumn> { new DataGridTextColumn() { Header = "ID", Width = 50, Binding = new Binding() { Path = new PropertyPath("Id") } }, new DataGridTextColumn() { Header = "NOMER", Width = 100, Binding = new Binding() { Path = new PropertyPath("Nomer") } }, new DataGridTextColumn() { Header = "NAME", Width = new DataGridLength(100, DataGridLengthUnitType.Star), Binding = new Binding() { Path = new PropertyPath("Name") } } }); default: return(null); } }