Algoritmik tillar va dasturlash


Foydalanilgan adabiyotlar



Yüklə 1,42 Mb.
səhifə7/7
tarix11.11.2023
ölçüsü1,42 Mb.
#132390
1   2   3   4   5   6   7
KURS ISHI namuna

Foydalanilgan adabiyotlar:
1.Троелсен Эндрю, Джепикс Филипп. Язык программирования C# 7 и платформы .NET и .NET Core. Вильямс. 2018
2.A. Troelsen, P. Japikse. Pro C# 8 with .NET Core. Foundational Principles and Practices in Programming. Apress, 2020
3.Албахари Бен, Албахари Джозеф. C# 7.0. Справочник. Полное описание языка. Пер. с англ.-СПб: “Альфа-книга”, 2018, -1024 с.
4.Madraximov Sh.F., Gaynazarov S.M. C++ tilida programmalash asoslari// Toshkent, O‘zMU, 2009, 196 bet
5.Madraximov Sh.F., Ikromov A.M., Babajanov M.R. C++ tilida programmalash bo‘yicha masalalar to‘plami. Oʻquv qoʻllanma // Toshkent, Oʻzbekiston Milliy Universiteti, “Universitet” nashriyoti, 2014. - 160 bet
6. Mirziyoyev Sh.M. “Erkin va farovon, demokratik O‘zbekiston davlatini birgalikda barpo etamiz”. O‘zbekiston Respublikasi Prezidenti lavozimiga kirishish tantanali marosimiga bag‘ishlangan Oliy Majlis palatalarining qo‘shma majlisidagi nutq. - Toshkent: “O‘zbekiston”, 2016. 56 b.
7. O‘z. Res. Prezidentining “Raqamli iqtisodiyot va elektron hukumatni keng joriy yetish chora-tadbirlari to‘g‘risida” gi qarori. Toshkent shahri, 2020 yil 28 aprel.
8. Date C.J. An Introduction to Database Systems (8 th edition). Addison-Wesley: 2003. – P. 1034.
9. Основы систем баз данных: Учебник. / Е. Ж. Айтхожаева – Алматы: КазНИТУ имени К. И. Сатпаева, 2016. – 279 с. Ил. 38. Табл. 8. Библиогр. –53 назв.
10. Андон Ф., Резниченко В. Язык запросов SQL: Учеб. курс. – СПб.: Питер, 2006. – 416 с.
11. Бейли Л. Изучаем SQL /Пер. с англ. – СПб.: Питер, 2012. – 573 с.
12. Ayupov R.X., Ismoilov S.I., Azlarov A.X., “MS Access 2002 - ma’lumotlar majmuasini boshqarish tizimi” (o‘quv qo‘llanma) Toshkent.: Toshkent Moliya instituti, 2004.
Internet Saytlar:
1. https://metanit.com/sharp/tutorial/ - Onlayn darslar.
2. http://lib.nuu.uz/ - O‘zbekiston milliy Universiteti elektron kutubxonasi.
3. http://www.intuit.ru – Национальный Открытий Университет (Россия).


