Advertisement
Margoshinka

students

Mar 13th, 2022
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.26 KB | None | 0 0
  1.  public void Selection()
  2.         {
  3.             flag = true;
  4.             position = 0;
  5.             textBox1.Enabled = true;
  6.             textBox2.Enabled = true;
  7.             textBox3.Enabled = true;
  8.             Findindex();
  9.             if (textBox4.Text.Length != 0 && t.Item1 != -1)
  10.             {
  11.                 position = t.Item1;
  12.  
  13.                 Output();
  14.                 IsMaster();
  15.                 CheckButton();
  16.                 CheckMenu();
  17.             }
  18.             else if ((textBox4.Text.Length != 0 && t.Item1 == -1))
  19.                 {
  20.                     position=-1;
  21.  
  22.                     textBox1.Clear();
  23.                     textBox2.Clear();
  24.                     textBox3.Clear();
  25.                     textBox5.Clear();
  26.                     textBox1.Enabled = false;
  27.                     textBox2.Enabled = false;
  28.                     textBox3.Enabled = false;
  29.                     textBox5.Enabled = false;
  30.  
  31.                 }
  32.  
  33.                 else
  34.                 {
  35.                     position = 0;
  36.                 flag = false;
  37.                 if (list.Count() != 0)
  38.                 {
  39.                     Output();
  40.                     IsMaster();
  41.                 }
  42.                 else {
  43.                     textBox1.Enabled = false;
  44.                     textBox2.Enabled = false;
  45.                     textBox3.Enabled = false;
  46.                 }
  47.                     CheckButton();
  48.                     CheckMenu();
  49.                 }
  50.  
  51.            
  52.         }
  53.  
  54.  
  55.  
  56.  
  57.  
  58. private void удалитьToolStripMenuItem_Click(object sender, EventArgs e)
  59.         {
  60.            
  61.            /* if (flag && position <= t.Item2 && position > t.Item1)
  62.             {
  63.                 int it1 = t.Item1;
  64.                 int it2 = t.Item2-1;
  65.                 t = (it1, it2);
  66.             }
  67.             else if (flag && position < t.Item2 && position <= t.Item1)
  68.             {
  69.                 int it1 = t.Item1+1;
  70.                 int it2 = t.Item2-1;
  71.                 t = (it1, it2);
  72.             }*/
  73.             list.RemoveAt(position);
  74.             if (flag && position < t.Item2 && position > t.Item1)
  75.             {
  76.                 int it1 = t.Item1;
  77.                 int it2 = t.Item2 - 1;
  78.                 t = (it1, it2);
  79.             }
  80.             else if (position == list.Count() || (position == t.Item2))
  81.             {
  82.                 if (flag)
  83.                 {
  84.                     Findindex();
  85.                     position = t.Item2;
  86.                 }
  87.                 else position--;
  88.             }
  89.             else if (flag && position == t.Item1)
  90.             {
  91.                 Findindex();
  92.                 position = t.Item1;
  93.             }
  94.              if (list.Count == 0 || (t.Item1 == -1 && flag))
  95.             {
  96.  
  97.                 textBox1.Clear();
  98.                 textBox2.Clear();
  99.                 textBox3.Clear();
  100.                 textBox5.Clear();
  101.                 textBox1.Enabled = false;
  102.                 textBox2.Enabled = false;
  103.                 textBox3.Enabled = false;
  104.                 textBox5.Enabled = false;
  105.                 button3.Visible = false;
  106.  
  107.                 return;
  108.             }
  109.            
  110.            
  111.             Output();
  112.             IsMaster();
  113.             CheckButton();
  114.             CheckMenu();
  115.  
  116.  
  117.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement