Kompyuter ilmlari va Dasturlashtirish” kafedrasi 5330200 – “Axborot tizimlari va texnologiyalari” yo‘nalishi



Yüklə 1,52 Mb.
səhifə6/6
tarix19.05.2023
ölçüsü1,52 Mb.
#127231
1   2   3   4   5   6
Kurs ishi

ILOVALAR
Form1
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Nazorat


{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{

if (textBox1.Text == "0209" && textBox2.Text == "0209")


{
label3.Text = "";
timer1.Start();
progressBar1.Visible = true;
label4.Visible = true;
label5.Visible = true;
}
else
{
label3.Visible = true;
label3.Text = "login yoki parol xato";
textBox1.Text = "";
textBox2.Text = "";
textBox1.Focus();
}
}

private void timer1_Tick(object sender, EventArgs e)


{
if (progressBar1.Value < 100)
{
progressBar1.Value += 2;
label5.Text = progressBar1.Value.ToString() + "%";
}
else
{
timer1.Stop();
this.Hide();
Form2 form2 = new Form2();
form2.ShowDialog();

}
}

private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked)
{
textBox2.UseSystemPasswordChar = true;
}
else
{
textBox2.UseSystemPasswordChar = false;
}
}

private void Form1_Load(object sender, EventArgs e)


{

label3.Visible = false;


progressBar1.Visible = false;
label4.Visible = false;
label5.Visible = false;
}

private void progressBar1_Click(object sender, EventArgs e)


{

}


private void textBox2_TextChanged(object sender, EventArgs e)
{

}
}
}


Form2
using System;


using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Nazorat


{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}

private void button3_Click(object sender, EventArgs e)


{
this.Close();
}

private void button1_Click(object sender, EventArgs e)


{
this.Hide();
tests form3 = new tests();
form3.ShowDialog();
}

private void button2_Click(object sender, EventArgs e)


{
this.Hide();
Form5 form5= new Form5();
form5.ShowDialog();
}

private void Form2_Load(object sender, EventArgs e)


{

}
}
}


Form4
using System;


using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Nazorat


{
public partial class Form4 : Form
{
Query controler;
static int s;
public Form4()
{
InitializeComponent();
controler = new Query(ConnectionStr.ConnStr);
}
public Form4(int n)
{
InitializeComponent();
s = n;
switch (n)
{
case 1: label1.Text = "1-kurs talabalari"; label5.Text = "1 Aslamov Xislat\n" + "2 Botirov Zuhriddin\n" + "3 Kuliyeva Xidoyat\n" + "4 Shoykulova Munisa\n" + "5 Umarov Samandar\n" + "6 Xudayberdiyev Sarvar\n";
label6.Text = "Kontrakt\n" + "Grand\n" + "Kontrakt\n" + "Grand\n" + "Kontrakt\n" + "Kontrakt\n"; break;
case 2: label1.Text = "2-kurs talabalari"; label5.Text = "1 Abdualiyev Farxod\n" + "2 Boltaboyev Sardor\n" + "3 G‘aniyev Abbos\n" + "4 Hazratova Durdona\n" + "5 Kattaxujayev Malikshox\n" + "6 Saddiyev Abbos\n";
label6.Text = "Grand\n" + "Kontrakt\n" + "Grand\n" + "Grand\n" + "Grand\n" + "Kontrakt\n"; break;
case 3: label1.Text = "3-kurs talabalari"; label5.Text = "1 Baxtiyorov Djaxangir\n" + "2 G‘affarov Mirzabek\n" + "3 Ismatullayev Muslimjon\n" + "4 Narziqulova Aʼlo\n" + "5 Qahharov Shohrux\n" + "6 Yaxshiboyev Qodirbek\n";
label6.Text = "Kontrakt\n" + "Grand\n" + "Kontrakt\n" + "Grand\n" + "Kontrakt\n" + "Kontrakt\n"; break;
case 4: label1.Text = "4-kurs talabalari"; label5.Text = "1 Boltaboyev Sardor\n" + "2 Ergashev Davronbek\n" + "3 Hazratqulov Azizjon\n" + "4 Ikromov Sunnatullo\n" + "5 Lapasov Doniyorbek\n" + "6 Normatov Shaxobiddin\n";
label6.Text = "Kontrakt\n" + "Kontrakt\n" + "Kontrakt\n" + "Kontrakt\n" + "Grand\n" + "Grand\n"; break;

}
}

private void Form3_Load(object sender, EventArgs e)
{
/* DataTable dt = new DataTable();

dt.Columns.Add("ID", typeof(int));


dt.PrimaryKey = new DataColumn[] { dt.Columns["ID"] };
dt.Columns.Add("ismi", typeof(string));
dt.Columns.Add("familiya", typeof(string));
dt.Columns.Add("kursi", typeof(string));
dt.Rows.Add(1, "Alisher", "s", "1");
dt.Rows.Add(2, "Alisher", "s", "1");
dt.Rows.Add(3, "Alisher", "s", "1");
dt.Rows.Add(4, "Alisher", "s", "1");
dataGridView1.DataSource = dt;*/

}


private void label6_Click(object sender, EventArgs e)
{

}


private void button1_Click(object sender, EventArgs e)
{
this.Hide();
Form5 form5=new Form5();
form5.ShowDialog();
}

private void button2_Click(object sender, EventArgs e)


{
if (comboBox1.Text == "Fanni tanlang")
{

MessageBox.Show("Fanni tanlang");


}
else if (comboBox2.Text == "O‘qituvchini tanlang")
{

MessageBox.Show("O‘qituvchini tanlang");


}
else
{
tests t;
switch (s)
{
case 1:
t = new tests("Aslamov", "Xislat",comboBox3.Text , comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "1");

t = new tests("Botirov", "Zuhriddin", comboBox4.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "1");


t = new tests("Kuliyeva", "Xidoyat", comboBox5.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "1");
t = new tests("Shoykulova", "Munisa", comboBox7.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "1");
t = new tests("Umarov", "Samandar", comboBox6.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "1");
t = new tests("Xudayberdiyev", "Sarvar", comboBox8.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "1");
break;
case 2:
t = new tests("Abdualiyev", "Farxod", comboBox3.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "2");
t = new tests("Boltaboyev", "Sardor", comboBox4.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "2");
t = new tests("G‘aniyev", "Abbos", comboBox5.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "2");
t = new tests("Hazratova", "Durdona", comboBox7.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "2");
t = new tests("Kattaxujayev", "Malikshox", comboBox6.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "2");
t = new tests("Saddiyev", "Abbos", comboBox8.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "2");
break;
case 3:
t = new tests("Baxtiyorov", "Djaxangir", comboBox3.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "3");
t = new tests("G‘affarov", "Mirzabek", comboBox4.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "3");
t = new tests("Ismatullayev", "Muslimjon", comboBox5.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "3");
t = new tests("Narziqulova", "Aʼlo", comboBox7.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "3");
t = new tests("Qahharov", "Shohrux", comboBox6.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "3");
t = new tests("Yaxshiboyev", "Qodirbek", comboBox8.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "3");
break;
case 4:
t = new tests("Boltaboyev", "Sardor", comboBox3.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "4");
t = new tests("Ergashev", "Davronbek", comboBox4.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "4");
t = new tests("Hazratqulov", "Azizjon", comboBox5.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "4");
t = new tests("Ikromov", "Sunnatullo", comboBox7.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "4");
t = new tests("Lapasov", "Doniyorbek", comboBox6.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "4");
t = new tests("Normatov", "Shaxobiddin", comboBox8.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, "4");
break;

}
this.Hide();


tests er = new tests();
er.Show();
}
}

private void Form4_Load(object sender, EventArgs e)


{

}
}
}


Form5
using System;


using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Nazorat


{
public partial class Form5 : Form
{
public Form5()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
this.Hide();
Form4 f = new Form4(1);
f.ShowDialog();
}

private void button2_Click(object sender, EventArgs e)


{
this.Hide();
Form4 f = new Form4(2);
f.ShowDialog();
}

private void button5_Click(object sender, EventArgs e)


{
this.Hide();
Form2 form2 = new Form2();
form2.ShowDialog();
}

private void button3_Click(object sender, EventArgs e)


{
this.Hide();
Form4 f = new Form4(3);
f.ShowDialog();
}

private void button4_Click(object sender, EventArgs e)


{
this.Hide();
Form4 f = new Form4(4);
f.ShowDialog();
}

private void Form5_Load(object sender, EventArgs e)


{

}
}
}


