səhifə 4/6 tarix 13.04.2023 ölçüsü 1,31 Mb. #97226
bobur
Asosiy_oyna.h
#pragma once
#include"Form1.h";
#include"Studentlarni_yangilash.h";
#include"Qidirish.h";
#include"TTJ_sinf.h";
namespace TTJ_New {
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 for Asosiy_oyna
///
public ref class Asosiy_oyna : public System::Windows::Forms::Form
{
private: Object^ g_Autentifikatsiya;
public:
Asosiy_oyna(Object^ o)
{
g_Autentifikatsiya = o;
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
///
/// Clean up any resources being used.
///
~Asosiy_oyna()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::Button^ button2;
private: System::Windows::Forms::Button^ button3;
protected:
private:
///
/// Required designer variable.
///
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
void InitializeComponent(void)
{
this->button1 = (gcnew System::Windows::Forms::Button());
this->button2 = (gcnew System::Windows::Forms::Button());
this->button3 = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// button1
//
this->button1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 14.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->button1->Location = System::Drawing::Point(12, 32);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(130, 60);
this->button1->TabIndex = 0;
this->button1->Text = L"O\'zgartirish";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &Asosiy_oyna::button1_Click);
//
// button2
//
this->button2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 14.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->button2->Location = System::Drawing::Point(160, 32);
this->button2->Name = L"button2";
this->button2->Size = System::Drawing::Size(130, 60);
this->button2->TabIndex = 1;
this->button2->Text = L"Qidirish";
this->button2->UseVisualStyleBackColor = true;
this->button2->Click += gcnew System::EventHandler(this, &Asosiy_oyna::button2_Click);
//
// button3
//
this->button3->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 14.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->button3->Location = System::Drawing::Point(307, 32);
this->button3->Name = L"button3";
this->button3->Size = System::Drawing::Size(130, 60);
this->button3->TabIndex = 2;
this->button3->Text = L"Yangilash";
this->button3->UseVisualStyleBackColor = true;
this->button3->Click += gcnew System::EventHandler(this, &Asosiy_oyna::button3_Click);
//
// Asosiy_oyna
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(449, 129);
this->Controls->Add(this->button3);
this->Controls->Add(this->button2);
this->Controls->Add(this->button1);
this->Name = L"Asosiy_oyna";
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
this->Text = L"Asosiy_oyna";
this->FormClosed += gcnew System::Windows::Forms::FormClosedEventHandler(this, &Asosiy_oyna::Asosiy_oyna_FormClosed);
this->ResumeLayout(false);
}
#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
Form1^ ob= gcnew Form1(this);
ob->Show();
this->Hide();
}
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
Qidirish^ ob= gcnew Qidirish(this);
ob->Show();
this->Hide();
}
private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) {
Studentlarni_yangilash^ ob= gcnew Studentlarni_yangilash(this);
ob->Show();
ob->button1->Visible=false;
this->Hide();
}
private: System::Void Asosiy_oyna_FormClosed(System::Object^ sender, System::Windows::Forms::FormClosedEventArgs^ e) {
Application::Exit();
}
};
}
Form1.h
#pragma once
#include"TTJ_sinf.h"
#include"Studentlarni_yangilash.h"
namespace TTJ_New {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::IO;
using namespace System::Data::OleDb;
///
/// Summary for Form1
///
public ref class Form1 : public System::Windows::Forms::Form
{
private: Object^ St;
public:
Form1(Object^ o)
{
St=o;
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
private: System::Windows::Forms::TabControl^ tabControl1;
public:
private: System::Windows::Forms::TabPage^ tabPage1;
private: System::Windows::Forms::TabPage^ tabPage2;
private: System::Windows::Forms::TabPage^ tabPage3;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Label^ label3;
private: System::Windows::Forms::Label^ label4;
private: System::Windows::Forms::Label^ label5;
private: System::Windows::Forms::Label^ label6;
private: System::Windows::Forms::PictureBox^ pictureBox2;
private: System::Windows::Forms::DataGridView^ dataGridView2;
private: System::Windows::Forms::PictureBox^ pictureBox3;
private: System::Windows::Forms::Label^ label7;
private: System::Windows::Forms::Label^ label8;
private: System::Windows::Forms::Label^ label9;
private: System::Windows::Forms::Label^ label10;
private: System::Windows::Forms::Label^ label11;
private: System::Windows::Forms::DataGridView^ dataGridView3;
private: System::Windows::Forms::PictureBox^ pictureBox4;
private: System::Windows::Forms::Label^ label12;
private: System::Windows::Forms::Label^ label13;
private: System::Windows::Forms::Label^ label14;
private: System::Windows::Forms::Label^ label15;
private: System::Windows::Forms::Label^ label16;
private: System::Windows::Forms::Label^ label17;
private: System::Windows::Forms::Label^ label18;
private: System::Windows::Forms::Label^ label19;
private: System::Windows::Forms::Label^ label20;
private: System::Windows::Forms::Label^ label21;
private: System::Windows::Forms::PictureBox^ pictureBox5;
public: TTJ_sinf^ TTJ;
protected:
///
/// Clean up any resources being used.
///
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::DataGridView^ dataGridView1;
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::PictureBox^ pictureBox1;
private: System::Windows::Forms::Button^ button2;
private: System::Windows::Forms::Label^ label1;
protected:
private:
///
/// Required designer variable.
///
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
void InitializeComponent(void)
{
System::Windows::Forms::DataGridViewCellStyle^ dataGridViewCellStyle13 = (gcnew System::Windows::Forms::DataGridViewCellStyle());
System::Windows::Forms::DataGridViewCellStyle^ dataGridViewCellStyle14 = (gcnew System::Windows::Forms::DataGridViewCellStyle());
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
System::Windows::Forms::DataGridViewCellStyle^ dataGridViewCellStyle15 = (gcnew System::Windows::Forms::DataGridViewCellStyle());
System::Windows::Forms::DataGridViewCellStyle^ dataGridViewCellStyle16 = (gcnew System::Windows::Forms::DataGridViewCellStyle());
System::Windows::Forms::DataGridViewCellStyle^ dataGridViewCellStyle17 = (gcnew System::Windows::Forms::DataGridViewCellStyle());
System::Windows::Forms::DataGridViewCellStyle^ dataGridViewCellStyle18 = (gcnew System::Windows::Forms::DataGridViewCellStyle());
this->dataGridView1 = (gcnew System::Windows::Forms::DataGridView());
this->button1 = (gcnew System::Windows::Forms::Button());
this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
this->button2 = (gcnew System::Windows::Forms::Button());
this->label1 = (gcnew System::Windows::Forms::Label());
this->tabControl1 = (gcnew System::Windows::Forms::TabControl());
this->tabPage1 = (gcnew System::Windows::Forms::TabPage());
this->pictureBox2 = (gcnew System::Windows::Forms::PictureBox());
this->tabPage2 = (gcnew System::Windows::Forms::TabPage());
this->dataGridView2 = (gcnew System::Windows::Forms::DataGridView());
this->tabPage3 = (gcnew System::Windows::Forms::TabPage());
this->label2 = (gcnew System::Windows::Forms::Label());
this->label3 = (gcnew System::Windows::Forms::Label());
this->label4 = (gcnew System::Windows::Forms::Label());
this->label5 = (gcnew System::Windows::Forms::Label());
this->label6 = (gcnew System::Windows::Forms::Label());
this->pictureBox3 = (gcnew System::Windows::Forms::PictureBox());
this->label7 = (gcnew System::Windows::Forms::Label());
this->label8 = (gcnew System::Windows::Forms::Label());
this->label9 = (gcnew System::Windows::Forms::Label());
this->label10 = (gcnew System::Windows::Forms::Label());
this->label11 = (gcnew System::Windows::Forms::Label());
this->dataGridView3 = (gcnew System::Windows::Forms::DataGridView());
this->pictureBox4 = (gcnew System::Windows::Forms::PictureBox());
this->label12 = (gcnew System::Windows::Forms::Label());
this->label13 = (gcnew System::Windows::Forms::Label());
this->label14 = (gcnew System::Windows::Forms::Label());
this->label15 = (gcnew System::Windows::Forms::Label());
this->label16 = (gcnew System::Windows::Forms::Label());
this->label17 = (gcnew System::Windows::Forms::Label());
this->label18 = (gcnew System::Windows::Forms::Label());
this->label19 = (gcnew System::Windows::Forms::Label());
this->label20 = (gcnew System::Windows::Forms::Label());
this->label21 = (gcnew System::Windows::Forms::Label());
this->pictureBox5 = (gcnew System::Windows::Forms::PictureBox());
(cli::safe_cast(this->dataGridView1))->BeginInit();
(cli::safe_cast(this->pictureBox1))->BeginInit();
this->tabControl1->SuspendLayout();
this->tabPage1->SuspendLayout();
(cli::safe_cast(this->pictureBox2))->BeginInit();
this->tabPage2->SuspendLayout();
(cli::safe_cast(this->dataGridView2))->BeginInit();
(cli::safe_cast(this->pictureBox3))->BeginInit();
(cli::safe_cast(this->dataGridView3))->BeginInit();
(cli::safe_cast(this->pictureBox4))->BeginInit();
(cli::safe_cast(this->pictureBox5))->BeginInit();
this->SuspendLayout();
//
// dataGridView1
//
this->dataGridView1->AllowDrop = true;
this->dataGridView1->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
this->dataGridView1->ColumnHeadersBorderStyle = System::Windows::Forms::DataGridViewHeaderBorderStyle::Sunken;
dataGridViewCellStyle13->Alignment = System::Windows::Forms::DataGridViewContentAlignment::MiddleLeft;
dataGridViewCellStyle13->BackColor = System::Drawing::Color::Blue;
dataGridViewCellStyle13->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12.25F));
dataGridViewCellStyle13->ForeColor = System::Drawing::SystemColors::WindowText;
dataGridViewCellStyle13->SelectionBackColor = System::Drawing::SystemColors::Highlight;
dataGridViewCellStyle13->SelectionForeColor = System::Drawing::Color::Blue;
dataGridViewCellStyle13->WrapMode = System::Windows::Forms::DataGridViewTriState::True;
this->dataGridView1->ColumnHeadersDefaultCellStyle = dataGridViewCellStyle13;
this->dataGridView1->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
this->dataGridView1->GridColor = System::Drawing::SystemColors::ActiveCaption;
this->dataGridView1->ImeMode = System::Windows::Forms::ImeMode::AlphaFull;
this->dataGridView1->Location = System::Drawing::Point(7, 8);
this->dataGridView1->Margin = System::Windows::Forms::Padding(4, 5, 4, 5);
this->dataGridView1->Name = L"dataGridView1";
dataGridViewCellStyle14->BackColor = System::Drawing::SystemColors::ButtonHighlight;
this->dataGridView1->RowsDefaultCellStyle = dataGridViewCellStyle14;
this->dataGridView1->SelectionMode = System::Windows::Forms::DataGridViewSelectionMode::FullRowSelect;
this->dataGridView1->Size = System::Drawing::Size(1029, 250);
this->dataGridView1->TabIndex = 0;
this->dataGridView1->SelectionChanged += gcnew System::EventHandler(this, &Form1::dataGridView1_SelectionChanged);
this->dataGridView1->Click += gcnew System::EventHandler(this, &Form1::dataGridView1_Click);
this->dataGridView1->DoubleClick += gcnew System::EventHandler(this, &Form1::dataGridView1_DoubleClick);
this->dataGridView1->MouseMove += gcnew System::Windows::Forms::MouseEventHandler(this, &Form1::dataGridView1_MouseMove);
//
// button1
//
this->button1->Location = System::Drawing::Point(292, 435);
this->button1->Margin = System::Windows::Forms::Padding(4, 5, 4, 5);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(112, 35);
this->button1->TabIndex = 1;
this->button1->Text = L"Yuklash";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
//
// pictureBox1
//
this->pictureBox1->Image = (cli::safe_cast(resources->GetObject(L"pictureBox1.Image")));
this->pictureBox1->Location = System::Drawing::Point(13, 3);
this->pictureBox1->Margin = System::Windows::Forms::Padding(4, 5, 4, 5);
this->pictureBox1->Name = L"pictureBox1";
this->pictureBox1->Size = System::Drawing::Size(133, 121);
this->pictureBox1->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
this->pictureBox1->TabIndex = 2;
this->pictureBox1->TabStop = false;
this->pictureBox1->WaitOnLoad = true;
this->pictureBox1->Click += gcnew System::EventHandler(this, &Form1::pictureBox1_Click);
//
// button2
//
this->button2->Location = System::Drawing::Point(456, 435);
this->button2->Margin = System::Windows::Forms::Padding(4, 5, 4, 5);
this->button2->Name = L"button2";
this->button2->Size = System::Drawing::Size(112, 35);
this->button2->TabIndex = 3;
this->button2->Text = L"Insert";
this->button2->UseVisualStyleBackColor = true;
this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(93, 454);
this->label1->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(53, 20);
this->label1->TabIndex = 5;
this->label1->Text = L"label1";
this->label1->Visible = false;
//
// tabControl1
//
this->tabControl1->Controls->Add(this->tabPage1);
this->tabControl1->Controls->Add(this->tabPage2);
this->tabControl1->Controls->Add(this->tabPage3);
this->tabControl1->Location = System::Drawing::Point(12, 132);
this->tabControl1->Name = L"tabControl1";
this->tabControl1->SelectedIndex = 0;
this->tabControl1->Size = System::Drawing::Size(1048, 299);
this->tabControl1->TabIndex = 2;
//
// tabPage1
//
this->tabPage1->Controls->Add(this->pictureBox2);
this->tabPage1->Controls->Add(this->dataGridView1);
this->tabPage1->Location = System::Drawing::Point(4, 29);
this->tabPage1->Name = L"tabPage1";
this->tabPage1->Padding = System::Windows::Forms::Padding(3);
this->tabPage1->Size = System::Drawing::Size(1040, 266);
this->tabPage1->TabIndex = 0;
this->tabPage1->Text = L"Talabalar jadvali";
this->tabPage1->UseVisualStyleBackColor = true;
//
// pictureBox2
//
this->pictureBox2->Image = (cli::safe_cast(resources->GetObject(L"pictureBox2.Image")));
this->pictureBox2->Location = System::Drawing::Point(607, 73);
this->pictureBox2->Margin = System::Windows::Forms::Padding(4, 5, 4, 5);
this->pictureBox2->Name = L"pictureBox2";
this->pictureBox2->Size = System::Drawing::Size(133, 121);
this->pictureBox2->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
this->pictureBox2->TabIndex = 8;
this->pictureBox2->TabStop = false;
this->pictureBox2->Visible = false;
this->pictureBox2->WaitOnLoad = true;
//
// tabPage2
//
this->tabPage2->Controls->Add(this->dataGridView2);
this->tabPage2->Location = System::Drawing::Point(4, 29);
this->tabPage2->Name = L"tabPage2";
this->tabPage2->Padding = System::Windows::Forms::Padding(3);
this->tabPage2->Size = System::Drawing::Size(1040, 266);
this->tabPage2->TabIndex = 1;
this->tabPage2->Text = L"Qarindoshlar jadvali";
this->tabPage2->UseVisualStyleBackColor = true;
//
// dataGridView2
//
this->dataGridView2->AllowDrop = true;
this->dataGridView2->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
this->dataGridView2->ColumnHeadersBorderStyle = System::Windows::Forms::DataGridViewHeaderBorderStyle::Sunken;
dataGridViewCellStyle15->Alignment = System::Windows::Forms::DataGridViewContentAlignment::MiddleLeft;
dataGridViewCellStyle15->BackColor = System::Drawing::Color::Blue;
dataGridViewCellStyle15->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12.25F));
dataGridViewCellStyle15->ForeColor = System::Drawing::SystemColors::WindowText;
dataGridViewCellStyle15->SelectionBackColor = System::Drawing::SystemColors::Highlight;
dataGridViewCellStyle15->SelectionForeColor = System::Drawing::Color::Blue;
dataGridViewCellStyle15->WrapMode = System::Windows::Forms::DataGridViewTriState::True;
this->dataGridView2->ColumnHeadersDefaultCellStyle = dataGridViewCellStyle15;
this->dataGridView2->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
this->dataGridView2->GridColor = System::Drawing::SystemColors::ActiveCaption;
this->dataGridView2->ImeMode = System::Windows::Forms::ImeMode::AlphaFull;
this->dataGridView2->Location = System::Drawing::Point(8, 8);
this->dataGridView2->Margin = System::Windows::Forms::Padding(4, 5, 4, 5);
this->dataGridView2->Name = L"dataGridView2";
dataGridViewCellStyle16->BackColor = System::Drawing::SystemColors::ButtonHighlight;
this->dataGridView2->RowsDefaultCellStyle = dataGridViewCellStyle16;
this->dataGridView2->SelectionMode = System::Windows::Forms::DataGridViewSelectionMode::FullRowSelect;
this->dataGridView2->Size = System::Drawing::Size(1025, 250);
this->dataGridView2->TabIndex = 1;
this->dataGridView2->SelectionChanged += gcnew System::EventHandler(this, &Form1::dataGridView2_SelectionChanged);
this->dataGridView2->Click += gcnew System::EventHandler(this, &Form1::dataGridView2_Click);
this->dataGridView2->DoubleClick += gcnew System::EventHandler(this, &Form1::dataGridView2_DoubleClick);
//
// tabPage3
//
this->tabPage3->Location = System::Drawing::Point(4, 29);
this->tabPage3->Name = L"tabPage3";
this->tabPage3->Padding = System::Windows::Forms::Padding(3);
this->tabPage3->Size = System::Drawing::Size(1040, 266);
this->tabPage3->TabIndex = 2;
this->tabPage3->Text = L"Bino xonalari jadvali";
this->tabPage3->UseVisualStyleBackColor = true;
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System::Drawing::Point(154, 9);
this->label2->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(53, 20);
this->label2->TabIndex = 7;
this->label2->Text = L"label2";
//
// label3
//
this->label3->AutoSize = true;
this->label3->Location = System::Drawing::Point(154, 30);
this->label3->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label3->Name = L"label3";
this->label3->Size = System::Drawing::Size(53, 20);
this->label3->TabIndex = 7;
this->label3->Text = L"label2";
//
// label4
//
this->label4->AutoSize = true;
this->label4->Location = System::Drawing::Point(154, 51);
this->label4->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label4->Name = L"label4";
this->label4->Size = System::Drawing::Size(53, 20);
this->label4->TabIndex = 7;
this->label4->Text = L"label2";
//
// label5
//
this->label5->AutoSize = true;
this->label5->Location = System::Drawing::Point(154, 73);
this->label5->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label5->Name = L"label5";
this->label5->Size = System::Drawing::Size(53, 20);
this->label5->TabIndex = 7;
this->label5->Text = L"label2";
//
// label6
//
this->label6->AutoSize = true;
this->label6->Location = System::Drawing::Point(154, 96);
this->label6->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label6->Name = L"label6";
this->label6->Size = System::Drawing::Size(53, 20);
this->label6->TabIndex = 7;
this->label6->Text = L"label2";
//
// pictureBox3
//
this->pictureBox3->Image = (cli::safe_cast(resources->GetObject(L"pictureBox3.Image")));
this->pictureBox3->Location = System::Drawing::Point(265, 3);
this->pictureBox3->Margin = System::Windows::Forms::Padding(4, 5, 4, 5);
this->pictureBox3->Name = L"pictureBox3";
this->pictureBox3->Size = System::Drawing::Size(133, 121);
this->pictureBox3->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
this->pictureBox3->TabIndex = 2;
this->pictureBox3->TabStop = false;
this->pictureBox3->WaitOnLoad = true;
this->pictureBox3->Click += gcnew System::EventHandler(this, &Form1::pictureBox1_Click);
//
// label7
//
this->label7->AutoSize = true;
this->label7->Location = System::Drawing::Point(406, 9);
this->label7->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label7->Name = L"label7";
this->label7->Size = System::Drawing::Size(53, 20);
this->label7->TabIndex = 7;
this->label7->Text = L"label2";
//
// label8
//
this->label8->AutoSize = true;
this->label8->Location = System::Drawing::Point(406, 30);
this->label8->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label8->Name = L"label8";
this->label8->Size = System::Drawing::Size(53, 20);
this->label8->TabIndex = 7;
this->label8->Text = L"label2";
//
// label9
//
this->label9->AutoSize = true;
this->label9->Location = System::Drawing::Point(406, 51);
this->label9->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label9->Name = L"label9";
this->label9->Size = System::Drawing::Size(53, 20);
this->label9->TabIndex = 7;
this->label9->Text = L"label2";
//
// label10
//
this->label10->AutoSize = true;
this->label10->Location = System::Drawing::Point(406, 73);
this->label10->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label10->Name = L"label10";
this->label10->Size = System::Drawing::Size(53, 20);
this->label10->TabIndex = 7;
this->label10->Text = L"label2";
//
// label11
//
this->label11->AutoSize = true;
this->label11->Location = System::Drawing::Point(406, 96);
this->label11->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label11->Name = L"label11";
this->label11->Size = System::Drawing::Size(53, 20);
this->label11->TabIndex = 7;
this->label11->Text = L"label2";
//
// dataGridView3
//
this->dataGridView3->AllowDrop = true;
this->dataGridView3->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
this->dataGridView3->ColumnHeadersBorderStyle = System::Windows::Forms::DataGridViewHeaderBorderStyle::Sunken;
dataGridViewCellStyle17->Alignment = System::Windows::Forms::DataGridViewContentAlignment::MiddleLeft;
dataGridViewCellStyle17->BackColor = System::Drawing::Color::Blue;
dataGridViewCellStyle17->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12.25F));
dataGridViewCellStyle17->ForeColor = System::Drawing::SystemColors::WindowText;
dataGridViewCellStyle17->SelectionBackColor = System::Drawing::SystemColors::Highlight;
dataGridViewCellStyle17->SelectionForeColor = System::Drawing::Color::Blue;
dataGridViewCellStyle17->WrapMode = System::Windows::Forms::DataGridViewTriState::True;
this->dataGridView3->ColumnHeadersDefaultCellStyle = dataGridViewCellStyle17;
this->dataGridView3->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
this->dataGridView3->GridColor = System::Drawing::SystemColors::ActiveCaption;
this->dataGridView3->ImeMode = System::Windows::Forms::ImeMode::AlphaFull;
this->dataGridView3->Location = System::Drawing::Point(772, 435);
this->dataGridView3->Margin = System::Windows::Forms::Padding(4, 5, 4, 5);
this->dataGridView3->Name = L"dataGridView3";
dataGridViewCellStyle18->BackColor = System::Drawing::SystemColors::ButtonHighlight;
this->dataGridView3->RowsDefaultCellStyle = dataGridViewCellStyle18;
this->dataGridView3->SelectionMode = System::Windows::Forms::DataGridViewSelectionMode::FullRowSelect;
this->dataGridView3->Size = System::Drawing::Size(168, 59);
this->dataGridView3->TabIndex = 8;
this->dataGridView3->Visible = false;
//
// pictureBox4
//
this->pictureBox4->Image = (cli::safe_cast(resources->GetObject(L"pictureBox4.Image")));
this->pictureBox4->Location = System::Drawing::Point(525, 3);
this->pictureBox4->Margin = System::Windows::Forms::Padding(4, 5, 4, 5);
this->pictureBox4->Name = L"pictureBox4";
this->pictureBox4->Size = System::Drawing::Size(133, 121);
this->pictureBox4->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
this->pictureBox4->TabIndex = 2;
this->pictureBox4->TabStop = false;
this->pictureBox4->WaitOnLoad = true;
this->pictureBox4->Click += gcnew System::EventHandler(this, &Form1::pictureBox1_Click);
//
// label12
//
this->label12->AutoSize = true;
this->label12->Location = System::Drawing::Point(666, 9);
this->label12->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label12->Name = L"label12";
this->label12->Size = System::Drawing::Size(53, 20);
this->label12->TabIndex = 7;
this->label12->Text = L"label2";
//
// label13
//
this->label13->AutoSize = true;
this->label13->Location = System::Drawing::Point(666, 30);
this->label13->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label13->Name = L"label13";
this->label13->Size = System::Drawing::Size(53, 20);
this->label13->TabIndex = 7;
this->label13->Text = L"label2";
//
// label14
//
this->label14->AutoSize = true;
this->label14->Location = System::Drawing::Point(666, 51);
this->label14->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label14->Name = L"label14";
this->label14->Size = System::Drawing::Size(53, 20);
this->label14->TabIndex = 7;
this->label14->Text = L"label2";
//
// label15
//
this->label15->AutoSize = true;
this->label15->Location = System::Drawing::Point(666, 73);
this->label15->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label15->Name = L"label15";
this->label15->Size = System::Drawing::Size(53, 20);
this->label15->TabIndex = 7;
this->label15->Text = L"label2";
//
// label16
//
this->label16->AutoSize = true;
this->label16->Location = System::Drawing::Point(666, 96);
this->label16->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label16->Name = L"label16";
this->label16->Size = System::Drawing::Size(53, 20);
this->label16->TabIndex = 7;
this->label16->Text = L"label2";
//
// label17
//
this->label17->AutoSize = true;
this->label17->Location = System::Drawing::Point(926, 9);
this->label17->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label17->Name = L"label17";
this->label17->Size = System::Drawing::Size(53, 20);
this->label17->TabIndex = 10;
this->label17->Text = L"label2";
//
// label18
//
this->label18->AutoSize = true;
this->label18->Location = System::Drawing::Point(926, 30);
this->label18->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label18->Name = L"label18";
this->label18->Size = System::Drawing::Size(53, 20);
this->label18->TabIndex = 11;
this->label18->Text = L"label2";
//
// label19
//
this->label19->AutoSize = true;
this->label19->Location = System::Drawing::Point(926, 51);
this->label19->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label19->Name = L"label19";
this->label19->Size = System::Drawing::Size(53, 20);
this->label19->TabIndex = 12;
this->label19->Text = L"label2";
//
// label20
//
this->label20->AutoSize = true;
this->label20->Location = System::Drawing::Point(926, 73);
this->label20->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label20->Name = L"label20";
this->label20->Size = System::Drawing::Size(53, 20);
this->label20->TabIndex = 13;
this->label20->Text = L"label2";
//
// label21
//
this->label21->AutoSize = true;
this->label21->Location = System::Drawing::Point(926, 96);
this->label21->Margin = System::Windows::Forms::Padding(4, 0, 4, 0);
this->label21->Name = L"label21";
this->label21->Size = System::Drawing::Size(53, 20);
this->label21->TabIndex = 14;
this->label21->Text = L"label2";
//
// pictureBox5
//
this->pictureBox5->Image = (cli::safe_cast(resources->GetObject(L"pictureBox5.Image")));
this->pictureBox5->Location = System::Drawing::Point(785, 3);
this->pictureBox5->Margin = System::Windows::Forms::Padding(4, 5, 4, 5);
this->pictureBox5->Name = L"pictureBox5";
this->pictureBox5->Size = System::Drawing::Size(133, 121);
this->pictureBox5->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
this->pictureBox5->TabIndex = 9;
this->pictureBox5->TabStop = false;
this->pictureBox5->WaitOnLoad = true;
//
// Form1
//
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::None;
this->AutoSize = true;
this->AutoValidate = System::Windows::Forms::AutoValidate::Disable;
this->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
this->ClientSize = System::Drawing::Size(1062, 475);
this->Controls->Add(this->label17);
this->Controls->Add(this->label18);
this->Controls->Add(this->label19);
this->Controls->Add(this->label20);
this->Controls->Add(this->label21);
this->Controls->Add(this->pictureBox5);
this->Controls->Add(this->dataGridView3);
this->Controls->Add(this->label16);
this->Controls->Add(this->label11);
this->Controls->Add(this->label6);
this->Controls->Add(this->label15);
this->Controls->Add(this->label10);
this->Controls->Add(this->label5);
this->Controls->Add(this->label14);
this->Controls->Add(this->label9);
this->Controls->Add(this->label4);
this->Controls->Add(this->label13);
this->Controls->Add(this->label8);
this->Controls->Add(this->label3);
this->Controls->Add(this->label12);
this->Controls->Add(this->label7);
this->Controls->Add(this->label2);
this->Controls->Add(this->tabControl1);
this->Controls->Add(this->label1);
this->Controls->Add(this->button2);
this->Controls->Add(this->pictureBox4);
this->Controls->Add(this->pictureBox3);
this->Controls->Add(this->pictureBox1);
this->Controls->Add(this->button1);
this->DoubleBuffered = true;
this->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12.25F));
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::Fixed3D;
this->HelpButton = true;
this->Margin = System::Windows::Forms::Padding(4, 5, 4, 5);
this->MaximizeBox = false;
this->MinimizeBox = false;
this->Name = L"Form1";
this->StartPosition = System::Windows::Forms::FormStartPosition::Manual;
this->Text = L"TTJ ma\'lumotlar bazasi";
this->FormClosed += gcnew System::Windows::Forms::FormClosedEventHandler(this, &Form1::Form1_FormClosed);
this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
(cli::safe_cast(this->dataGridView1))->EndInit();
(cli::safe_cast(this->pictureBox1))->EndInit();
this->tabControl1->ResumeLayout(false);
this->tabPage1->ResumeLayout(false);
(cli::safe_cast(this->pictureBox2))->EndInit();
this->tabPage2->ResumeLayout(false);
(cli::safe_cast(this->dataGridView2))->EndInit();
(cli::safe_cast(this->pictureBox3))->EndInit();
(cli::safe_cast(this->dataGridView3))->EndInit();
(cli::safe_cast(this->pictureBox4))->EndInit();
(cli::safe_cast(this->pictureBox5))->EndInit();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
String^ Select_Komand;
public: Image^ loadFoto(array^ Rasm){
MemoryStream^ ms=gcnew MemoryStream(Rasm);
return Image::FromStream(ms);
}
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
// String ^satr="SELECT * FROM [Talabalar]"; // WHERE (Fam LIKE '%M%')";
//DBSet(satr);
Select_Komand="Select id, Fam, Ism, Sharf, Guruh, Bosqich,Tugilgan_viloyati, Pasport_seriasi,"+
"Tugilgan_Sana, Pasport_nomeri, Xona_nomeri, Blok_nomi, Qavat_nomeri, Lavozim, Telefoni, Tugilgan_yili,"+
"Tugilgan_oyi, Tugilgan_kuni, Jinsi, Fakulteti, Yonalishi, Tugilgan_tumani, Yashash_manzili From Talabalar";
TTJ = gcnew TTJ_sinf();
TTJ->ShowRecord(dataGridView1,"Select * From Talabalar");
TTJ->ShowRecord(dataGridView2,"Select * From Qarindoshlar");
delete TTJ;
}
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
//button1->Text="Qidirish";
}
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
// ornatish();
}
private: System::Void pictureBox1_Click(System::Object^ sender, System::EventArgs^ e) {
}
void yangilash(int id, int h){
this->Hide();
Studentlarni_yangilash^ ob= gcnew Studentlarni_yangilash(this);
if(h==1){
try{
ob->pictureBox1->Image =loadFoto((array^) dataGridView1->Rows[id]->Cells["Rasm"]->Value);
}
catch(Exception^ vaziyat){
}
ob->textBox1->Text= dataGridView1->Rows[id]->Cells[1]->Value->ToString();
ob->textBox2->Text= dataGridView1->Rows[id]->Cells[2]->Value->ToString();
ob->textBox3->Text= dataGridView1->Rows[id]->Cells[3]->Value->ToString();
ob->textBox4->Text= dataGridView1->Rows[id]->Cells[4]->Value->ToString();
ob->textBox5->Text= dataGridView1->Rows[id]->Cells[10]->Value->ToString();
ob->textBox6->Text= dataGridView1->Rows[id]->Cells[11]->Value->ToString();
ob->textBox7->Text= dataGridView1->Rows[id]->Cells[12]->Value->ToString();
ob->textBox8->Text= dataGridView1->Rows[id]->Cells[14]->Value->ToString();
ob->textBox9->Text= dataGridView1->Rows[id]->Cells[6]->Value->ToString();
ob->textBox10->Text= dataGridView1->Rows[id]->Cells[7]->Value->ToString();
ob->textBox11->Text= dataGridView1->Rows[id]->Cells[8]->Value->ToString();
ob->textBox13->Text= dataGridView1->Rows[id]->Cells[9]->Value->ToString();
ob->textBox14->Text= dataGridView1->Rows[id]->Cells[15]->Value->ToString();
ob->textBox15->Text= dataGridView1->Rows[id]->Cells[16]->Value->ToString();
ob->textBox16->Text= dataGridView1->Rows[id]->Cells[17]->Value->ToString();
ob->textBox20->Text= dataGridView1->Rows[id]->Cells[19]->Value->ToString();
ob->textBox21->Text= dataGridView1->Rows[id]->Cells[20]->Value->ToString();
ob->textBox22->Text= dataGridView1->Rows[id]->Cells[21]->Value->ToString();
ob->textBox23->Text= dataGridView1->Rows[id]->Cells[18]->Value->ToString();
ob->textBox24->Text= dataGridView1->Rows[id]->Cells[13]->Value->ToString();
ob->textBox12->Text= dataGridView1->Rows[id]->Cells[22]->Value->ToString();
ob->textBox17->Text= dataGridView1->Rows[id]->Cells[5]->Value->ToString();
ob->Kornat=1;
ob->Id=Id;
ob->label18->Text=ob->Id.ToString();}
else if(h==2){
try{
ob->pictureBox1->Image =loadFoto((array^) dataGridView3->Rows[-0]->Cells[""]->Value);
}
catch(Exception^ vaziyat){
}
ob->textBox1->Text= dataGridView2->Rows[id]->Cells[1]->Value->ToString();
ob->textBox2->Text= dataGridView2->Rows[id]->Cells[2]->Value->ToString();
ob->textBox3->Text= dataGridView2->Rows[id]->Cells[3]->Value->ToString();
ob->label4->Text = "Yashash manzili:";
ob->textBox4->Text= dataGridView2->Rows[id]->Cells[4]->Value->ToString();
ob->label5->Text = "Tugilgan san:";
ob->textBox5->Text= dataGridView2->Rows[id]->Cells[5]->Value->ToString();
ob->label6->Text = "Qarindosh_turi:";
ob->textBox6->Text= dataGridView2->Rows[id]->Cells[6]->Value->ToString();
ob->label7->Text = "Id nomeri:";
ob->textBox7->Text= dataGridView2->Rows[id]->Cells[7]->Value->ToString();
ob->label8->Text = "Ish joyi:";
ob->textBox8->Text= dataGridView2->Rows[id]->Cells[8]->Value->ToString();
ob->label16->Text = "Telefoni:";
ob->textBox9->Text= dataGridView2->Rows[id]->Cells[9]->Value->ToString();
ob->label9->Text = "";
ob->label10->Text = "";
ob->label11->Text = "";
ob->label12->Text = "";
ob->label13->Text = "";
ob->label14->Text = "";
ob->label15->Text = "";
ob->label17->Text = "";
ob->label18->Text = "";
ob->label20->Text = "";
ob->label21->Text = "";
ob->label22->Text = "";
ob->label23->Text = "";
ob->label24->Text = "";
ob->Kornat=2;
ob->Id=Id;
ob->label18->Text=ob->Id.ToString();
}
//MessageBox::Show("Xato maydon bosh");}
ob->ShowDialog();
}
int Id;
private: System::Void dataGridView1_DoubleClick(System::Object^ sender, System::EventArgs^ e) {
int rowToUpdate = dataGridView1->Rows->GetFirstRow(DataGridViewElementStates::Selected);
try{ int id = Convert::ToInt32(dataGridView1->Rows[rowToUpdate]->Cells["id"]->Value);
label1->Text = id.ToString();
Id=id;
yangilash(id-1,1);
}
catch(Exception ^v){MessageBox::Show("jjjj");}
}
private: System::Void dataGridView1_Click(System::Object^ sender, System::EventArgs^ e) {
//try{
pictureBox3->Visible = true; pictureBox4->Visible = true;
bool d, b,q;
int rowToUpdate = dataGridView1->Rows->GetFirstRow(DataGridViewElementStates::Selected);
//MessageBox::Show(rowToUpdate.ToString());
int id = Convert::ToInt32(dataGridView1->Rows[rowToUpdate]->Cells["id"]->Value);
Id=id;
String ^ xona_nomeri = dataGridView1->Rows[id-1]->Cells["Xona_nomeri"]->Value->ToString();
String ^satr="SELECT * FROM [Talabalar] Where (Xona_nomeri="+xona_nomeri+")";
// WHERE (Fam LIKE '%M%')";
qidirish(satr);
try{ pictureBox1->Image =loadFoto((array^) dataGridView3->Rows[0]->Cells["Rasm"]->Value);
pictureBox1->Visible = true;
label2->Text = dataGridView3->Rows[-0]->Cells["Fam"]->Value->ToString();
label3->Text = dataGridView3->Rows[-0]->Cells["Ism"]->Value->ToString();
label4->Text = dataGridView3->Rows[-0]->Cells["Tugilgan_yili"]->Value->ToString()+" yil";
label5->Text = dataGridView3->Rows[-0]->Cells["Tugilgan_viloyati"]->Value->ToString();
label6->Text = dataGridView3->Rows[-0]->Cells["Xona_nomeri"]->Value->ToString()+" xona";
}
catch(Exception^ vaziyat){pictureBox1->Image = pictureBox2->Image;
label2->Text = " ";
label3->Text = " ";
label4->Text = " ";
label5->Text = " ";
label6->Text = " "; d=1; pictureBox1->Visible = false;
//MessageBox::Show("xato");
}
try{pictureBox3->Image =loadFoto((array^) dataGridView3->Rows[1]->Cells["Rasm"]->Value);
pictureBox3->Visible = true;
label7->Text = dataGridView3->Rows[1]->Cells["Fam"]->Value->ToString();
label8->Text = dataGridView3->Rows[1]->Cells["Ism"]->Value->ToString();
label9->Text = dataGridView3->Rows[1]->Cells["Tugilgan_yili"]->Value->ToString()+" yil";
label10->Text = dataGridView3->Rows[1]->Cells["Tugilgan_viloyati"]->Value->ToString();
label11->Text = dataGridView3->Rows[1]->Cells["Xona_nomeri"]->Value->ToString()+" xona";
}
catch(Exception^ vaziyat){ pictureBox3->Image = pictureBox2->Image; //MessageBox::Show("xato");
label7->Text = " ";
label8->Text = " ";
label9->Text = " ";
label10->Text = " ";
label11->Text = " "; b=1; pictureBox3->Visible = false;
}
try{pictureBox4->Image =loadFoto((array^) dataGridView3->Rows[2]->Cells["Rasm"]->Value);
pictureBox4->Visible = true;
label12->Text = dataGridView3->Rows[2]->Cells["Fam"]->Value->ToString();
label13->Text = dataGridView3->Rows[2]->Cells["Ism"]->Value->ToString();
label14->Text = dataGridView3->Rows[2]->Cells["Tugilgan_yili"]->Value->ToString()+" yil";
label15->Text = dataGridView3->Rows[2]->Cells["Tugilgan_viloyati"]->Value->ToString();
label16->Text = dataGridView3->Rows[2]->Cells["Xona_nomeri"]->Value->ToString()+" xona";
}
catch(Exception^ vaziyat){ pictureBox4->Image = pictureBox2->Image; //MessageBox::Show("xato");
label12->Text = " ";
label13->Text = " ";
label14->Text = " ";
label15->Text = " ";
label16->Text = " "; q=1; pictureBox4->Visible = false;
}
try{pictureBox5->Image =loadFoto((array^) dataGridView3->Rows[2]->Cells["Rasm"]->Value);
pictureBox5->Visible = true;
label17->Text = dataGridView3->Rows[3]->Cells["Fam"]->Value->ToString();
label18->Text = dataGridView3->Rows[3]->Cells["Ism"]->Value->ToString();
label19->Text = dataGridView3->Rows[3]->Cells["Tugilgan_yili"]->Value->ToString()+" yil";
label20->Text = dataGridView3->Rows[3]->Cells["Tugilgan_viloyati"]->Value->ToString();
label21->Text = dataGridView3->Rows[3]->Cells["Xona_nomeri"]->Value->ToString()+" xona";
}
catch(Exception^ vaziyat){ pictureBox5->Image = pictureBox2->Image; //MessageBox::Show("xato");
label17->Text = " ";
label18->Text = " ";
label19->Text = " ";
label20->Text = " ";
label21->Text = " "; q=1; pictureBox5->Visible = false;
}
if(d==1 && b==1 && q==1){
try{
int rowToUpdate_2 = dataGridView1->Rows->GetFirstRow(DataGridViewElementStates::Selected);
int id_2 = Convert::ToInt32(dataGridView1->Rows[rowToUpdate_2]->Cells["id"]->Value);
Id=id_2;
try{ pictureBox1->Image =loadFoto((array^) dataGridView1->Rows[id-1]->Cells["Rasm"]->Value);}
catch(Exception^ vaziyat){pictureBox1->Image = pictureBox2->Image; //MessageBox::Show("xato");
}
label2->Text = dataGridView1->Rows[id-1]->Cells[1]->Value->ToString();
label3->Text = dataGridView1->Rows[id-1]->Cells[2]->Value->ToString();
label4->Text = dataGridView1->Rows[id-1]->Cells[15]->Value->ToString()+" yil";
label5->Text = dataGridView1->Rows[id-1]->Cells[6]->Value->ToString();
label6->Text = dataGridView1->Rows[id-1]->Cells[10]->Value->ToString()+" xona";}
catch(Exception^ vaziyat){}
}
//}
//catch(Exception^ vaziyat){}//pictureBox1->Image->FromFile("user-192.png");}
}
private: System::Void dataGridView1_MouseMove(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) {
}
public: System::Void qidirish(String ^s){
auto Ulanish = gcnew OleDb::OleDbConnection( "Data Source=\"TTJ.mdb\";User " +
"ID=Admin;Provider=\"Microsoft.Jet.OLEDB.4.0\";");
Ulanish->Open();
auto Команда = gcnew OleDb::OleDbCommand(s, Ulanish);
// Adapter синфи объектини яратамиз ва SQL-сўровини //амалга оширамиз
auto Адаптер = gcnew OleDb::OleDbDataAdapter(Команда);
// DataSet синфи объектини яратамиз
auto НаборДанных = gcnew DataSet();
// DataSet ни SQL-сўровини натижалари билан //тўлдирамиз
Адаптер->Fill(НаборДанных, "talaba");
// DataSet да сатрлар кўриниши учун XML кўринишига //ўтади:
//auto СтрокаXML = НаборДанных->GetXml();
// Компонентага маълумот манбасини кўрсатамиз:
dataGridView3->DataSource = НаборДанных;
// Қидириладиган малумотларнинг жадвалини номини //кўрсатамиз:
dataGridView3->DataMember = "talaba";
Ulanish->Close();
}
private: System::Void dataGridView1_SelectionChanged(System::Object^ sender, System::EventArgs^ e) {
pictureBox3->Visible = true; pictureBox4->Visible = true;
try{
bool d, b,q;
int rowToUpdate = dataGridView1->Rows->GetFirstRow(DataGridViewElementStates::Selected);
int id = Convert::ToInt32(dataGridView1->Rows[rowToUpdate]->Cells["id"]->Value);
Id=id;
String ^ xona_nomeri = dataGridView1->Rows[id-1]->Cells["Xona_nomeri"]->Value->ToString();
String ^satr="SELECT * FROM [Talabalar] Where (Xona_nomeri="+xona_nomeri+")";
// WHERE (Fam LIKE '%M%')";
qidirish(satr);
try{ pictureBox1->Image =loadFoto((array^) dataGridView3->Rows[0]->Cells["Rasm"]->Value);
pictureBox1->Visible = true;
label2->Text = dataGridView3->Rows[-0]->Cells["Fam"]->Value->ToString();
label3->Text = dataGridView3->Rows[-0]->Cells["Ism"]->Value->ToString();
label4->Text = dataGridView3->Rows[-0]->Cells["Tugilgan_yili"]->Value->ToString()+" yil";
label5->Text = dataGridView3->Rows[-0]->Cells["Tugilgan_viloyati"]->Value->ToString();
label6->Text = dataGridView3->Rows[-0]->Cells["Xona_nomeri"]->Value->ToString()+" xona";
}
catch(Exception^ vaziyat){pictureBox1->Image = pictureBox2->Image;
label2->Text = " ";
label3->Text = " ";
label4->Text = " ";
label5->Text = " ";
label6->Text = " "; d=1; pictureBox1->Visible = false;
//MessageBox::Show("xato");
}
try{pictureBox3->Image =loadFoto((array^) dataGridView3->Rows[1]->Cells["Rasm"]->Value);
pictureBox3->Visible = true;
label7->Text = dataGridView3->Rows[1]->Cells["Fam"]->Value->ToString();
label8->Text = dataGridView3->Rows[1]->Cells["Ism"]->Value->ToString();
label9->Text = dataGridView3->Rows[1]->Cells["Tugilgan_yili"]->Value->ToString()+" yil";
label10->Text = dataGridView3->Rows[1]->Cells["Tugilgan_viloyati"]->Value->ToString();
label11->Text = dataGridView3->Rows[1]->Cells["Xona_nomeri"]->Value->ToString()+" xona";
}
catch(Exception^ vaziyat){ pictureBox3->Image = pictureBox2->Image; //MessageBox::Show("xato");
label7->Text = " ";
label8->Text = " ";
label9->Text = " ";
label10->Text = " ";
label11->Text = " "; b=1; pictureBox3->Visible = false;
}
try{pictureBox4->Image =loadFoto((array^) dataGridView3->Rows[2]->Cells["Rasm"]->Value);
pictureBox4->Visible = true;
label12->Text = dataGridView3->Rows[2]->Cells["Fam"]->Value->ToString();
label13->Text = dataGridView3->Rows[2]->Cells["Ism"]->Value->ToString();
label14->Text = dataGridView3->Rows[2]->Cells["Tugilgan_yili"]->Value->ToString()+" yil";
label15->Text = dataGridView3->Rows[2]->Cells["Tugilgan_viloyati"]->Value->ToString();
label16->Text = dataGridView3->Rows[2]->Cells["Xona_nomeri"]->Value->ToString()+" xona";
}
catch(Exception^ vaziyat){ pictureBox4->Image = pictureBox2->Image; //MessageBox::Show("xato");
label12->Text = " ";
label13->Text = " ";
label14->Text = " ";
label15->Text = " ";
label16->Text = " "; q=1; pictureBox4->Visible = false;
}
try{pictureBox5->Image =loadFoto((array^) dataGridView3->Rows[2]->Cells["Rasm"]->Value);
pictureBox5->Visible = true;
label17->Text = dataGridView3->Rows[3]->Cells["Fam"]->Value->ToString();
label18->Text = dataGridView3->Rows[3]->Cells["Ism"]->Value->ToString();
label19->Text = dataGridView3->Rows[3]->Cells["Tugilgan_yili"]->Value->ToString()+" yil";
label20->Text = dataGridView3->Rows[3]->Cells["Tugilgan_viloyati"]->Value->ToString();
label21->Text = dataGridView3->Rows[3]->Cells["Xona_nomeri"]->Value->ToString()+" xona";
}
catch(Exception^ vaziyat){ pictureBox5->Image = pictureBox2->Image; //MessageBox::Show("xato");
label17->Text = " ";
label18->Text = " ";
label19->Text = " ";
label20->Text = " ";
label21->Text = " "; q=1; pictureBox5->Visible = false;
}
if(d==1 && b==1 && q==1){
try{
int rowToUpdate_2 = dataGridView1->Rows->GetFirstRow(DataGridViewElementStates::Selected);
int id_2 = Convert::ToInt32(dataGridView1->Rows[rowToUpdate_2]->Cells["id"]->Value);
Id=id_2;
try{ pictureBox1->Image =loadFoto((array^) dataGridView1->Rows[id-1]->Cells["Rasm"]->Value);}
catch(Exception^ vaziyat){pictureBox1->Image = pictureBox2->Image; //MessageBox::Show("xato");
}
label2->Text = dataGridView1->Rows[id-1]->Cells[1]->Value->ToString();
label3->Text = dataGridView1->Rows[id-1]->Cells[2]->Value->ToString();
label4->Text = dataGridView1->Rows[id-1]->Cells[15]->Value->ToString()+" yil";
label5->Text = dataGridView1->Rows[id-1]->Cells[6]->Value->ToString();
label6->Text = dataGridView1->Rows[id-1]->Cells[10]->Value->ToString()+" xona";}
catch(Exception^ vaziyat){}
}
}
catch(Exception^ vaziyat){}
}
private: System::Void dataGridView2_Click(System::Object^ sender, System::EventArgs^ e) {
pictureBox3->Visible = false; pictureBox4->Visible = false; pictureBox5->Visible = false;
label7->Text = " ";
label8->Text = " ";
label9->Text = " ";
label10->Text = " ";
label11->Text = " ";
label12->Text = " ";
label13->Text = " ";
label14->Text = " ";
label15->Text = " ";
label16->Text = " ";
label17->Text = " ";
label18->Text = " ";
label19->Text = " ";
label20->Text = " ";
label21->Text = " ";
int rowToUpdate_3 = dataGridView2->Rows->GetFirstRow (DataGridViewElementStates::Selected);
int id_3 = Convert::ToInt32(dataGridView2->Rows[rowToUpdate_3]->Cells["id"]->Value);
String ^ Id_nomeri = dataGridView2->Rows[id_3-1]->Cells[7]->Value->ToString();
label1->Text = Id_nomeri;
String ^satr="SELECT * FROM [Talabalar] Where (id = "+Id_nomeri+")";
qidirish(satr);
try{ pictureBox1->Image =loadFoto((array^) dataGridView3->Rows[-0]->Cells[23]->Value);
label2->Text = dataGridView3->Rows[-0]->Cells[1]->Value->ToString();
label3->Text = dataGridView3->Rows[-0]->Cells[2]->Value->ToString();
label4->Text = dataGridView3->Rows[-0]->Cells[15]->Value->ToString()+" yil";
label5->Text = dataGridView3->Rows[-0]->Cells[6]->Value->ToString();
label6->Text = dataGridView3->Rows[-0]->Cells[10]->Value->ToString()+" xona";
int rowToUpdate_2 = dataGridView2->Rows->GetFirstRow(DataGridViewElementStates::Selected);
int id_2 = Convert::ToInt32(dataGridView2->Rows[rowToUpdate_2]->Cells["id"]->Value);
label7->Text = dataGridView2->Rows[id_2-1]->Cells[1]->Value->ToString();
label8->Text = dataGridView2->Rows[id_2-1]->Cells[2]->Value->ToString();
label9->Text = dataGridView2->Rows[id_2-1]->Cells[6]->Value->ToString();
label10->Text = dataGridView2->Rows[id_2-1]->Cells[8]->Value->ToString();
}
catch(Exception^ vaziyat){pictureBox1->Image = pictureBox2->Image;
label2->Text = " ";
label3->Text = " ";
label4->Text = " ";
label5->Text = " ";
label6->Text = " ";
label7->Text = " ";
label8->Text = " ";
label9->Text = " ";
label10->Text = " ";
//MessageBox::Show("Tanlandi");
}
}
private: System::Void dataGridView2_SelectionChanged(System::Object^ sender, System::EventArgs^ e) {
try{
pictureBox3->Visible = false; pictureBox4->Visible = false;
label7->Text = " ";
label8->Text = " ";
label9->Text = " ";
label10->Text = " ";
label11->Text = " ";
label12->Text = " ";
label13->Text = " ";
label14->Text = " ";
label15->Text = " ";
label16->Text = " ";
int rowToUpdate = dataGridView2->Rows->GetFirstRow(DataGridViewElementStates::Selected);
int id = Convert::ToInt32(dataGridView2->Rows[rowToUpdate]->Cells["id"]->Value);
String ^ Id_nomeri = dataGridView2->Rows[id-1]->Cells[7]->Value->ToString();
String ^satr="SELECT * FROM [Talabalar] Where (id="+Id_nomeri+")";
qidirish(satr);
try{ pictureBox1->Image =loadFoto((array^) dataGridView3->Rows[-0]->Cells["Rasm"]->Value);
label2->Text = dataGridView3->Rows[-0]->Cells[1]->Value->ToString();
label3->Text = dataGridView3->Rows[-0]->Cells[2]->Value->ToString();
label4->Text = dataGridView3->Rows[-0]->Cells[15]->Value->ToString()+" yil";
label5->Text = dataGridView3->Rows[-0]->Cells[6]->Value->ToString();
label6->Text = dataGridView3->Rows[-0]->Cells[10]->Value->ToString()+" xona";
int rowToUpdate_2 = dataGridView2->Rows->GetFirstRow(DataGridViewElementStates::Selected);
int id_2 = Convert::ToInt32(dataGridView2->Rows[rowToUpdate_2]->Cells["id"]->Value);
label7->Text = dataGridView2->Rows[id_2-1]->Cells[1]->Value->ToString();
label8->Text = dataGridView2->Rows[id_2-1]->Cells[2]->Value->ToString();
label9->Text = dataGridView2->Rows[id_2-1]->Cells[6]->Value->ToString();
label10->Text = dataGridView2->Rows[id_2-1]->Cells[8]->Value->ToString();
}
catch(Exception^ vaziyat){pictureBox1->Image = pictureBox2->Image;
label2->Text = " ";
label3->Text = " ";
label4->Text = " ";
label5->Text = " ";
label6->Text = " ";
label7->Text = " ";
label8->Text = " ";
label9->Text = " ";
label10->Text = " ";
//MessageBox::Show("Tanlandi");
}
}
catch(Exception^ v){}
}
private: System::Void dataGridView2_DoubleClick(System::Object^ sender, System::EventArgs^ e) {
try{
int rowToUpdate = dataGridView2->Rows->GetFirstRow(DataGridViewElementStates::Selected);
int id = Convert::ToInt32(dataGridView2->Rows[rowToUpdate]->Cells["id"]->Value);
label1->Text = id.ToString();
String ^ Id_nomeri = dataGridView2->Rows[id-1]->Cells[7]->Value->ToString();
String ^satr="SELECT * FROM [Talabalar] Where (id="+Id_nomeri+")";
qidirish(satr);
String ^ id_2 = dataGridView2->Rows[-0]->Cells[0]->Value->ToString();
Id=id;
yangilash(id-1,2);
}
catch(Exception ^v){MessageBox::Show(Convert::ToString(v));}
}
private: System::Void Form1_FormClosed(System::Object^ sender, System::Windows::Forms::FormClosedEventArgs^ e) {
safe_cast Dostları ilə paylaş: