Таңдалған тақырыптың көкейкестілігі: қазіргі кезде қоғам әрекеттерінің барлық саласында компьютер көмегімен ақпараттық ресурстар орын алады



бет12/12
Дата04.12.2023
өлшемі2,41 Mb.
#195007
1   ...   4   5   6   7   8   9   10   11   12
Байланысты:
Айдана диплом (1)

ҚОЛДАНЫЛҒАН ҚАЙНАР КӨЗДЕР ТІЗІМІ



  1. Мажитова К.Ш. Алгоритмдеу және бағдарламалау негіздері: оқу құралы –Астана: Политехникалық колледж, 2018. -160б.

  2. Мажитова К.Ш. «Алгоритмдеу және бағдарламалау негіздеріә пәні бойынша курстық жобаның түсініктеме хатын рәсімдеу туралы әдістемелік нұсқаулық-Астана: «Политехникалық колледжі» МКҚК, 2019.-19б.

  3. Культин, Н. С# в задачах и примерах / Н. Культин. - М.: БХВ-Петербург, 2020. - 1293 с.

  4. Лотка, Р. C# и CSLA .NET Framework. Разработка бизнес-объектов / Р. Лотка. - М.: Диалектика / Вильямс, 2017.

  5. Коуров Л.В., “Ақпараттық технология”, Минск “Амалфея” – 2018

  6. Г.В.Лебедев, Р.А.Сворень, «Информатика мен есептеуіш техника негіздері», Рауан, 2015ж

  7. Қараев Ж, «ЭВМ және программалау элементері», Алматы, Рауан,2015ж.

  8. https://metanit.com – Бағдарламалауға арналған веб – сервер.

  9. http://learn.microsoft.com - Жалпыға қол жетімді веб-API.

  10. https://kk.wikipedia.org – Уикипедия ашық энциклопедиясы.

  11. http://www.cyberforum.ru – Бағдарламашылар порталы.

  12. Адбаев К.А., Спатаев Н.Д. Қазақстан Республикасының еңбек қорғау бойынша нормативтік актілерінің жинағы, 2010



ҚОСЫМША
1-қосымша. Бағдарлама листингі
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Aidana


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

[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form10());
}
}
}
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)


{
axWindowsMediaPlayer1.URL = @"D:\G211.mpg";
axWindowsMediaPlayer2.URL = @"C:\Users\admin\Documents\Aidana\Aidana\materials\audio\M1.mp3";
}

private void pictureBox2_MouseMove(object sender, MouseEventArgs e)


{
pictureBox2.Image = Aidana.Properties.Resources.K5;
}
private void axWindowsMediaPlayer1_MouseMoveEvent(object sender, AxWMPLib._WMPOCXEvents_MouseMoveEvent e)
{
pictureBox1.Image = Aidana.Properties.Resources.K2;
pictureBox2.Image = Aidana.Properties.Resources.K4;
}

private void pictureBox1_MouseMove(object sender, MouseEventArgs e)


{
pictureBox1.Image = Aidana.Properties.Resources.K3;
}
private void pictureBox2_Click(object sender, EventArgs e)
{
Form2 newForm = new Form2();
newForm.Show();
this.Hide();
}

private void pictureBox1_Click(object sender, EventArgs e)


{
Form3 newForm = new Form3();
newForm.Show();
this.Hide();
}

private void pictureBox4_Click(object sender, EventArgs e)


{
Application.Exit();
}

Point lastPoint;


private void pictureBox3_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
pictureBox3.Cursor = Cursors.SizeAll;
this.Left += e.X - lastPoint.X;
this.Top += e.Y - lastPoint.Y;
}
}

private void pictureBox3_MouseDown(object sender, MouseEventArgs e)


{
lastPoint = new Point(e.X, e.Y);
}

private void pictureBox3_MouseUp(object sender, MouseEventArgs e)


{
pictureBox3.Cursor = Cursors.Default;
}
public partial class Form2 : Form
{
Form3 f3 = new Form3();
public Form2()
{
InitializeComponent();
//this.label4.Parent = this.pictureBox1;
//this.label4.BackColor = Color.Transparent;
//this.label5.Parent = this.pictureBox2;
//this.label5.BackColor = Color.Transparent;
this.label1.Parent = this.pictureBox1;
this.label1.BackColor = Color.Transparent;
this.label2.Parent = this.pictureBox1;
this.label2.BackColor = Color.Transparent;
}

private void pictureBox2_Click(object sender, EventArgs e)


{
if(label9.Text == "0")
{
pictureBox2.Image = Aidana.Properties.Resources.EE2;
label9.Text = "1";
textBox6.PasswordChar = '\0';
}
else
{
pictureBox2.Image = Aidana.Properties.Resources.EE1;
label9.Text = "0";
textBox6.PasswordChar = '*';
}
}

Point lastPoint;


private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
pictureBox1.Cursor=Cursors.SizeAll;
this.Left += e.X - lastPoint.X;
this.Top += e.Y - lastPoint.Y;
}

}


private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
lastPoint = new Point(e.X, e.Y);
}

private void pictureBox4_Click(object sender, EventArgs e)


{
Application.Exit();
}

private void pictureBox1_MouseUp(object sender, MouseEventArgs e)


{
pictureBox1.Cursor = Cursors.Default;
}

private void label1_MouseEnter(object sender, EventArgs e)


{
label1.ForeColor = Color.Goldenrod;
}
private void label1_MouseLeave(object sender, EventArgs e)
{
label1.ForeColor = Color.Silver;
}

private void label1_Click(object sender, EventArgs e)


{
Form4 newForm = new Form4();
newForm.Show();
this.Hide();
this.Close();
}

private void label2_MouseEnter(object sender, EventArgs e)


{
label2.ForeColor = Color.Goldenrod;
}

private void label2_MouseLeave(object sender, EventArgs e)


{
label2.ForeColor = Color.Silver;
}

private void label2_Click(object sender, EventArgs e)


{
String loginUser = textBox5.Text;
String passUser = textBox6.Text;

DB db = new DB();


DataTable table = new DataTable();


MySqlDataAdapter adapter = new MySqlDataAdapter();


MySqlCommand command = new MySqlCommand("SELECT* FROM users WHERE login = '" + loginUser + "' AND pass='" + passUser + "'", db.getConnection());


adapter.SelectCommand = command;


adapter.Fill(table);

if (table.Rows.Count > 0)


{

f3.label15.Text = textBox5.Text;


f3.Visible=true;
this.Hide();
}
else
MessageBox.Show("Қате енгіздіңіз!");
}

private void pictureBox6_Click(object sender, EventArgs e)


{
Form3 newForm = new Form3();
newForm.Show();
this.Hide();
}

private void textBox5_KeyPress(object sender, KeyPressEventArgs e)


{
if ((e.KeyChar >= 'A' && e.KeyChar <= 'Z') || (e.KeyChar >= 'a' && e.KeyChar <= 'z') || (e.KeyChar >= '0' && e.KeyChar <= '9') || e.KeyChar == '_' || e.KeyChar == (char)Keys.Back)
{

}
else


{
e.Handled = true;
}
}
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
this.label11.Parent = this.pictureBox1;
this.label11.BackColor = Color.Transparent;
this.label12.Parent = this.pictureBox2;
this.label12.BackColor = Color.Transparent;
this.label13.Parent = this.pictureBox3;
this.label13.BackColor = Color.Transparent;
this.label14.Parent = this.pictureBox4;
this.label14.BackColor = Color.Transparent;
}

private void axWindowsMediaPlayer1_Enter(object sender, EventArgs e)


{
axWindowsMediaPlayer1.URL = @"C:\Users\admin\Documents\Aidana\Aidana\materials\video\F31.mp4";
}

private void pictureBox1_MouseMove(object sender, MouseEventArgs e)


{
}

private void axWindowsMediaPlayer1_MouseMoveEvent(object sender, AxWMPLib._WMPOCXEvents_MouseMoveEvent e)


{
label1.ForeColor = Color.Gray;
label4.ForeColor = Color.Gray;
label3.ForeColor = Color.Gray;
label2.ForeColor = Color.Gray;

}
private void label1_MouseMove(object sender, MouseEventArgs e)


{
label1.ForeColor = Color.White;
}

private void label2_MouseMove(object sender, MouseEventArgs e)


{
label2.ForeColor = Color.White;
}

private void label3_MouseMove(object sender, MouseEventArgs e)


