Esempio n. 1
0
        private void Button_Update_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();
            UpdateEmployeeTable uet = new WpfApplication8.UpdateEmployeeTable(employeeDataGrid, db1);

            uet.ShowDialog();
            employeeDataGrid.ItemsSource = results.ToList();
        }
        private void Button_Click_3(object sender, RoutedEventArgs e)
        {
            UpdateEmployeeTable ut = new WpfApplication8.UpdateEmployeeTable(employeeDataGrid, db1);

            ut.ShowDialog();
            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();
        }
Esempio n. 3
0
        private void Button_Update_Worker(object sender, RoutedEventArgs e)
        {
            UpdateEmployeeTable uet = new WpfApplication8.UpdateEmployeeTable(db);

            uet.ShowDialog();
        }