Разработка системы тестирования для кандидатов на позиции в компании с целью определения их профессиональной компетенции

Автоматизация процесса подбора кандидатов для приема на работу. Проектирование системы тестирования для кадрового отдела компании, ее информационное обеспечение. Проектирование базы данных и ее интерфейса. Расчет экономической эффективности проекта.

Рубрика Программирование, компьютеры и кибернетика
Вид дипломная работа
Язык русский
Дата добавления 22.03.2017
Размер файла 1,6 M

Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже

Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.

this->PassedTestsView->ReadOnly = true;

this->PassedTestsView->SelectionMode = System:: Windows:: Forms:: DataGridViewSelectionMode:: FullRowSelect;

this->PassedTestsView->Size = System:: Drawing:: Size (633, 364);

this->PassedTestsView->TabIndex = 15;

//

// Candidates

//

this->AutoScaleDimensions = System:: Drawing:: SizeF (6, 13);

this->AutoScaleMode = System:: Windows:: Forms:: AutoScaleMode:: Font;

this->BackColor = System:: Drawing:: SystemColors:: ControlDarkDark;

this->ClientSize = System:: Drawing:: Size (798, 436);

this->Controls->Add (this->BasePanel);

this->Controls->Add (this->CandidateTab);

this->MinimumSize = System:: Drawing:: Size (472, 475);

this->Name = L"Candidates";

this->StartPosition = System:: Windows:: Forms:: FormStartPosition:: CenterScreen;

this->Text = L"Кадровая служба - Кандидат";

this->Load += gcnew System:: EventHandler (this, &Candidates:: Candidates_Load);

this->BasePanel->ResumeLayout (false);

this->CandidateTab->ResumeLayout (false);

this->AvailableTestsTab->ResumeLayout (false);

(cli:: safe_cast<System:: ComponentModel:: ISupportInitialize^> (this->PositionsTestsView)) - >EndInit ();

this->PassedTestsTab->ResumeLayout (false);

(cli:: safe_cast<System:: ComponentModel:: ISupportInitialize^> (this->PassedTestsView)) - >EndInit ();

this->ResumeLayout (false);

}

#pragma endregion

private: System:: Void ExitButton_Click (System:: Object^ sender, System:: EventArgs^ e) {

this->Close ();

}

private: System:: Void CandidateTab_Selected (System:: Object^ sender, System:: EventArgs^ e) {

if (this->CandidateTab->SelectedIndex == 0)

{

this->PassTestButton->Visible = true;

this->ShowTestButton->Visible = false;

}

else if (this->CandidateTab->SelectedIndex == 1)

{

this->PassTestButton->Visible = false;

this->ShowTestButton->Visible = true;

}

}

private: System:: Void Candidates_Load (System:: Object^ sender, System:: EventArgs^ e) {

try

{

RefreshTests ();

}

catch (Exception ^ ex)

{

MessageBox:: Show ("Ошибка соединения с базой даных");

}

}

System:: Void RefreshTests ()

