private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            var results = from table1 in db1.employee.AsEnumerable()
                          join table2 in db1.employee_type.AsEnumerable() on(int) table1.employee_type_id equals(int) table2.Id
                          join table3 in db1.Postal_Code_Worker.AsEnumerable() on(int) table1.postal_code_id equals(int) table3.Id
                          select new
            {
                employee_id      = (int)table1.Id,
                id_number        = (string)table1.id_number,
                name             = (string)table1.name,
                phone            = (string)table1.phone,
                gender           = (string)table1.gender,
                deleted          = (int)table1.deleted,
                employee_type_id = (int)table2.Id,
                type             = (string)table2.type,
                salary           = (string)table2.salary,
                postal_code_id   = (int)table3.Id,
                city             = (string)table3.city,
                street           = (string)table3.street,
                house_number     = (string)table3.house_number
            };

            employeeDataGrid.ItemsSource = results.ToList();
            DeleteWorker dw = new WpfApplication8.DeleteWorker(db1, employeeDataGrid);

            dw.ShowDialog();
            employeeDataGrid.ItemsSource = results.ToList();
        }
示例#2
0
        private void Button_Delete_Click(object sender, RoutedEventArgs e)
        {
            var results = from table1 in db1.employee.AsEnumerable()
                          //     join table2 in db1.employee_type.AsEnumerable() on (int)table1.employee_type_id equals (int)table2.Id_Employee_Type
                          //    join table3 in db1.Postal_Code_Worker.AsEnumerable() on (int)table1.postal_code_id equals (int)table3.Id_Postal_Code_Worker
                          select new
            {
                Employee_Id = (int)table1.Id_Employee,
                Id_Number   = (string)table1.id_number,
                Name        = (string)table1.name,
                Phone       = (string)table1.phone,
                // Gender = (string)table1.gender,
                Deleted = (string)table1.deleted,

                /* employee_type_id = (int)table2.Id_Employee_Type,
                 * type = (string)table2.type,
                 * salary = (string)table2.salary,
                 * postal_code_id = (int)table3.Id_Postal_Code_Worker,
                 * city = (string)table3.city,
                 * street = (string)table3.street,
                 * house_number = (string)table3.house_number*/
            };

            employeeDataGrid.ItemsSource = results.ToList();
            DeleteWorker dw = new WpfApplication8.DeleteWorker(db1, employeeDataGrid);

            dw.ShowDialog();
            employeeDataGrid.ItemsSource = results.ToList();
        }