Form1.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace AMONIC_Airlines02
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. }
  18. private void pictureBox1_Click(object sender, EventArgs e)
  19. {
  20. }
  21. private void button1_Click(object sender, EventArgs e)
  22. {
  23. {
  24. var Login1 = "j.doe@amonic.com";
  25. var Pass1 = "123";
  26. var Login2 = "k.omar@amonic.com";
  27. var Pass2 = "4258";
  28. var Login3 = "h.saeed@amonic.com";
  29. var Pass3 = "2020";
  30. var Login4 = "a.hobart@amonic.com";
  31. var Pass4 = "6996";
  32. var Login5 = "k.anderson@amonic.com";
  33. var Pass5 = "4570";
  34. var Login6 = "h.wyrick@amonic.com";
  35. var Pass6 = "1199";
  36. var Login7 = "marie.horn@amonic.com";
  37. var Pass7 = "55555";
  38. var Login8 = "m.osteen@amonic.com";
  39. var Pass8 = "9800";
  40. if ((t_login.Text == Login1) && (t_Parol.Text == Pass1))
  41. {
  42. Form2 form2 = new Form2();
  43. form2.Show();
  44. this.Hide();
  45. }
  46. if ((t_login.Text == Login2) && (t_Parol.Text == Pass2))
  47. {
  48. Form2 form2 = new Form2();
  49. form2.Show();
  50. this.Hide();
  51. }
  52. if ((t_login.Text == Login3) && (t_Parol.Text == Pass3))
  53. {
  54. Form2 form2 = new Form2();
  55. form2.Show();
  56. this.Hide();
  57. }
  58. if ((t_login.Text == Login4) && (t_Parol.Text == Pass4))
  59. {
  60. Form2 form2 = new Form2();
  61. form2.Show();
  62. this.Hide();
  63. }
  64. if ((t_login.Text == Login5) && (t_Parol.Text == Pass5))
  65. {
  66. Form2 form2 = new Form2();
  67. form2.Show();
  68. this.Hide();
  69. }
  70. if ((t_login.Text == Login6) && (t_Parol.Text == Pass6))
  71. {
  72. Form2 form2 = new Form2();
  73. form2.Show();
  74. this.Hide();
  75. }
  76. if ((t_login.Text == Login7) && (t_Parol.Text == Pass7))
  77. {
  78. Form2 form2 = new Form2();
  79. form2.Show();
  80. this.Hide();
  81. }
  82. if ((t_login.Text == Login8) && (t_Parol.Text == Pass8))
  83. {
  84. Form2 form2 = new Form2();
  85. form2.Show();
  86. this.Hide();
  87. }
  88. if ((t_login.Text != Login3) && (t_Parol.Text != Pass3) &&
  89. (t_login.Text != Login1) && (t_Parol.Text != Pass1) &&
  90. (t_login.Text != Login2) && (t_Parol.Text != Pass2) &&
  91. (t_login.Text != Login4) && (t_Parol.Text != Pass4) &&
  92. (t_login.Text != Login5) && (t_Parol.Text != Pass5) &&
  93. (t_login.Text != Login6) && (t_Parol.Text != Pass6) &&
  94. (t_login.Text != Login7) && (t_Parol.Text != Pass7) &&
  95. (t_login.Text != Login8) && (t_Parol.Text != Pass8))
  96. {
  97. MessageBox.Show("Неверный логин или пароль");
  98. }
  99. }
  100. }
  101. private void button2_Click(object sender, EventArgs e)
  102. {
  103. MessageBoxButtons msb = MessageBoxButtons.YesNo;
  104. String message = "Вы действительно хотите выйти?";
  105. String caption = "Выход";
  106. if (MessageBox.Show(message, caption, msb) == DialogResult.Yes)
  107. this.Close();
  108. }
  109. }
  110. }