{
label3.ForeColor = Color.White;
}
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
label1.ForeColor = Color.Gray;
label4.ForeColor = Color.Gray;
label3.ForeColor = Color.Gray;
}

private void panel2_MouseMove(object sender, MouseEventArgs e)


{
timer1.Enabled = true;
label5.ForeColor = Color.Goldenrod;
}

private void timer1_Tick(object sender, EventArgs e)


{
int a = Convert.ToInt32(label6.Font.Size);
if (a>14)
timer1.Enabled = false;
if (a < 14)
{
label6.Font = new Font(FontFamily.GenericSansSerif, a + 2);
label7.Font = new Font(FontFamily.GenericSansSerif, a + 2);

}
if (a > 3)


{
label6.ForeColor = Color.White;
label7.ForeColor = Color.White;
}

}


private void panel3_MouseMove(object sender, MouseEventArgs e)
{
timer2.Enabled = true;
label10.ForeColor = Color.Goldenrod;
}

private void timer2_Tick(object sender, EventArgs e)


{
int a = Convert.ToInt32(label9.Font.Size);
if (a > 14)
timer2.Enabled = false;
if (a < 14)
{
label9.Font = new Font(FontFamily.GenericSansSerif, a + 2);

}
if (a > 3)


{
label9.ForeColor = Color.White;
}
}

private void pictureBox1_Click(object sender, EventArgs e)


{
Form6 f6 = new Form6();
if (label15.Text=="Admin")
f6.Visible = true;
else
f6.Visible = false;
f6.label15.Text = label15.Text;
f6.timer1.Enabled = true;
f6.label1.Text = "standardsmall";
this.Hide();
}
private void pictureBox1_MouseEnter(object sender, EventArgs e)
{
pictureBox1.Image = Aidana.Properties.Resources.KK1;
label11.ForeColor = Color.BurlyWood;
}

private void pictureBox1_MouseLeave(object sender, EventArgs e)


{
pictureBox1.Image = Aidana.Properties.Resources.KF41;
label11.ForeColor = Color.LightSteelBlue;

}


private void pictureBox2_MouseEnter(object sender, EventArgs e)
{
pictureBox2.Image = Aidana.Properties.Resources.KK2;
label12.ForeColor = Color.BurlyWood;
}

private void pictureBox2_MouseLeave(object sender, EventArgs e)


{
pictureBox2.Image = Aidana.Properties.Resources.KF42;
label12.ForeColor = Color.LightSteelBlue;
}

private void pictureBox3_MouseEnter(object sender, EventArgs e)


{
pictureBox3.Image = Aidana.Properties.Resources.KK3;
label13.ForeColor = Color.BurlyWood;
}

private void pictureBox3_MouseLeave(object sender, EventArgs e)


{
pictureBox3.Image = Aidana.Properties.Resources.KF43;
label13.ForeColor = Color.LightSteelBlue;
}

private void pictureBox4_MouseEnter(object sender, EventArgs e)


{
pictureBox4.Image = Aidana.Properties.Resources.KK4;
label14.ForeColor = Color.BurlyWood;
}

private void pictureBox4_MouseLeave(object sender, EventArgs e)


{
pictureBox4.Image = Aidana.Properties.Resources.KF44;
label14.ForeColor = Color.LightSteelBlue;
}
private void pictureBox6_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2();
if (label15.Text != "Login")
{
DialogResult dialog = MessageBox.Show(
"Cіз аккаунтығыздан шыққыңыз келеді ме?",
"Шығу",
MessageBoxButtons.YesNo,
MessageBoxIcon.Warning
);
if (dialog == DialogResult.Yes)
{
f2.Show();
this.Close();
}
}
else
{
Form1 f1 = new Form1();
f1.Show();
f1.axWindowsMediaPlayer2.Ctlcontrols.stop();
this.Hide();

}
}

private void pictureBox7_Click(object sender, EventArgs e)
{
Application.Exit();
}

Point lastPoint;


private void pictureBox8_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
pictureBox8.Cursor = Cursors.SizeAll;
this.Left += e.X - lastPoint.X;
this.Top += e.Y - lastPoint.Y;
}
}

private void pictureBox8_MouseDown(object sender, MouseEventArgs e)


