LoadDataToDataGrid();

Similar documents
Objectives. Introduce static keyword examine syntax describe common uses

Руководство по быстрой установк

Jordan University of Science & Technology Department of Computer Science CS 211 Exam #1 (23/10/2010) -- Form A

1 de :02

Common Misunderstandings from Exam 1 Material

Linked List using a Sentinel

REALIZATION OF OPEN ADDRESSING HASH TABLE IN THE CHAINED ALLOCATED MEMORY. Valentina Dyankova and Rositza Hristova

Data Structures and Algorithms

KAK - Event ID 1004 Terminal Services Client Access License (TS CAL) Availability

Олимпиада по информатике

Objects and Classes Continued. Engineering 1D04, Teaching Session 10

CALCULATOR APPLICATION

moretosearch = (location < length);

Tutorial 6 Enhancing the Inventory Application Introducing Variables, Memory Concepts and Arithmetic

Карта «Кофейные регионы Эфиопии» Коллеги из Trabocca любезно предоставили нам карту кофейных регионов Эфиопии, за что

What is a List? elements, with a linear relationship. first) has a unique predecessor, and. unique successor.

HP Photosmart A820 series. Basics Guide Вводное руководство

Tvheadend - Feature #4459 exported m3u playlist - add group-title= parameter

COL106: Data Structures and Algorithms. Ragesh Jaiswal, IIT Delhi

Tutorial 19 - Microwave Oven Application Building Your Own Classes and Objects

UEE1303(1070) S12: Object-Oriented Programming Operator Overloading and Function Overloading

Reliable Broadcast. vanilladb.org

LCP-USB Inclinometer sensor DLL Interface library description Page 1 of 5

Learning Recursion. Recursion [ Why is it important?] ~7 easy marks in Exam Paper. Step 1. Understand Code. Step 2. Understand Execution

TypeScript. Часть II. Старков Дима

Data Structures And Algorithms

Data Structures CS 315 Spring 2017

Science must not tolerate laws and theories which do not reflect real situation of the Nature.

Module 1 Introduction to Information Storage

1) ItemsSource: it point to collection which has all the objects that will be shown in the list

Консультант в Miles. Работаю с F# и Демо презентации: AkkaStreamsDemo

%& # * + + *, - * - *. / $ / $ 0 $ 1 " + " +!" "!" #$ 2 * 3 4! #% &" #' * - #5-6$7.8)$ 68$ - $" -

Telecommunication Development Bureau (BDT)

Step4: Now, Drag and drop the Textbox, Button and Text block from the Toolbox.

2 2

Objects and State. COMP1400 Week 9. Wednesday, 19 September 12

CS 315 Data Structures mid-term 2

Подключение ультразвукового датчика HC-SR04

School of Computing National University of Singapore CS2010 Data Structures and Algorithms 2 Semester 2, AY 2015/16. Tutorial 2 (Answers)

// initialize array to true. for (i = 0; i < s; i++) f[i] = true; // get rid of known non-primes f[0] = f[1] = false;

Accurate study guides, High passing rate! IT TEST BOOK QUESTION & ANSWER. Ittestbook provides update free of charge in one year!

Vive Input Utility Developer Guide

Topics. Windows Phone

The Stack ADT. Stacks. The Stack ADT. The Stack ADT. Set of objects in which the location an item is inserted and deleted is prespecified.

Engr 123 April 25, 2018 Final Exam Review. 3. Write a method which will accept a string and return the number of three-letter words in the string.

Apache Kafka и реактивные микросервисы на.net Core. Денис

Class Test 5. Create a simple paint program that conforms to the following requirements.

Introduction to Computer Science II CS S-18 Linked Lists

Tutorial 5 Completing the Inventory Application Introducing Programming

Lists. linking nodes. constructors. chasing pointers. MCS 360 Lecture 11 Introduction to Data Structures Jan Verschelde, 17 September 2010.

Особые исключения в.net

Оптимизация запросов в PostgreSQL - live at PG Day. Алексей Ермаков Илья Космодемьянский

Getting Started with Banjos4Hire

! Tree: set of nodes and directed edges. ! Parent: source node of directed edge. ! Child: terminal node of directed edge

Test 1: CPS 100. Owen Astrachan. February 23, 2000

MIDTERM EXAM SOLUTIONS

Имя: Город: Ваш ответ (должен быть от 50 знаков):

C:\Temp\Templates. Download This PDF From The Web Site

Topic 7: Algebraic Data Types

Final Exam Review April 18, 2018

CSC207 Quiz 1 Solutions Monday 6 February 2017, 12:15 PM. 1. (A) (B) (C) (D) (E) 7. Nothing, does not run true false

FD Trinitron Colour Television

The string Class. Lecture 21 Sections 2.9, 3.9, Robb T. Koether. Wed, Oct 17, Hampden-Sydney College

CS 231 Data Structures and Algorithms Fall Binary Search Trees Lecture 23 October 29, Prof. Zadia Codabux

POLYMORPHISM 2 PART Abstract Classes Static and Dynamic Casting Common Programming Errors

Lecture Notes CPSC 122 (Fall 2014) Today Quiz 7 Doubly Linked Lists (Unsorted) List ADT Assignments Program 8 and Reading 6 out S.

POLYMORPHISM 2 PART. Shared Interface. Discussions. Abstract Base Classes. Abstract Base Classes and Pure Virtual Methods EXAMPLE

Informatics 1 Functional Programming Lecture 4. Lists and Recursion. Don Sannella University of Edinburgh

The class Object. Lecture CS1122 Summer 2008

for (int outercounter = nums.length - 1; outercounter > 0 && swappedthatturn; outercounter --

Objects and Classes. Engineering 1D04, Teaching Session 9

CSC Java Programming, Fall Java Data Types and Control Constructs

An Introduction to Queues With Examples in C++

void insert( Type const & ) void push_front( Type const & )

money time and space.

Chapter 20: Binary Trees

CSCE 110 PROGRAMMING FUNDAMENTALS

Краткое руководство по установке

CMSC 202 Midterm Exam 1 Fall 2015

Object-oriented Programming and Software Engineering CITS1001. Multiple-choice Mid-semester Test

C++17. Antony Polukhin Полухин Антон

3D ray tracing simple scalability case study

MCS 360 Exam 2 11 November In order to get full credit, you need to show your work.

Kodak digital camera z1285 reviews

Name Section Number. CS210 Exam #3 *** PLEASE TURN OFF ALL CELL PHONES*** Practice

Chromatic Remote Control Product Guide Executive Way, Suite A Frederick, MD 21704

Itunes free download for windows 10.1

Design Patterns for Data Structures. Chapter 9. Dictionaries

Design Patterns for Data Structures. Chapter 9. Dictionaries

University of Palestine. Mid Exam Total Grade: 100

Exceptions, Case Study-Exception handling in C++.

Sample file. Practice Exam One COMPUTER SCIENCE A SECTION I. Directions: Determine the answer to each of the following questions or incomplete

KillTest. 半年免费更新服务

BASIC ELEMENTS OF A COMPUTER PROGRAM

Math-Net.Ru All Russian mathematical portal

CSC122A, Spring 2005 Computer Science II Final Exam

ENGI 1020 Introduction to Computer Programming J U L Y 5, R E Z A S H A H I D I

TL-PA2010 AV200 Nano Powerline Adapter

The class diagram contains only 2 elements: LabClass and Student. The LabClass class is linked to the Student class.

Priority Queues and Huffman Trees

Transcription:

Архангельский Алексей /// Загрузка данных в таблицу на форме в зависимости от того, что выбрано в комбобоксе private void LoadDataToDataGrid() button_add.isenabled = false; datagrid_booksorreaders.itemssource = null; // В списке выбраны книги LIBBook mybooks = new LIBBook( if (mybooks.getlist()!= null) datagrid_booksorreaders.itemssource = mybooks.getlist().defaultview; button_add.isenabled = true; // В списке выбрани читатели LIBReader myreaders = new LIBReader( if (myreaders.getlist()!= null) datagrid_booksorreaders.itemssource = myreaders.getlist().defaultview; button_add.isenabled = true; // Загружается новый список, поэтому кнопки удалить и изменить блокируются button_delete.isenabled = false; button_edit.isenabled = false; buttongiveread.isenabled = false; // Загрузка данных при новом выборе в списке private void combobox_booksorreaders_selectionchanged(object sender, SelectionChangedEventArgs e)

// Добавление новой книги или читателя private void button_add_click(object sender, RoutedEventArgs e) // В зависимости что просматривают // открывается форма добавления новой книги или читателя WindowBook myaddbook = new WindowBook( myaddbook.showdialog( if (myaddbook.dialogresult == true) LIBBook mybook = new LIBBook( mybook.add( myaddbook.textboxtitle.text, myaddbook.textboxautor.text, 0, int.parse(myaddbook.textboxrow.text), int.parse(myaddbook.textboxshelf.text), int.parse(myaddbook.textboxposition.text) myaddbook.close( WindowReader myaddreader = new WindowReader( myaddreader.showdialog( if (myaddreader.dialogresult == true) LIBReader myreader = new LIBReader( myreader.add( myaddreader.textboxname.text, myaddreader.textboxpatronumic.text, myaddreader.textboxlastname.text, myaddreader.datepickerdatebirth.selecteddate.value myaddreader.close(

// Выбор строки в списке private void datagrid_booksorreaders_selectionchanged(object sender, SelectionChangedEventArgs e) button_delete.isenabled = true; button_edit.isenabled = true; // Выбраны книги? if (books.isselected == true && datagrid_booksorreaders.selectedvalue!= null) // Книгу не читают? if (BookIsRead() == true) buttongiveread.content = "Возвратить"; else buttongiveread.content = "Дать читать"; buttongiveread.isenabled = true; // Удаление книги или читателя private void button_delete_click(object sender, RoutedEventArgs e) LIBBook mybook = new LIBBook( mybook.delete( int.parse(((datarowview)datagrid_booksorreaders.selectedvalue).row.itemarray[0].tostring()) LIBReader myreader = new LIBReader( myreader.delete( int.parse(((datarowview)datagrid_booksorreaders.selectedvalue).row.itemarray[0].tostring())

// Редактирование данных книги или читателя private void button_edit_click(object sender, RoutedEventArgs e) // Выбраны книги int idbook, idreader=0; WindowBook myeditbook = new WindowBook( myeditbook.title = "Изменение данных книги"; myeditbook.buttonok.content = "Изменить"; // id книги idbook = int.parse( ((DataRowView)dataGrid_BooksOrReaders.SelectedValue).Row.ItemArray[0].ToString() // Заголовок myeditbook.textboxtitle.text = ((DataRowView)dataGrid_BooksOrReaders.SelectedValue).Row.ItemArray[1].ToString( // Автор myeditbook.textboxautor.text = ((DataRowView)dataGrid_BooksOrReaders.SelectedValue).Row.ItemArray[2].ToString( // Ряд myeditbook.textboxrow.text = ((DataRowView)dataGrid_BooksOrReaders.SelectedValue).Row.ItemArray[3].ToString( // Полка myeditbook.textboxshelf.text = ((DataRowView)dataGrid_BooksOrReaders.SelectedValue).Row.ItemArray[4].ToString( // Позиция myeditbook.textboxposition.text = ((DataRowView)dataGrid_BooksOrReaders.SelectedValue).Row.ItemArray[5].ToString( myeditbook.showdialog( if (myeditbook.dialogresult == true) LIBBook mybook = new LIBBook( mybook.edit( idbook, myeditbook.textboxtitle.text, myeditbook.textboxautor.text, idreader, int.parse(myeditbook.textboxrow.text), int.parse(myeditbook.textboxshelf.text), int.parse(myeditbook.textboxposition.text)

myeditbook.close( // Выбраны читатели int idreader; WindowReader myeditreader = new WindowReader( myeditreader.title = "Изменение данных читателя"; myeditreader.buttonok.content = "Изменить"; // id idreader = int.parse( ((DataRowView)dataGrid_BooksOrReaders.SelectedValue).Row.ItemArray[0].ToString() // Имя myeditreader.textboxname.text = ((DataRowView)dataGrid_BooksOrReaders.SelectedValue).Row.ItemArray[1].ToString( // Отчество myeditreader.textboxpatronumic.text = ((DataRowView)dataGrid_BooksOrReaders.SelectedValue).Row.ItemArray[2].ToString( // Фамилия myeditreader.textboxlastname.text = ((DataRowView)dataGrid_BooksOrReaders.SelectedValue).Row.ItemArray[3].ToString( // Дата рождения myeditreader.datepickerdatebirth.text = ((DataRowView)dataGrid_BooksOrReaders.SelectedValue).Row.ItemArray[4].ToString( myeditreader.showdialog( if (myeditreader.dialogresult == true) LIBReader myreader = new LIBReader( myreader.edit( idreader, myeditreader.textboxname.text, myeditreader.textboxpatronumic.text, myeditreader.textboxlastname.text, myeditreader.datepickerdatebirth.selecteddate.value myeditreader.close(

// Изменение настроек подключения к базе данных private void buttonsetting_click(object sender, RoutedEventArgs e) WindowSettings myeditsettings = new WindowSettings( myeditsettings.textboxserver.text = LIBSetting.Server; myeditsettings.textboxuid.text = LIBSetting.Uid; myeditsettings.textboxpwd.text = LIBSetting.Pwd; myeditsettings.showdialog( if (myeditsettings.dialogresult == true) LIBSetting mysetting = new LIBSetting( mysetting.setsettingsforconnectiondb( myeditsettings.textboxserver.text, myeditsettings.textboxuid.text, myeditsettings.textboxpwd.text myeditsettings.close( // Дать читать private void buttongiveread_click(object sender, RoutedEventArgs e) LIBReader myreader = new LIBReader( LIBBook mybook = new LIBBook( int idbook, idreader; idbook = int.parse( ((DataRowView)dataGrid_BooksOrReaders.SelectedValue).Row.ItemArray[0].ToString() // Книгу читают? if (BookIsRead() == true) mybook.unsetreader(idbook else

WindowList mywindowlist = new WindowList( mywindowlist.datagrid_list.itemssource = myreader.getlist().defaultview; mywindowlist.showdialog( idreader = int.parse( ((DataRowView)myWindowList.dataGrid_List.SelectedValue).Row.ItemArray[0].ToString() if (mywindowlist.dialogresult == true) mybook.setreader(idbook, idreader mywindowlist.close( // Книгу никто не читает или читают private bool BookIsRead() if (((DataRowView)dataGrid_BooksOrReaders.SelectedValue).Row.ItemArray[6].ToString()!= "null") return true; else return false;