Ilova
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;
using System.Data.OleDb;
namespace Malika_Qaxramonova;{
public partial class Form1 : Form
{
static string conString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source='D:\Kurs ishi\Xodimlar\Xodimlar.accdb'";
OleDbConnection con = new OleDbConnection(conString);
OleDbCommand cmd;
OleDbDataAdapter adapter;
DataTable dt = new DataTable();

public string[] parol = new string[100];


public string[] login = new string[100];
public string[] ism = new string[100];
public string[] familiya = new string[100];
public string[] role = new string[100];

public Form1()


{
InitializeComponent();
this.oqish();
}

private void oqish() {


string sql = "Select * from Foydalanuvchi";
cmd = new OleDbCommand(sql, con);

try
{


con.Open();
adapter = new OleDbDataAdapter(cmd);
adapter.Fill(dt);
int i = 0;
foreach (DataRow row in dt.Rows)
{
login[i] = row[1].ToString();
parol[i] = row[2].ToString();
ism[i] = row[4].ToString();
familiya[i] = row[3].ToString();
role[i] = row[5].ToString();
i++;
}

dt.Rows.Clear();


con.Close();


}
catch (Exception e)
{
MessageBox.Show("Failed");
con.Close();
}
}

private void button1_Click(object sender, EventArgs e)


{
bool top = false;
for (int i = 0; i < login.Length; i++)
{
if (login[i] == textBox1.Text)
{
top = true;
if (parol[i] == textBox2.Text)
{
this.Hide();
Dashboard dash1 = new Dashboard(familiya[i], ism[i], role[i]);
dash1.Show();

}
else {


MessageBox.Show("Parol NoTo`g`ri");
}
break;
}
}
if (top == false)
{
MessageBox.Show("Login mavjud emas");
}
}
}
}
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;
using System.Data.OleDb;
namespace Malika_Qaxramonova
{
public partial class Dashboard : Form
{
public string familya, ism, role, bolim = "";
public string[] bolim_id = new string[20];
public string[] bolim_nomi = new string[20];
public string qidiruv = "";

static string conString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source='D:\Kurs ishi\Xodimlar\Xodimlar.accdb'";


OleDbConnection con = new OleDbConnection(conString);
OleDbCommand cmd;
OleDbDataAdapter adapter;
DataTable dt = new DataTable();

public Dashboard(string familya, string ism, string role)


{
InitializeComponent();
this.familya = familya;
this.ism = ism;
this.role = role;
if (role == "2") {
button1.Visible = false;
button2.Visible = false;
button3.Visible = false;
button8.Visible = false;
}
}

private void Dashboard_Load(object sender, EventArgs e)


{
AllPanel();
bolim = "0";
bolim_data_read();
yozish_datagrid();
}

private void bolim_data_read() {


string sql = "Select * from Bolim";
cmd = new OleDbCommand(sql, con);
try
{
con.Open();
adapter = new OleDbDataAdapter(cmd);
adapter.Fill(dt);
int i = 0;
foreach (DataRow row in dt.Rows)
{
bolim_id[i] = row[0].ToString();
bolim_nomi[i] = row[1].ToString();
i++;
}

dt.Rows.Clear();


dt.Columns.Clear();
con.Close();
}
catch (Exception e)
{
MessageBox.Show("Failed");
con.Close();
}
}

private void yozish_datagrid() {


comboBox1.Text = "Barcha Kafedralar";
comboBox1.Visible = false;
dataGridView1.Rows.Clear();
dataGridView1.Columns.Clear();
dataGridView1.ColumnCount = 5;
dataGridView1.Columns[0].Name = "Id";
dataGridView1.Columns[1].Name = "Familya";
dataGridView1.Columns[2].Name = "Ism";
dataGridView1.Columns[3].Name = "Bo`lim";
dataGridView1.Columns[4].Name = "Lavozimi";

dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;


dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;


dataGridView1.MultiSelect = false;
dataGridView1.Rows.Clear();
string sql = "";
if (bolim == "0")
{
sql = "Select * from Xodim";
if (this.qidiruv != "")
{
sql += " where [familya]='" + this.qidiruv + "' or [ism]='" + this.qidiruv + "'";
}
}else
if (bolim != "kafedra")
{
sql = "Select * from Xodim where [Bolim_id]='" + bolim + "'";
if (this.qidiruv != "")
{
sql += " and ([familya]='" + this.qidiruv + "' or [ism]='" + this.qidiruv + "')";
}
}
else
if(bolim == "kafedra"){
sql = "Select * from Xodim where Int([Bolim_id]) > 5";
if (this.qidiruv != "")
{
sql += " and ([familya]='" + this.qidiruv + "' or [ism]='" + this.qidiruv + "')";
}
comboBox1.Visible = true;
}

cmd = new OleDbCommand(sql, con);


try
{


con.Open();
adapter = new OleDbDataAdapter(cmd);
adapter.Fill(dt);
string qwer = "";
foreach (DataRow row in dt.Rows)
{
for (int i = 0; i < bolim_id.Length; i++) {
if (row[3].ToString() == bolim_id[i]) {
qwer = bolim_nomi[i];
}
}
bool tre = true;
if (bolim == "kafedra") {
for (int i = 0; i < comboBox1.Items.Count; i++) {
if (qwer == comboBox1.Items[i])
{
tre = false;
break;
}
}
if (tre) {
comboBox1.Items.Add(qwer);
}
}
dataGridView1.Rows.Add(row[0].ToString(), row[1], row[2], qwer, row[4]);
}

dt.Rows.Clear();


dt.Columns.Clear();
con.Close();
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
con.Close();
}
}

private void All_Xodim_Pnl_MouseClick(object sender, MouseEventArgs e)


{
AllPanel();
}

private void All_Xodim_Lbl_MouseClick(object sender, MouseEventArgs e)


{
AllPanel();
}

private void AllPanel() {


All_Xodim_Pnl.BackColor = System.Drawing.Color.Green;
Rahbariyat_Pnl.BackColor = System.Drawing.Color.Lime;
Ilm_Blm_Pnl.BackColor = System.Drawing.Color.Lime;
Bxl_Pnl.BackColor = System.Drawing.Color.Lime;
Kfd_Pnl.BackColor = System.Drawing.Color.Lime;
bolim = "0";
yozish_datagrid();
}

private void Rahbariyat_Pnl_MouseClick(object sender, MouseEventArgs e)


{
RahbariyatPanel();
}

private void Rahbariyat_Lbl_MouseClick(object sender, MouseEventArgs e)


{
RahbariyatPanel();
}
private void RahbariyatPanel()
{
All_Xodim_Pnl.BackColor = System.Drawing.Color.Lime;
Rahbariyat_Pnl.BackColor = System.Drawing.Color.Green;
Ilm_Blm_Pnl.BackColor = System.Drawing.Color.Lime;
Bxl_Pnl.BackColor = System.Drawing.Color.Lime;
Kfd_Pnl.BackColor = System.Drawing.Color.Lime;
bolim = "1";
yozish_datagrid();
}

private void Ilm_Blm_Pnl_MouseClick(object sender, MouseEventArgs e)


{
IlmPanel();
}

private void Ilm_Blm_Lbl_Click(object sender, EventArgs e)


{
IlmPanel();
}

private void IlmPanel()


{
All_Xodim_Pnl.BackColor = System.Drawing.Color.Lime;
Rahbariyat_Pnl.BackColor = System.Drawing.Color.Lime;
Ilm_Blm_Pnl.BackColor = System.Drawing.Color.Green;
Bxl_Pnl.BackColor = System.Drawing.Color.Lime;
Kfd_Pnl.BackColor = System.Drawing.Color.Lime;
bolim = "2";
yozish_datagrid();
}

private void Bxl_Pnl_MouseClick(object sender, MouseEventArgs e)


{
BxbPanel();
}

private void Bxl_Lbl_Click(object sender, EventArgs e)


{
BxbPanel();
}
private void BxbPanel()
{
All_Xodim_Pnl.BackColor = System.Drawing.Color.Lime;
Rahbariyat_Pnl.BackColor = System.Drawing.Color.Lime;
Ilm_Blm_Pnl.BackColor = System.Drawing.Color.Lime;
Bxl_Pnl.BackColor = System.Drawing.Color.Green;
Kfd_Pnl.BackColor = System.Drawing.Color.Lime;
bolim = "4";
yozish_datagrid();
}

private void Kfd_Pnl_Paint(object sender, PaintEventArgs e)


{

}


private void Kfd_Pnl_MouseClick(object sender, MouseEventArgs e)
{
kfdPanel();
}

private void Kfd_Lbl_Click(object sender, EventArgs e)


{
kfdPanel();
}
private void kfdPanel()
{
All_Xodim_Pnl.BackColor = System.Drawing.Color.Lime;
Rahbariyat_Pnl.BackColor = System.Drawing.Color.Lime;
Ilm_Blm_Pnl.BackColor = System.Drawing.Color.Lime;
Bxl_Pnl.BackColor = System.Drawing.Color.Lime;
Kfd_Pnl.BackColor = System.Drawing.Color.Green;
bolim = "kafedra";
yozish_datagrid();
}

private void button4_Click(object sender, EventArgs e)


{
this.qidiruv = textBox1.Text;
this.yozish_datagrid();
}

private void button5_Click(object sender, EventArgs e)


{
textBox1.Text = "";
this.qidiruv = textBox1.Text;
this.yozish_datagrid();
}

private void button6_Click(object sender, EventArgs e)


{
string familya = dataGridView1.SelectedRows[0].Cells[1].Value.ToString();
string ism = dataGridView1.SelectedRows[0].Cells[2].Value.ToString();


Yüklə 1,42 Mb.

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




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