{
lastPoint = new Point(e.X, e.Y);
}

private void pictureBox8_MouseUp(object sender, MouseEventArgs e)


{
pictureBox8.Cursor = Cursors.Default;
}

private void label15_Click(object sender, EventArgs e)


{
if (label15.Text == "Login")
{
Form2 newForm = new Form2();
newForm.Visible = true;
this.Hide();
}
if (label15.Text == "Admin")
{
Form6 f6 = new Form6();
f6.Visible = true;
}
}

private void pictureBox2_Click(object sender, EventArgs e)


{
Form6 f6 = new Form6();
if (label15.Text == "Admin")
f6.Visible = true;
else
f6.Visible = false;
f6.timer1.Enabled = true;
f6.label15.Text = label15.Text;
f6.label1.Text = "standard";
this.Hide();
}

private void pictureBox3_Click(object sender, EventArgs e)


{
Form6 f6 = new Form6();
if (label15.Text == "Admin")
f6.Visible = true;
else
f6.Visible = false;
f6.timer1.Enabled = true;
f6.label15.Text = label15.Text;
f6.label1.Text = "lux";
this.Hide();
}

private void pictureBox4_Click(object sender, EventArgs e)


{
Form6 f6 = new Form6();

if (label15.Text == "Admin")


f6.Visible = true;
else
f6.Visible = false;
f6.timer1.Enabled = true;
f6.label15.Text = label15.Text;
f6.label1.Text = "pen";
this.Hide();
}

private void label3_Click(object sender, EventArgs e)


{
Form10 f10 = new Form10();
f10.label12.Text = label15.Text;
f10.Show();
this.Hide();
}

private void label2_Click(object sender, EventArgs e)


{
Form11 f11 = new Form11();
f11.Show();
this.Hide();

}
public partial class Form4 : Form


{
public Form4()
{
InitializeComponent();
dateTimePicker1.Format = DateTimePickerFormat.Custom;
dateTimePicker1.CustomFormat = "yyyy-MM-dd";
}
private void pictureBox2_Click(object sender, EventArgs e)
{
if (label9.Text == "0")
{
pictureBox2.Image = Aidana.Properties.Resources.EE2;
label9.Text = "1";
textBox6.PasswordChar = '\0';
}
else
{
pictureBox2.Image = Aidana.Properties.Resources.EE1;
label9.Text = "0";
textBox6.PasswordChar = '*';
}
}

private void pictureBox3_Click(object sender, EventArgs e)


{
if (label10.Text == "0")
{
pictureBox3.Image = Aidana.Properties.Resources.EE2;
label10.Text = "1";
textBox7.PasswordChar = '\0';
}
else
{
pictureBox3.Image = Aidana.Properties.Resources.EE1;
label10.Text = "0";
textBox7.PasswordChar = '*';
}
}

private void pictureBox4_Click(object sender, EventArgs e)


{
this.Close();
}

Point lastPoint;


private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
pictureBox1.Cursor = Cursors.SizeAll;
this.Left += e.X - lastPoint.X;
this.Top += e.Y - lastPoint.Y;
}
}

private void pictureBox1_MouseDown(object sender, MouseEventArgs e)


{
lastPoint = new Point(e.X, e.Y);
}

private void pictureBox1_MouseUp(object sender, MouseEventArgs e)


{
pictureBox1.Cursor = Cursors.Default;
}

public Boolean isUserExists()


{

DB db = new DB();


DataTable table = new DataTable();


MySqlDataAdapter adapter = new MySqlDataAdapter();


MySqlCommand command = new MySqlCommand("SELECT* FROM users WHERE login = '" + textBox5.Text + "'", db.getConnection());


adapter.SelectCommand = command;


adapter.Fill(table);

if (table.Rows.Count > 0)


{
MessageBox.Show("Осындай логин тіркелген");
return true;
}

else
return false;


}


private void label11_MouseEnter(object sender, EventArgs e)
{
label11.ForeColor = Color.Goldenrod;
}

private void label11_MouseLeave(object sender, EventArgs e)


{
label11.ForeColor = Color.Silver;
}

private void label12_MouseEnter(object sender, EventArgs e)


{
label12.ForeColor = Color.Goldenrod;
}

private void label12_MouseLeave(object sender, EventArgs e)