{

MySqlInterface ^ msi = gcnew MySqlInterface;

DataTable ^ dt = msi->GetCandidateTests (this->_IdUser);

PositionsTestsView->Rows->Clear ();

PassedTestsView->Rows->Clear ();

if (! PositionsTestsView->Columns->Contains ("Id"))

{

PositionsTestsView->Columns->Add ("Id", "Id");

}

if (! PositionsTestsView->Columns->Contains ("Name"))

{

PositionsTestsView->Columns->Add ("Name", "Должность");

}

if (! PassedTestsView->Columns->Contains ("Id"))

{

PassedTestsView->Columns->Add ("Id", "Id");

}

if (! PassedTestsView->Columns->Contains ("Name"))

{

PassedTestsView->Columns->Add ("Name", "Должность");

}

if (! PassedTestsView->Columns->Contains ("PostingId"))

{

PassedTestsView->Columns->Add ("PostingId", "PostingId");

}

if (! PassedTestsView->Columns->Contains ("CountPoint"))

{

PassedTestsView->Columns->Add ("CountPoint", "Набраные баллы");

}

if (! PassedTestsView->Columns->Contains ("NeedPoints"))

{

PassedTestsView->Columns->Add ("NeedPoints", "Нужно баллов");

}

if (! PassedTestsView->Columns->Contains ("DatePost"))

{

PassedTestsView->Columns->Add ("DatePost", "Дата сдачи");

}

if (! PassedTestsView->Columns->Contains ("isAccept"))

{

PassedTestsView->Columns->Add ("isAccept", "Статус");

}

int postingId = 0;

int rowIndex = 0;

for each (DataRow ^ row in dt->Select ())

{

if (int:: TryParse (row ["PostingId"] - >ToString (), postingId))

{

rowIndex = PassedTestsView->Rows->Add ();

PassedTestsView->Rows [rowIndex] - >Cells ["PostingId"] - >Value = postingId;

PassedTestsView->Rows [rowIndex] - >Cells ["Name"] - >Value = row ["Name"] - >ToString ();

PassedTestsView->Rows [rowIndex] - >Cells ["Id"] - >Value = row ["Id"] - >ToString ();

PassedTestsView->Rows [rowIndex] - >Cells ["CountPoint"] - >Value = row ["CountPoint"] - >ToString ();

PassedTestsView->Rows [rowIndex] - >Cells ["NeedPoints"] - >Value = row ["NeedPoints"] - >ToString ();

PassedTestsView->Rows [rowIndex] - >Cells ["DatePost"] - >Value = row ["DatePost"] - >ToString ();

PassedTestsView->Rows [rowIndex] - >Cells ["isAccept"] - >Value = int:: Parse (row ["isAccept"] - >ToString ()) >= 0? (int:: Parse (row ["isAccept"] - >ToString ()) > 0?"Принят": "Ожидание"): "Провален";

}

else

{

rowIndex = PositionsTestsView->Rows->Add ();

PositionsTestsView->Rows [rowIndex] - >Cells ["Id"] - >Value = row ["Id"] - >ToString ();

PositionsTestsView->Rows [rowIndex] - >Cells ["Name"] - >Value = row ["Name"] - >ToString ();

}

}

PositionsTestsView->Columns ["Id"] - >Visible = false;

PassedTestsView->Columns ["Id"] - >Visible = false;

PassedTestsView->Columns ["PostingId"] - >Visible = false;

}

private: System:: Void PassTestButton_Click (System:: Object^ sender, System:: EventArgs^ e) {

MySqlInterface ^ msi = gcnew MySqlInterface;

DataGridViewRow ^ row;

try

{

row = PositionsTestsView->SelectedRows [0];

DataTable ^ question = msi->GetTests (int:: Parse (row->Cells ["Id"] - >Value->ToString ()));

DataTable ^ answers;

QuestionAnswers ^ qa = gcnew QuestionAnswers;

try

{

int rowIndex = 0;

int questionIndex = 1;

for each (DataRow ^ rowQuestion in question->Select ())

{

qa = gcnew QuestionAnswers (this->_IdUser, int:: Parse (row->Cells ["Id"] - >Value->ToString ()));

answers = msi->GetAnswers (int:: Parse (rowQuestion ["Id"] - >ToString ()));

qa->Text = "Вопрос " + questionIndex + " из " + question->Rows->Count;

qa->AnswersList->Columns->Add ("QuestionId", "QuestionId");

qa->AnswersList->Columns->Add ("AnswerId", "AnswerId");

qa->AnswersList->Columns->Add ("AnswerText", "Ответ");

qa->QuestionText->Text = rowQuestion ["QuestionText"] - >ToString ();

qa->ShowPicture->ImageLocation = System:: IO:: Directory:: GetCurrentDirectory () + "\\img\\" + rowQuestion ["Pict"];

for each (DataRow ^ rowAnswer in answers->Select ())

{

rowIndex = qa->AnswersList->Rows->Add ();

qa->AnswersList->Rows [rowIndex] - >Cells ["QuestionId"] - >Value = rowAnswer ["QuestionId"] - >ToString ();

qa->AnswersList->Rows [rowIndex] - >Cells ["AnswerId"] - >Value = rowAnswer ["Id"] - >ToString ();

qa->AnswersList->Rows [rowIndex] - >Cells ["AnswerText"] - >Value = rowAnswer ["QuestionText"] - >ToString ();

}

qa->AnswersList->Columns ["QuestionId"] - >Visible = false;

qa->AnswersList->Columns ["AnswerId"] - >Visible = false;

qa->ShowDialog ();

if (qa->Except)

{

throw gcnew Exception;

}

questionIndex++;

}

msi->SaveTestResult (this->_IdUser, int:: Parse (row->Cells ["Id"] - >Value->ToString ()));

MessageBox:: Show ("Тест завершен");

RefreshTests ();

}

catch (Exception ^ e)

{

qa->Close ();

}

}

catch (Exception ^ ex)

{

MessageBox:: Show ("Выберите должность");

}

}

