Kompyuter ilmlari va dasturlashtirish


FOYDALANILGAN ADABIYOTLAR


Download 3.41 Mb.
bet6/7
Sana13.11.2023
Hajmi3.41 Mb.
#1771165
1   2   3   4   5   6   7
Bog'liq
26 kurs ishi Husniddin

FOYDALANILGAN ADABIYOTLAR
1. 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.
2.S.Rahmonqulov “IBM PC shaxsiy kompyuterida ishlash”, Т.: “Sharq”, 1998.
3.http://www.microsoft.com/
4.http://www.ziyonet.uz/
5.http://www.ref.uz/
6. Гвоздева Т.В. Проектирование информационных систем: учебное пособие / Т.В. Гвоздева, Б.А. Баллод. - Ростов н/Д.: Феникс, 2009.
7.Калачанов В.Д. Информационный менеджмент на предприятии: учебное пособие / В. Д Калачанов, А.И. Рыбников, А.Л. Рыжко, А.К. Шилов. - М.: Изд-во "Доброе слово", 2006.
8.Сатунина А.Е. Управление проектом корпоративной информационной системы предприятия: учебное пособие. / А.Е. Сатунина, Л.А. Сысоева, М.: Финансы и статистика; ИНФРА-М, 2009. .
9.Радченко М. Г.1C: Предприятие 8.2 Практическое пособие разработчика. Примеры и типовые приемы / М.Г. Радченко, Е.Ю. Хрусталева. - М.: ООО "1С-Паблишинг", 2009. - 874 с.: ил.
Internet Manbalar
10.Student management system. https://youtu.be/eM1wyciIK0k
11. Key Press Event only NUMBER or CHARACTER to textbox in DOT NET. https://youtu.be/SszQ03BMOr0
12. How to Activate Localhost (127.0.0.1) in your PC. https://youtu.be/mRx7XiNruJc