{
label12.ForeColor = Color.Silver;
}

private void pictureBox4_Click_1(object sender, EventArgs e)


{
Application.Exit();
}

private void label12_Click(object sender, EventArgs e)


{
if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "" || textBox5.Text == "" || textBox6.Text == ""
|| textBox7.Text == "" || comboBox1.Text == "" || maskedTextBox1.Text == "")
MessageBox.Show("Барлық форманы толтырыңыз!");
else if (textBox6.Text != textBox7.Text)
MessageBox.Show("Құпия сөз сәйкес келмейді");
else {

if (isUserExists())


return;

DB db = new DB();


MySqlCommand command = new MySqlCommand($"INSERT INTO users (login, pass, name, surname, patronymic, gender, number, dateofbithday, email) VALUES ('{textBox5.Text}', '{textBox6.Text}', '{textBox1.Text}', '{textBox2.Text}', '{textBox3.Text}', '{comboBox1.Text}', '{maskedTextBox1.Text}', '{dateTimePicker1.Text}', '{textBox4.Text}')", db.getConnection());

db.openConnection();


if (command.ExecuteNonQuery() == 1)


{

MessageBox.Show("Сіз сәтті тіркелдіңіз");


Form2 newForm = new Form2();
newForm.Show();
this.Hide();
this.Close();

}


else
MessageBox.Show("Тіркелуде қәтеліктер кетті!!!");

db.closeConnection();


}
}

private void label11_Click(object sender, EventArgs e)


{
Form2 newForm = new Form2();
newForm.Show();
this.Hide();
this.Close();
}
private void pictureBox6_Click(object sender, EventArgs e)
{
Form3 newForm = new Form3();
newForm.Show();
this.Hide();
this.Close();
}

private void textBox5_KeyPress(object sender, KeyPressEventArgs e)


{
if ((e.KeyChar >= 'A' && e.KeyChar <= 'Z') || (e.KeyChar >= 'a' && e.KeyChar <= 'z') || (e.KeyChar >= '0' && e.KeyChar <= '9') || e.KeyChar == '_' || e.KeyChar == (char)Keys.Back)
{

}
else


{
e.Handled = true;
}
public partial class Form5 : Form
{
int sroom;
public Form5()
{
InitializeComponent();
sroom = Convert.ToInt32(label3.Text);
Color NewColor = Color.FromArgb(89, 197, 170);
Form3 f3 = new Form3();
label15.Text = f3.label15.Text;
dateTimePicker1.MinDate = DateTime.Today;
dateTimePicker2.MinDate = DateTime.Today.AddDays(1);
dateTimePicker1.MaxDate = dateTimePicker2.Value.AddDays(-1);
}
int count = -1;

private void button1_Click(object sender, EventArgs e)


{
label4.Text = "1";
}

private void radioButton1_CheckedChanged(object sender, EventArgs e)


{
RadioButton radioButton1 = (RadioButton)sender;
if (radioButton1.Checked == true)
{
label3.Text = (Convert.ToInt32(label3.Text) + 7500).ToString();
label6.Text = radioButton1.Text;
}
else
{
label3.Text = (Convert.ToInt32(label3.Text) - 7500).ToString();
}
}

private void button2_Click(object sender, EventArgs e)


{
label4.Text = "2";
}

private void radioButton2_CheckedChanged(object sender, EventArgs e)


{
if (radioButton2.Checked == true)
{
label3.Text = (Convert.ToInt32(label3.Text) + 7500).ToString();
label6.Text = radioButton2.Text;
}
else
{
label3.Text = (Convert.ToInt32(label3.Text) - 7500).ToString();
}
}
private void button6_Click(object sender, EventArgs e)
{

radioButton1.Checked = false;


radioButton2.Checked = false;
radioButton3.Checked = false;
radioButton4.Checked = false;
}

private void radioButton3_CheckedChanged(object sender, EventArgs e)


{
if (radioButton3.Checked == true)
{
label3.Text = (Convert.ToInt32(label3.Text) + 3250).ToString();
label6.Text = radioButton3.Text;
}
else
{
label3.Text = (Convert.ToInt32(label3.Text) - 3250).ToString();
}
}

private void radioButton4_CheckedChanged(object sender, EventArgs e)


{
if (radioButton4.Checked == true)
{
label3.Text = (Convert.ToInt32(label3.Text) + 3250).ToString();
label6.Text = radioButton4.Text;
}
else
{
label3.Text = (Convert.ToInt32(label3.Text) - 3250).ToString();
}
}

private void button3_Click(object sender, EventArgs e)


{
label4.Text = "3";
}

private void button7_Click(object sender, EventArgs e)


{
if (label15.Text == "Login")
{
MessageBox.Show("Авторизациядан өтіңіз!");
}
else
{
if (label4.Text == "комната")
MessageBox.Show("Бос бөлмені тандаңыз!");
else
{
dateTimePicker1.Format = DateTimePickerFormat.Custom;
dateTimePicker1.CustomFormat = "yyyy-MM-dd";
dateTimePicker2.Format = DateTimePickerFormat.Custom;
dateTimePicker2.CustomFormat = "yyyy-MM-dd";

DB db = new DB();


MySqlCommand command = new MySqlCommand($"INSERT INTO buy (login, tip, checkin, departure, transform, room, prise) VALUES ('{label15.Text}', '{label7.Text}', '{dateTimePicker1.Text}', '{dateTimePicker2.Text}', '{label6.Text}', '{label4.Text}', '{label3.Text}')", db.getConnection());

db.openConnection();


if (command.ExecuteNonQuery() == 1)


{
MessageBox.Show("Сіз " +label4.Text+" бөлмеге бронь жасадыңыз!");
Form3 f3 = new Form3();
f3.Show();
f3.label15.Text = label15.Text;
this.Hide();
this.Close();
}

else
MessageBox.Show("Тіркелуде қәтеліктер кетті!!!");


db.closeConnection();


}
}
}
Point lastPoint;
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
pictureBox1.Cursor = Cursors.SizeAll;
this.Left += e.X - lastPoint.X;
this.Top += e.Y - lastPoint.Y;
}
}

