private void CreateGroupFilters() { using (var context = new RedSeaEntities()) { var query = (from team in context.tblTeams .OrderBy(b => b.Team) let cCount = ( from fte in context.tblFTEs where fte.Team == team.Id select fte).Count() select new { id = team.Id, team = team.Team, logo = team.Logo, number = cCount }).ToList(); for (var i = 0; i < query.Count; i++) { createTileItem(query[i].id, query[i].team, query[i].number, RedSea24.Classes.Logic.ByteArrayToImage(query[i].logo)); } } }
private void DeleteCurrentEmployee() { long currentId = Convert.ToInt64(tileView1.GetFocusedRowCellValue("Id")); using (var context = new RedSeaEntities()) { var oldLanguages = context.tblLinkLanguages .Where(b => b.FTE == currentId); context.tblLinkLanguages.RemoveRange(oldLanguages); var employeeLanguages = context.tblLinkLanguages .Where(b => b.FTE == currentId); context.tblLinkLanguages.RemoveRange(employeeLanguages); var employeeSkills = context.tblLinkSkills .Where(b => b.FTE == currentId); context.tblLinkSkills.RemoveRange(employeeSkills); var employeePrograms = context.tblLinkSystems .Where(b => b.FTE == currentId); context.tblLinkSystems.RemoveRange(employeePrograms); var employeeToDelete = context.tblFTEs .Where(b => b.Id == currentId).FirstOrDefault(); context.tblFTEs.Remove(employeeToDelete); context.SaveChanges(); GetDataSource(); } }
private void CreateInactiveGroup() { using (var context = new RedSeaEntities()) { var query = context.tblFTEs .Where(b => b.Active == false).Count(); createTileItem(100, "Inactive Users", query, global::RedSea24.Properties.Resources.inactive); } }
private void CreateAllGroup() { using (var context = new RedSeaEntities()) { var query = context.tblFTEs .Where(b => b.Active == true).Count(); createTileItem(0, "All Teams", query, global::RedSea24.Properties.Resources.all_active); } }
public void GetDataSource() { using (var context = new RedSeaEntities()) { var empoyeeList = context.vAllEmpoyees.ToList(); gridControl1.DataSource = empoyeeList; } tileGroup1.Items.Clear(); CreateAllGroup(); CreateGroupFilters(); CreateInactiveGroup(); tileItem_Filter("All Teams"); }