ILOVALAR
ro`yxat.cs

using System;


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

namespace AvtoSalon


{
public partial class Royxat : Form
{
private string fish;
private string tel;
private string email;
public Royxat(int global_id, string fish, string tel, string email)
{
this.global_id = global_id;
this.fish = fish;
this.tel = tel;
this.email = email;
InitializeComponent();
}
SqlConnection sqlConnection;
private void Royxat_Load(object sender, EventArgs e)
{
sqlConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["ulash"].ConnectionString);
sqlConnection.Open();
royxat();

dataGridView1.Columns[3].Width = 40;


dataGridView1.Columns[5].Width = 70;
dataGridView1.Columns[6].Width = 60;
dataGridView1.Columns[7].Width = 60;
dataGridView1.Columns[8].Width = 80;
}
private void button1_Click(object sender, EventArgs e)
{
Login login = new Login(global_id);
this.Hide();
login.Show();
}
private void royxat()
{
SqlCommand sqlCommand = new SqlCommand("select id,Marka,Nomi,Yili,Ishlab_chiqaruvchi,Rangi,Ot_kuchi,Positsiya,Korobka,Narxi from Cars", sqlConnection);
SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
DataSet dataSet = new DataSet();
sqlDataAdapter.Fill(dataSet);
dataGridView1.DataSource = dataSet.Tables[0];
}
int index;
int global_id;
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
try
{
index = e.RowIndex;
if (e.RowIndex >= 0)
{
DataGridViewRow selectedRow = dataGridView1.Rows[index];

if (selectedRow.Cells[0].Value.ToString() != string.Empty && selectedRow.Cells[1].Value.ToString() != string.Empty && selectedRow.Cells[2].Value.ToString() != string.Empty && selectedRow.Cells[3].Value.ToString() != string.Empty && selectedRow.Cells[4].Value.ToString() != string.Empty && selectedRow.Cells[5].Value.ToString() != string.Empty && selectedRow.Cells[6].Value.ToString() != string.Empty && selectedRow.Cells[7].Value.ToString() != string.Empty && selectedRow.Cells[8].Value.ToString() != string.Empty && selectedRow.Cells[9].Value.ToString() != string.Empty)


{
global_id = int.Parse(selectedRow.Cells[0].Value.ToString());
}
}
}
catch
{
global_id = 1;
}
}

private void button2_Click(object sender, EventArgs e)


{
Avtorizatsiya_admin avtorizatsiya_Admin = new Avtorizatsiya_admin(global_id,fish,tel,email);
this.Hide();
avtorizatsiya_Admin.Show();
}

private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)


{

}
}
}


Avtorizatsiya.cs


using System;


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

namespace AvtoSalon


{
public partial class Avtorizatsiya_admin : Form
{
SqlConnection sqlConnection;

private int global_id;


private string fish;
private string tel;
private string email;
public Avtorizatsiya_admin(int global_id, string fish, string tel, string email)
{
this.global_id = global_id;
this.fish = fish;
this.tel = tel;
this.email = email;
InitializeComponent();
}

private void Opening()


{
SqlDataReader sqlDataReader = null;
try
{
SqlCommand logincommand1 = new SqlCommand($"SELECT Login, Parol FROM Admin_loginlar", sqlConnection);
sqlDataReader = logincommand1.ExecuteReader();

List listlog = new List();


List listpar = new List();
while (sqlDataReader.Read())
{
listlog.Add(Convert.ToString(sqlDataReader["Login"]));
listpar.Add(Convert.ToString(sqlDataReader["Parol"]));
}

for (int i = 0; i < listlog.Count; i++)


{
if (listlog[i] == textBox1.Text && listpar[i] == textBox2.Text)
{
Admin admin = new Admin(global_id,fish,tel,email);
this.Hide();
admin.Show();
break;
}
}
}
finally
{
if (sqlDataReader != null && !sqlDataReader.IsClosed)
{
sqlDataReader.Close();
}
}
}
private void button1_Click(object sender, EventArgs e)
{
Opening();
}

private void Avtorizatsiya_admin_Load(object sender, EventArgs e)


{
sqlConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["ulash"].ConnectionString);
sqlConnection.Open();
}
}
}

Admin.cs

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

namespace AvtoSalon


{
public partial class Admin : Form
{
private int global_id;
private string fish;
private string tel;
private string email;
public Admin(int global_id,string fish,string tel,string email)
{
this.global_id = global_id;
this.fish = fish;
this.tel = tel;
this.email = email;
InitializeComponent();
}

SqlConnection sqlConnection;


private void royxat()


{
SqlCommand sqlCommand = new SqlCommand("select * from Cars", sqlConnection);
SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
DataSet dataSet = new DataSet();
sqlDataAdapter.Fill(dataSet);
dataGridView1.DataSource = dataSet.Tables[0];

}
int index;


int id;

private void Form1_Load(object sender, EventArgs e)
{
sqlConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["ulash"].ConnectionString);
sqlConnection.Open();
royxat();
}
private void button1_Click(object sender, EventArgs e)
{
SqlCommand deleteCommand = new SqlCommand($"delete from Cars where id = {id}", sqlConnection);
deleteCommand.ExecuteNonQuery();
royxat();
}

private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)


{
index = e.RowIndex;
if (e.RowIndex >=0)
{
DataGridViewRow selectedRow = dataGridView1.Rows[index];
if (selectedRow.Cells[0].Value.ToString() != string.Empty && selectedRow.Cells[1].Value.ToString() != string.Empty && selectedRow.Cells[2].Value.ToString() != string.Empty && selectedRow.Cells[3].Value.ToString() != string.Empty && selectedRow.Cells[4].Value.ToString() != string.Empty && selectedRow.Cells[5].Value.ToString() != string.Empty && selectedRow.Cells[6].Value.ToString() != string.Empty && selectedRow.Cells[7].Value.ToString() != string.Empty && selectedRow.Cells[8].Value.ToString() != string.Empty && selectedRow.Cells[9].Value.ToString() != string.Empty)
{
id = int.Parse(selectedRow.Cells[0].Value.ToString());
textBox1.Text = selectedRow.Cells[0].Value.ToString();
textBox2.Text = selectedRow.Cells[1].Value.ToString();
textBox3.Text = selectedRow.Cells[2].Value.ToString();
textBox4.Text = selectedRow.Cells[3].Value.ToString();
textBox5.Text = selectedRow.Cells[4].Value.ToString();
textBox6.Text = selectedRow.Cells[5].Value.ToString();
textBox7.Text = selectedRow.Cells[6].Value.ToString();
textBox8.Text = selectedRow.Cells[7].Value.ToString();
textBox9.Text = selectedRow.Cells[8].Value.ToString();
textBox10.Text = selectedRow.Cells[9].Value.ToString();
}
}
}

private void button3_Click(object sender, EventArgs e)


{
SqlCommand deleteCommand = new SqlCommand($"update Cars set id = {textBox1.Text},Marka = '{textBox2.Text}',Nomi = '{textBox3.Text}',Yili = {textBox4.Text},Ishlab_chiqaruvchi = '{textBox5.Text}',Rangi = '{textBox6.Text}',Ot_kuchi = {textBox7.Text},Positsiya = {textBox8.Text},Korobka = '{textBox9.Text}',Narxi = {textBox10.Text} where id = {id}", sqlConnection);
deleteCommand.ExecuteNonQuery();
royxat();
}

private void button2_Click(object sender, EventArgs e)


{
SqlCommand deleteCommand = new SqlCommand($"insert Cars (id, Marka, Nomi, Yili, Ishlab_chiqaruvchi, Rangi, Ot_kuchi, Positsiya, Korobka, Narxi) values ({textBox1.Text},'{textBox2.Text}','{textBox3.Text}',{textBox4.Text},'{textBox5.Text}','{textBox6.Text}',{textBox7.Text},{textBox8.Text},'{textBox9.Text}',{textBox10.Text})", sqlConnection);
deleteCommand.ExecuteNonQuery();
royxat();
}

private void button4_Click(object sender, EventArgs e)


{

Zayavkalar zayavkalar = new Zayavkalar();


zayavkalar.Show();
}

private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)


{

}


}
}
Zayavka.cs

using System;


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

namespace AvtoSalon


{
public partial class Zayavkalar : Form
{
public Zayavkalar()
{
InitializeComponent();
}
SqlConnection sqlConnection;

private void Zayavkalar_Load(object sender, EventArgs e)


{
sqlConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["ulash"].ConnectionString);
sqlConnection.Open();

royxat();


SotildiRoyxat();
bankHisoblash();
}
private void ochirish()
{
SqlCommand deleteCommand = new SqlCommand($"delete from Clientlar where id = {tanlangan_id}", sqlConnection);
deleteCommand.ExecuteNonQuery();
royxat();
}
private void bankHisoblash()
{
SqlCommand sqlCommand = new SqlCommand("select sum(Baholandi) from Sotilganlar", sqlConnection);
SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
DataSet dataSet = new DataSet();
sqlDataAdapter.Fill(dataSet);
label3.Text = "Bank: "+dataSet.Tables[0].Rows[0][0];
}
private void royxat()
{
SqlCommand sqlCommand = new SqlCommand("select * from Clientlar", sqlConnection);
SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
DataSet dataSet = new DataSet();
sqlDataAdapter.Fill(dataSet);
dataGridView1.DataSource = dataSet.Tables[0];
}
int index;

int tanlangan_id = 1;


int sotilgan_moshin_id;
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
index = e.RowIndex;
if (e.RowIndex >= 0)
{
DataGridViewRow selectedRow = dataGridView1.Rows[index];
if (selectedRow.Cells[0].Value.ToString() != string.Empty && selectedRow.Cells[1].Value.ToString() != string.Empty && selectedRow.Cells[2].Value.ToString() != string.Empty && selectedRow.Cells[3].Value.ToString() != string.Empty && selectedRow.Cells[4].Value.ToString() != string.Empty)
{
tanlangan_id = int.Parse(selectedRow.Cells[0].Value.ToString());
sotilgan_moshin_id = int.Parse(selectedRow.Cells[5].Value.ToString());
}
}
}

string fish;


string marka;
string nomi;
int Mnarxi;
private void Sotilganlar()
{
SqlCommand fisholish = new SqlCommand($"select fish from Clientlar where id = {tanlangan_id}", sqlConnection);
SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(fisholish);
DataSet dataSet = new DataSet();
sqlDataAdapter.Fill(dataSet);
fish = dataSet.Tables[0].Rows[0][0].ToString();

SqlCommand Moshinolish = new SqlCommand($"select Marka, Nomi from Cars where id = {sotilgan_moshin_id}", sqlConnection);


SqlDataAdapter adap = new SqlDataAdapter(Moshinolish);
DataSet dataSet1 = new DataSet();
adap.Fill(dataSet1);
marka = dataSet1.Tables[0].Rows[0][0].ToString();
nomi = dataSet1.Tables[0].Rows[0][1].ToString();

SqlCommand narxi = new SqlCommand($"select Narxi from Cars where id = {sotilgan_moshin_id}", sqlConnection);


SqlDataAdapter adapter = new SqlDataAdapter(narxi);
DataSet dataSet2 = new DataSet();
adapter.Fill(dataSet2);
Mnarxi = int.Parse(dataSet2.Tables[0].Rows[0][0].ToString());

SqlCommand insert = new SqlCommand($"insert into Sotilganlar(Mijoz,Marka,Nomi,Sanasi,Baholandi) values('{fish}','{marka}','{nomi}','{DateTime.Now.ToString("MM.dd.yyyy")}',{Mnarxi})",sqlConnection);


insert.ExecuteNonQuery();
}
private void SotildiRoyxat()
{
SqlCommand sqlCommand = new SqlCommand("select * from Sotilganlar", sqlConnection);
SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
DataSet dataSet = new DataSet();
sqlDataAdapter.Fill(dataSet);
dataGridView2.DataSource = dataSet.Tables[0];
}
private void button1_Click(object sender, EventArgs e)
{
Sotilganlar();
SotildiRoyxat();
bankHisoblash();
ochirish();
}
private void button2_Click_1(object sender, EventArgs e)
{
}

private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)


{

}
}
}




Mirzo Ulug‘bek nomidagi O‘zbekiston Milliy universiteti Jizzax filiali _________________________________________________________ yo‘nalishi ______ - guruh talabasi _____________________________________________ __________________________ning______________________________________________________________________________________________________ __________________________________________________________________


Download 3.41 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling