Ejemplo n.º 1
0
        private void EventSetter_OnHandler(object sender, MouseButtonEventArgs e)
        {
            object      source         = e.OriginalSource;
            string      isAction       = ((DataGridCell)sender).Column.Header.ToString().ToUpperInvariant();
            DataGridRow dgrSelectedRow = FindParent <DataGridRow>(sender as DependencyObject);
            USER        selectedUser   = (USER)dgrSelectedRow.DataContext;

            if (source.GetType() == typeof(Image) && isAction == "DELETE")
            {
                DataAccess objDataAccess = new DataAccess();
                bool       isUserDeleted = objDataAccess.DeleteUser(selectedUser.UserID);
                if (isUserDeleted)
                {
                    MessageBox.Show("User Deleted Successfully");
                }
                else
                {
                    MessageBox.Show("User Deletion Failed!!!");
                }
            }


            if (source.GetType() == typeof(Image) && isAction == "EDIT")
            {
                UserCustomizationScreen objUserCustomizationScreen = new UserCustomizationScreen();
                objUserCustomizationScreen.EditUser     = selectedUser;
                objUserCustomizationScreen.DataChanged += ObjUserScreen_DataChanged;
                objUserCustomizationScreen.ShowDialog();
            }
        }
Ejemplo n.º 2
0
        private void bAddUser_Click(object sender, RoutedEventArgs e)
        {
            UserCustomizationScreen objUserCustomizationScreen = new UserCustomizationScreen();

            objUserCustomizationScreen.ShowDialog();
        }