Tests
using System;


using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Nazorat


{
public partial class tests : Form
{
Query controler;
public int n;
public tests()
{
InitializeComponent();
controler = new Query(ConnectionStr.ConnStr);

}
public tests(string s1, string s2, string s3, string s4, string s5, string s6, string s7)


{
InitializeComponent();
controler = new Query(ConnectionStr.ConnStr);
controler.ADD(s1, s2, s3, s4, s5, s6, s7);
}
private void button1_Click(object sender, EventArgs e)
{
this.Hide();
Form2 form2 = new Form2();
form2.ShowDialog();
}

private void label5_Click(object sender, EventArgs e)


{

}


private void label2_Click(object sender, EventArgs e)
{

}


private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
{

}


private void richTextBox1_TextChanged(object sender, EventArgs e)
{
}

private void Form3_Load(object sender, EventArgs e)


{
dataGridView1.DataSource = controler.Updateprofesor();

}


private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{

}


private void label1_Click(object sender, EventArgs e)
{

}


private void button3_Click(object sender, EventArgs e)
{
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
}

private void button2_Click(object sender, EventArgs e)


{
if (textBox1.Text == "" && textBox2.Text == "" && textBox3.Text == "")
{
MessageBox.Show("Maʼlumotlarni to‘liq kiriting");
}
else if (comboBox2.Text == "O‘qituvchini tanlang")
{
MessageBox.Show("O‘qituvchini tanlang");
}
else if (comboBox1.Text == "Fanni tanlang")
{

MessageBox.Show("Fanni tanlang");


}
else if (comboBox3.Text == "Kursni tanlang")
{

MessageBox.Show("Kursni tanlang");


}
else
{
controler.ADD(textBox1.Text, textBox2.Text, textBox3.Text, comboBox1.Text, comboBox2.Text, dateTimePicker1.Text, comboBox3.Text);

dataGridView1.DataSource = controler.Updateprofesor();


textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
}
}

private void button4_Click(object sender, EventArgs e)


{
}

private void textBox1_TextChanged(object sender, EventArgs e)


{
controler = new Query(ConnectionStr.ConnStr);

dataGridView1.DataSource = controler.readSearch(textBox1.Text);


}
}
}

Query
using System;


using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.OleDb;
using System.Data;

namespace Nazorat


{
internal class Query
{
OleDbConnection connection;
OleDbCommand command;
OleDbDataAdapter dataAdapter;
DataTable table;

public Query(String Conn)


{
connection = new OleDbConnection(Conn);
table = new DataTable();
}
public DataTable readSearch(String s)
{
connection.Open();
dataAdapter = new OleDbDataAdapter("SELECT*FROM davomat WHERE ism like '%" + s + "%' or ism like '%" + s + "%';", connection);
table.Clear();
dataAdapter.Fill(table);
connection.Close();
return table;
}
public DataTable Updateprofesor()
{
connection.Open();
dataAdapter = new OleDbDataAdapter("SELECT * FROM davomat", connection);
table.Clear();
dataAdapter.Fill(table);
connection.Close();
return table;
}
public void ADD(String familiya, String ism, String baxo, String fan, String oqituvchi_ismi, String sana, String kursi)
{
connection.Open();
command = new OleDbCommand("INSERT INTO davomat(familiya,ism,baxo,fan,oqituvchi_ismi,sana,kursi) VALUES (@familiya,@ism,@baxo,@fan,@oqituvchi_ismi,@sana,@kursi)", connection);

command.Parameters.AddWithValue("familiya", familiya);


command.Parameters.AddWithValue("ism", ism);
command.Parameters.AddWithValue("baxo", baxo);
command.Parameters.AddWithValue("fan", fan);
command.Parameters.AddWithValue("oqituvchi_ismi", oqituvchi_ismi);
command.Parameters.AddWithValue("sana", sana);
command.Parameters.AddWithValue("kursi", kursi);

command.ExecuteNonQuery();


connection.Close();
}
}
}

Program
using System;


using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Nazorat


{
static class Program
{
///
/// Главная точка входа для приложения.
///

[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
Yüklə 1,52 Mb.

Dostları ilə paylaş:
1   2   3   4   5   6




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©muhaz.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin