Esempio n. 1
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            MasterEmployees addWindow = new MasterEmployees();

            addWindow.Owner = this;
            addWindow.Show();
        }
Esempio n. 2
0
        private void ListBoxItem_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            MasterEmployees EmployeeMaintenanceWindow = new MasterEmployees();

            EmployeeMaintenanceWindow.Owner = this;
            //EmployeeListWindow.Show();
            EmployeeMaintenanceWindow.ShowDialog();
        }
        public SearchEmployee(string value, MasterEmployees formReceived)
        {
            InitializeComponent();
            Loading();

            newFormReceived = formReceived;

            this.myOptionSended = value;
        }
        private void Row_DoubleClick(object sender, MouseButtonEventArgs e)
        {
            //MasterEmployees editWindow = new MasterEmployees();
            MasterEmployees editWindow = newFormReceived;

            var selectedItem = dataGrid1.SelectedItem as tblEmployee;

            if (selectedItem != null)
            {
                //MessageBox.Show(selectedItem.Emp_EmployeeId.ToString());
                //editWindow.Owner = this;

                editWindow.flagSearchEmployee = true;
            }

            editWindow.txtEmployeeId.Text = selectedItem.Emp_EmployeeId.ToString();

            if (myOptionSended.ToString() == "u")
            {
                editWindow.btnSearchEmployee.IsEnabled = true;
                editWindow.optionSelectedCRUM          = myOptionSended;
                editWindow.sbItem3.Content             = "Update Employee";

                editWindow.txtEmployeeId.IsEnabled = true;
            }
            else   //delete
            {
                editWindow.btnSearchEmployee.IsEnabled = true;
                editWindow.optionSelectedCRUM          = myOptionSended;
                editWindow.sbItem3.Content             = "Delete Employee";
                editWindow.txtEmployeeId.IsEnabled     = true;
                //cbTitles.Focus();
                //editWindow.txtEmployeeId.Focus();
            }


            //------------------------------------------------------------------------
            //this seccion is to call event txtEmployeeId_KeyDown
            var kea = new KeyEventArgs(
                Keyboard.PrimaryDevice,
                new HwndSource(0, 0, 0, 0, 0, "", IntPtr.Zero), // dummy source
                0,
                Key.Enter);

            editWindow.txtEmployeeId_KeyDown(this, kea);
            //------------------------------------------------------------------------


            //editWindow.Show();

            Close();
        }
Esempio n. 5
0
        private void Row_DoubleClick(object sender, MouseButtonEventArgs e)
        {
            MasterEmployees editWindow   = new MasterEmployees();
            var             selectedItem = dataGrid1.SelectedItem as tblEmployee;

            if (selectedItem != null)
            {
                //MessageBox.Show(selectedItem.Emp_EmployeeId.ToString());
                editWindow.Owner = this;
            }
            editWindow.btnDelete.IsEnabled = false;
            editWindow.btnUpdate.IsEnabled = false;
            editWindow.btnNew.IsEnabled    = false;

            editWindow.optionSelectedCRUM = "u";
            editWindow.flag = true;
            editWindow.txtEmployeeId.Text = selectedItem.Emp_EmployeeId.ToString();
            editWindow.Fill_Employee_Info(selectedItem.Emp_EmployeeId);
            editWindow.Show();
        }