private: System:: Void ShowTestButton_Click (System:: Object^ sender, System:: EventArgs^ e) {

DataGridViewRow ^ row;

try

{

row = PassedTestsView->SelectedRows [0];

TestResults ^ tr = gcnew TestResults (this->_IdUser, this->_IdUser, int:: Parse (row->Cells ["Id"] - >Value->ToString ()));

tr->ShowDialog ();

}

catch (Exception ^ e)

{

MessageBox:: Show ("Выберите тест");

}

}

};

}

#pragma once

#include "MySqlInterface. h"

namespace HR {

using namespace System;

using namespace System:: ComponentModel;

using namespace System:: Collections;

using namespace System:: Windows:: Forms;

using namespace System:: Data;

using namespace System:: Drawing;

// / <summary>

// / Сводка для MeetingForm

// / </summary>

public ref class MeetingForm: public System:: Windows:: Forms:: Form

{

private: int _Id = 0;

private: int _IdUser = 0;

private: System:: String ^ _Day;

private: System:: String ^ _StartTime;

private: System:: String ^ _EndTime;

private: System:: String ^ _ClientName;

private: System:: Windows:: Forms:: ComboBox^ CandidatesList;

private: System:: String ^ _Description;

public:

MeetingForm (void)

{

InitializeComponent ();

//

// TODO: добавьте код конструктора

//

}

MeetingForm (int id, int idUser, System:: String ^ day, System:: String ^ startTime, System:: String ^ endTime, System:: String ^ clientName, System:: String ^ description)

{

this->_Id = id;

this->_IdUser = idUser;

this->_Day = day;

this->_StartTime = startTime;

this->_EndTime = endTime;

this->_ClientName = clientName;

this->_Description = description;

InitializeComponent ();

//

// TODO: добавьте код конструктора

//

}

protected:

// / <summary>

// / Освободить все используемые ресурсы.

// / </summary>

~MeetingForm ()

{

if (components)

{

delete components;

}

}

private: System:: Windows:: Forms:: Label^ DayTitle;

protected:

private: System:: Windows:: Forms:: Label^ BeginTimeTitle;

private: System:: Windows:: Forms:: Label^ EndTimeTitle;

private: System:: Windows:: Forms:: Label^ ClientTitle;

private: System:: Windows:: Forms:: Label^ DescriptionTitle;

protected:

protected:

private: System:: Windows:: Forms:: DateTimePicker^ Day;

private: System:: Windows:: Forms:: DateTimePicker^ BeginTime;

private: System:: Windows:: Forms:: DateTimePicker^ EndTime;

private: System:: Windows:: Forms:: TextBox^ Description;

private: System:: Windows:: Forms:: TextBox^ Id;

private: System:: Windows:: Forms:: Button^ AddMeetingButton;

private: System:: Windows:: Forms:: Button^ CancelMeetingButton;

protected:

private: System:: ComponentModel:: IContainer^ components;

private:

// / <summary>

// / Требуется переменная конструктора.

// / </summary>

#pragma region Windows Form Designer generated code

// / <summary>

// / Обязательный метод для поддержки конструктора - не изменяйте

// / содержимое данного метода при помощи редактора кода.

// / </summary>

void InitializeComponent (void)

{

this->DayTitle = (gcnew System:: Windows:: Forms:: Label ());

this->BeginTimeTitle = (gcnew System:: Windows:: Forms:: Label ());

this->EndTimeTitle = (gcnew System:: Windows:: Forms:: Label ());

this->ClientTitle = (gcnew System:: Windows:: Forms:: Label ());

this->DescriptionTitle = (gcnew System:: Windows:: Forms:: Label ());

this->Day = (gcnew System:: Windows:: Forms:: DateTimePicker ());

this->BeginTime = (gcnew System:: Windows:: Forms:: DateTimePicker ());

this->EndTime = (gcnew System:: Windows:: Forms:: DateTimePicker ());

this->Description = (gcnew System:: Windows:: Forms:: TextBox ());

this->Id = (gcnew System:: Windows:: Forms:: TextBox ());

this->AddMeetingButton = (gcnew System:: Windows:: Forms:: Button ());

this->CancelMeetingButton = (gcnew System:: Windows:: Forms:: Button ());

this->CandidatesList = (gcnew System:: Windows:: Forms:: ComboBox ());

this->SuspendLayout ();

//

// DayTitle

//

this->DayTitle->AutoSize = true;

this->DayTitle->Location = System:: Drawing:: Point (32,12);

this->DayTitle->Name = L"DayTitle";

this->DayTitle->Size = System:: Drawing:: Size (34, 13);

this->DayTitle->TabIndex = 0;

this->DayTitle->Text = L"День";

//

// BeginTimeTitle

//

this->BeginTimeTitle->AutoSize = true;

this->BeginTimeTitle->Location = System:: Drawing:: Point (25, 38);

this->BeginTimeTitle->Name = L"BeginTimeTitle";

this->BeginTimeTitle->Size = System:: Drawing:: Size (44, 13);

this->BeginTimeTitle->TabIndex = 1;

this->BeginTimeTitle->Text = L"Начало";

//

// EndTimeTitle

//

this->EndTimeTitle->AutoSize = true;

this->EndTimeTitle->Location = System:: Drawing:: Point (151, 38);

this->EndTimeTitle->Name = L"EndTimeTitle";

this->EndTimeTitle->Size = System:: Drawing:: Size (38, 13);

this->EndTimeTitle->TabIndex = 2;

this->EndTimeTitle->Text = L"Конец";

//

// ClientTitle

//

this->ClientTitle->AutoSize = true;

this->ClientTitle->Location = System:: Drawing:: Point (23, 64);

this->ClientTitle->Name = L"ClientTitle";

this->ClientTitle->Size = System:: Drawing:: Size (43, 13);

this->ClientTitle->TabIndex = 3;

this->ClientTitle->Text = L"Клиент";

//

// DescriptionTitle

//

this->DescriptionTitle->AutoSize = true;

this->DescriptionTitle->Location = System:: Drawing:: Point (9, 92);

this->DescriptionTitle->Name = L"DescriptionTitle";

this->DescriptionTitle->Size = System:: Drawing:: Size (57, 13);

this->DescriptionTitle->TabIndex = 4;

this->DescriptionTitle->Text = L"Описание";

//

// Day

//

this->Day->Location = System:: Drawing:: Point (72,9);

this->Day->Name = L"Day";

this->Day->Size = System:: Drawing:: Size (200, 20);

this->Day->TabIndex = 6;

//

// BeginTime

//

this->BeginTime->Format = System:: Windows:: Forms:: DateTimePickerFormat:: Time;

this->BeginTime->Location = System:: Drawing:: Point (72, 35);

this->BeginTime->Name = L"BeginTime";

this->BeginTime->ShowUpDown = true;

this->BeginTime->Size = System:: Drawing:: Size (73, 20);

this->BeginTime->TabIndex = 7;

//

// EndTime

//

this->EndTime->Format = System:: Windows:: Forms:: DateTimePickerFormat:: Time;

this->EndTime->Location = System:: Drawing:: Point (195, 35);

this->EndTime->Name = L"EndTime";

this->EndTime->ShowUpDown = true;

this->EndTime->Size = System:: Drawing:: Size (77, 20);

this->EndTime->TabIndex = 8;

//

// Description

//

this->Description->Location = System:: Drawing:: Point (72, 89);

this->Description->MaximumSize = System:: Drawing:: Size (200,4);

this->Description->MinimumSize = System:: Drawing:: Size (4, 45);

this->Description->Multiline = true;

this->Description->Name = L"Description";

this->Description->Size = System:: Drawing:: Size (200, 45);

this->Description->TabIndex = 10;

//

// Id

//

this->Id->Location = System:: Drawing:: Point (52, 113);

this->Id->MaximumSize = System:: Drawing:: Size (200,4);

this->Id->Multiline = true;

this->Id->Name = L"Id";

this->Id->Size = System:: Drawing:: Size (14,4);

this->Id->TabIndex = 11;

this->Id->Text = L"0";

this->Id->Visible = false;

//

// AddMeetingButton

//

this->AddMeetingButton->BackColor = System:: Drawing:: SystemColors:: ControlDarkDark;

this->AddMeetingButton->Location = System:: Drawing:: Point (12, 140);

this->AddMeetingButton->Name = L"AddMeetingButton";

this->AddMeetingButton->Size = System:: Drawing:: Size (123, 23);

this->AddMeetingButton->TabIndex = 12;

this->AddMeetingButton->Text = L"Сохранить";

this->AddMeetingButton->UseVisualStyleBackColor = false;

this->AddMeetingButton->Click += gcnew System:: EventHandler (this, &MeetingForm:: AddMeetingButton_Click);

//

// CancelMeetingButton

//

this->CancelMeetingButton->BackColor = System:: Drawing:: SystemColors:: ControlDarkDark;

this->CancelMeetingButton->Location = System:: Drawing:: Point (153, 140);

this->CancelMeetingButton->Name = L"CancelMeetingButton";

this->CancelMeetingButton->Size = System:: Drawing:: Size (119, 23);

this->CancelMeetingButton->TabIndex = 13;

this->CancelMeetingButton->Text = L"Отменить";

this->CancelMeetingButton->UseVisualStyleBackColor = false;

this->CancelMeetingButton->Click += gcnew System:: EventHandler (this, &MeetingForm:: CancelMeetingButton_Click);

//

// CandidatesList

//

this->CandidatesList->FormattingEnabled = true;

this->CandidatesList->Location = System:: Drawing:: Point (72, 61);

this->CandidatesList->Name = L"CandidatesList";

this->CandidatesList->Size = System:: Drawing:: Size (200, 21);

this->CandidatesList->TabIndex = 14;

//

// MeetingForm

//

this->AutoScaleDimensions = System:: Drawing:: SizeF (6, 13);

this->AutoScaleMode = System:: Windows:: Forms:: AutoScaleMode:: Font;

this->BackColor = System:: Drawing:: SystemColors:: ControlDarkDark;

this->ClientSize = System:: Drawing:: Size (284, 174);

this->Controls->Add (this->CandidatesList);

this->Controls->Add (this->CancelMeetingButton);

this->Controls->Add (this->AddMeetingButton);

this->Controls->Add (this->Id);

this->Controls->Add (this->Description);

this->Controls->Add (this->EndTime);

this->Controls->Add (this->BeginTime);

this->Controls->Add (this->Day);

this->Controls->Add (this->DescriptionTitle);

this->Controls->Add (this->ClientTitle);

this->Controls->Add (this->EndTimeTitle);

this->Controls->Add (this->BeginTimeTitle);

this->Controls->Add (this->DayTitle);

this->ForeColor = System:: Drawing:: SystemColors:: ButtonHighlight;

this->FormBorderStyle = System:: Windows:: Forms:: FormBorderStyle:: FixedToolWindow;

this->Name = L"MeetingForm";

this->StartPosition = System:: Windows:: Forms:: FormStartPosition:: CenterScreen;

this->Text = L"Добавить встречу";

this->Load += gcnew System:: EventHandler (this, &MeetingForm:: MeetingForm_Load);

this->ResumeLayout (false);

this->PerformLayout ();

}

#pragma endregion

private: System:: Void MeetingForm_Load (System:: Object^ sender, System:: EventArgs^ e) {

MySqlInterface ^ msi = gcnew MySqlInterface;

try

{

if (this->_Id > 0)

{

this->Id->Text = "" + this->_Id;

this->Day->Text = this->_Day;

this->BeginTime->Text = this->_StartTime;

this->EndTime->Text = this->_EndTime;

this->CandidatesList->ValueMember = "Id";

this->CandidatesList->DisplayMember = "Name";

this->CandidatesList->DataSource = msi->GetCandidates ();

this->CandidatesList->Text = this->_ClientName;

this->Description->Text = this->_Description;

}

else

{

this->CandidatesList->ValueMember = "Id";

this->CandidatesList->DisplayMember = "Name";

this->CandidatesList->DataSource = msi->GetCandidates ();

this->CandidatesList->SelectedIndex = - 1;

}

}

catch (Exception ^ e)

{

MessageBox:: Show ("Ошибка соединения с базой даных");

}

}

private: System:: Void AddMeetingButton_Click (System:: Object^ sender, System:: EventArgs^ e) {

MySqlInterface ^ msi = gcnew MySqlInterface;

int candidateId = 0;

try

{

msi->AddUpdateMeeting (int:: Parse (this->Id->Text), this->_IdUser, this->Day->Value, this->BeginTime->Value, this->EndTime->Value, int:: Parse (this->CandidatesList->SelectedIndex == - 1?"0": this->CandidatesList->SelectedValue->ToString ()), this->Description->Text);

this->Close ();

}

catch (Exception ^ e)

{

MessageBox:: Show ("Ошибка соединения с базой даных");

}

}

private: System:: Void CancelMeetingButton_Click (System:: Object^ sender, System:: EventArgs^ e) {

this->Close ();

}

};

}

Размещено на Allbest.ru


Подобные документы

Работы в архивах красиво оформлены согласно требованиям ВУЗов и содержат рисунки, диаграммы, формулы и т.д.
PPT, PPTX и PDF-файлы представлены только в архивах.
Рекомендуем скачать работу.