private void pictureBox1_MouseDown(object sender, MouseEventArgs e)


{
lastPoint = new Point(e.X, e.Y);
}

private void pictureBox1_MouseUp(object sender, MouseEventArgs e)


{
pictureBox1.Cursor = Cursors.Default;
}

private void pictureBox4_Click(object sender, EventArgs e)


{
Application.Exit();
}

private void pictureBox6_Click(object sender, EventArgs e)


{
Form3 f3 = new Form3();
f3.Show();
f3.label15.Text = label15.Text;
this.Hide();
}

private void label15_Click(object sender, EventArgs e)


{
if (label15.Text == "Login")
{
Form2 newForm = new Form2();
newForm.Visible = true;
this.Hide();
}
}

private void button4_Click(object sender, EventArgs e)


{
label4.Text = "4";
}

private void button5_Click(object sender, EventArgs e)


{
label4.Text = "5";
}

private void dateTimePicker2_ValueChanged(object sender, EventArgs e)


{
dateTimePicker1.MaxDate = dateTimePicker2.Value.AddDays(-1);
DateTime startDate = dateTimePicker1.Value.Date;
DateTime endDate = dateTimePicker2.Value.Date;
TimeSpan span = endDate.Subtract(startDate);
int days = (int)span.TotalDays;
label3.Text = (days * sroom).ToString();
}

private void dateTimePicker1_ValueChanged(object sender, EventArgs e)


{
DateTime startDate = dateTimePicker1.Value.Date;
DateTime endDate = dateTimePicker2.Value.Date;
TimeSpan span = endDate.Subtract(startDate);
int days = (int)span.TotalDays;
label3.Text = (days * sroom).ToString();
}

private void button8_Click(object sender, EventArgs e)


{
if (label8.Text == "1")
{
pictureBox1.Image = Aidana.Properties.Resources._1_1;
label8.Text = "2";
}
else if (label8.Text == "2")
{
pictureBox1.Image = Aidana.Properties.Resources._1_2;
label8.Text = "3";
}
else if (label8.Text == "3")
{
pictureBox1.Image = Aidana.Properties.Resources._1_3;
label8.Text = "4";
}
else if (label8.Text == "4")
{
pictureBox1.Image = Aidana.Properties.Resources._1_4;
label8.Text = "5";
}
else if (label8.Text == "5")
{
pictureBox1.Image = Aidana.Properties.Resources._1_5;
label8.Text = "6";
}
else if (label8.Text == "6")
{
pictureBox1.Image = Aidana.Properties.Resources._1_6;
label8.Text = "7";
}
else if (label8.Text == "7")
{
pictureBox1.Image = Aidana.Properties.Resources._1_7;
label8.Text = "1";
}
}

