Пример #1
0
        private void edit_Click(object sender, RoutedEventArgs e)
        {
            var    t        = employeesDataGrid.SelectedItem;
            var    b        = t as DataRowView;
            int    s        = int.Parse(b.Row[0].ToString());
            string edit_num = b.Row[1].ToString();

            if (edit_num == "admin")
            {
                MessageBox.Show("无法编辑管理员", "提示");
            }
            else
            {
                C1.WPF.C1Window employeeswindow = new C1.WPF.C1Window();
                employeeswindow.IsResizable = false;
                employeeswindow.Name        = "employeeswindow2";
                employeeswindow.Width       = 700;
                employeeswindow.Height      = 550;
                employeeswindow.Header      = "员工管理";
                employeeswindow.Margin      = new Thickness(SystemParameters.PrimaryScreenWidth / 2d - 250, SystemParameters.PrimaryScreenHeight / 2d - 250, 0, 0);
                employeeswindow.Show();
                employeeswindow.ShowMaximizeButton = false;
                employeeswindow.ShowMinimizeButton = false;
                userdetail newemployees = new userdetail();
                newemployees.Name = "newemployees2";

                //Public.user_id = s;
                newemployees.u_id       = s;
                employeeswindow.Content = newemployees;
            }
        }
Пример #2
0
        private void add_user_Click(object sender, RoutedEventArgs e)
        {
            C1.WPF.C1Window employeeswindow = new C1.WPF.C1Window();
            employeeswindow.IsResizable = false;
            employeeswindow.Name        = "employeeswindow1";
            employeeswindow.Width       = 700;
            employeeswindow.Height      = 550;
            employeeswindow.Header      = "员工管理";
            employeeswindow.Margin      = new Thickness(SystemParameters.PrimaryScreenWidth / 2d - 250, SystemParameters.PrimaryScreenHeight / 2d - 250, 0, 0);
            employeeswindow.ShowModal();
            employeeswindow.ShowMaximizeButton = false;
            employeeswindow.ShowMinimizeButton = false;
            userdetail newemployees = new userdetail();

            newemployees.Name       = "newemployees1";
            employeeswindow.Content = newemployees;

            //newemployees.C1Window += new RoutedPropertyChangedEventHandler<object>(newemployees_C1Window);
            //Fixed_management.FixedDataSet fixedDataSet = ((Fixed_management.FixedDataSet)(this.FindResource("fixedDataSet")));
            //Fixed_management.FixedDataSetTableAdapters.employeesTableAdapter fixedDataSetemployeesTableAdapter = new Fixed_management.FixedDataSetTableAdapters.employeesTableAdapter();
            //fixedDataSet.employees.AcceptChanges();
            //fixedDataSetemployeesTableAdapter.Fill(fixedDataSet.employees);
        }