Пример #1
0
        /// <summary>
        /// 編集ダイアログを表示する
        /// </summary>
        /// <param name="editType"></param>
        public void ShowEditDialog(EditType editType)
        {
            switch (editType)
            {
            case EditType.Register:
                SelectedEditType = EditType.Register;

                break;

            case EditType.Update:
                SelectedUser     = GetSelctedUser(ListForm.GetSelectedRow());
                SelectedEditType = EditType.Update;

                break;

            case EditType.Delete:
                SelectedUser     = GetSelctedUser(ListForm.GetSelectedRow());
                SelectedEditType = EditType.Delete;

                break;
            }

            View.EditForm editForm = new View.EditForm(Users, Departments, SelectedEditType, SelectedUser);
            editForm.ShowDialog();

            //編集したユーザー情報をIDの昇順に並べバインドリストに
            Users = Users.OrderBy(x => x.ID).ToList();
        }