private void button9_Click(object sender, EventArgs e)


{
if (label8.Text == "2")
{
pictureBox1.Image = Aidana.Properties.Resources._1_1;
label8.Text = "1";
}
else if (label8.Text == "3")
{
pictureBox1.Image = Aidana.Properties.Resources._1_2;
label8.Text = "2";
}
else if (label8.Text == "4")
{
pictureBox1.Image = Aidana.Properties.Resources._1_3;
label8.Text = "3";
}
else if (label8.Text == "5")
{
pictureBox1.Image = Aidana.Properties.Resources._1_4;
label8.Text = "4";
}
else if (label8.Text == "6")
{
pictureBox1.Image = Aidana.Properties.Resources._1_5;
label8.Text = "5";
}
else if (label8.Text == "7")
{
pictureBox1.Image = Aidana.Properties.Resources._1_6;
label8.Text = "6";
}
else if (label8.Text == "1")
{
pictureBox1.Image = Aidana.Properties.Resources._1_7;
label8.Text = "7";
}
}
public partial class Form6 : Form
{
Form5 f5 = new Form5();
Form7 f7 = new Form7();
Form8 f8 = new Form8();
Form9 f9 = new Form9();
Color NewColor = Color.FromArgb(89, 197, 170);
private DB db;
public Form6()
{
InitializeComponent();
db = new DB();
LoadData();
LoadData1();
LoadData2();
}

private void LoadData()


{
try
{
db.openConnection();
MySqlCommand cmd = new MySqlCommand("SELECT * FROM buy", db.getConnection());
MySqlDataAdapter adapter = new MySqlDataAdapter(cmd);
DataTable dataTable = new DataTable();
adapter.Fill(dataTable);
dataGridView1.DataSource = dataTable;
Form3 f3 = new Form3();
for (int i = 0; i < Convert.ToInt32(dataTable.Rows.Count); i++)
{

String s = dataGridView1[6, i].Value.ToString();


if (s=="1")
{
f5.button1.Enabled = false;
f5.button1.BackColor = Color.LightCoral;
}
if (s == "2")
{
f5.button2.Enabled = false;
f5.button2.BackColor = Color.LightCoral;
}
if (s == "3")
{
f5.button3.Enabled = false;
f5.button3.BackColor = Color.LightCoral;
}
if (s == "4")
{
f5.button4.Enabled = false;
f5.button4.BackColor = Color.LightCoral;
}
if (s == "5")
{
f5.button5.Enabled = false;
f5.button5.BackColor = Color.LightCoral;
}
if (s == "6")
{
f7.button1.Enabled = false;
f7.button1.BackColor = Color.LightCoral;
}
if (s == "7")
{
f7.button2.Enabled = false;
f7.button2.BackColor = Color.LightCoral;
}
if (s == "8")
{
f7.button3.Enabled = false;
f7.button3.BackColor = Color.LightCoral;
}
if (s == "9")
{
f7.button4.Enabled = false;
f7.button4.BackColor = Color.LightCoral;
}
if (s == "10")
{
f7.button5.Enabled = false;
f7.button5.BackColor = Color.LightCoral;
}
if (s == "11")
{
f8.button1.Enabled = false;
f8.button1.BackColor = Color.LightCoral;
}
if (s == "12")
{
f8.button2.Enabled = false;
f8.button2.BackColor = Color.LightCoral;
}
if (s == "13")
{
f8.button3.Enabled = false;
f8.button3.BackColor = Color.LightCoral;
}
if (s == "14")
{
f8.button4.Enabled = false;
f8.button4.BackColor = Color.LightCoral;
}
if (s == "15")
{
f8.button5.Enabled = false;
f8.button5.BackColor = Color.LightCoral;





Достарыңызбен бөлісу:
1   ...   4   5   6   7   8   9   10   11   12




©engime.org 2024
әкімшілігінің қараңыз

    Басты бет