Exemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            returnAccesPassword = false;
            PasswordCheck check = new PasswordCheck();

            check.ShowDialog();
            if (returnAccesPassword == true)
            {
                button1.Enabled   = true;
                FIOField.Enabled  = true;
                NOCField.Enabled  = true;
                comboBox1.Enabled = true;
                CostField.Enabled = true;
                checkBox1.Enabled = true;
                checkBox2.Enabled = true;
                Debt.Enabled      = true;
                button2.Enabled   = false;
                button3.Enabled   = true;
            }
        }
Exemplo n.º 2
0
        private void button5_Click(object sender, EventArgs e)
        {
            returnAccesPassword = false;
            PasswordCheck check = new PasswordCheck();

            check.ShowDialog();
            if (returnAccesPassword == true)
            {
                listBox1.Items.Clear();


                for (int i = 0; i < clients.Count;)
                {
                    if (clients[i].Dolg == 0)
                    {
                        clients.RemoveAt(i);
                    }
                    else
                    {
                        listBox1.Items.Add($"{clients[i].FIO1.PadRight(50) + clients[i].Cost.ToString().PadRight(10) + clients[i].Dolg.ToString().PadRight(10)}");
                        i++;
                    }
                }
                File.Delete(pathclientDB);
                using (BinaryWriter bf = new BinaryWriter(File.Open(pathclientDB, FileMode.CreateNew)))
                {
                    for (int i = 0; i < clients.Count; i++)
                    {
                        bf.Write(clients[i].FIO1);
                        bf.Write(clients[i].CardNumber);
                        bf.Write(clients[i].Job);
                        bf.Write(clients[i].Cost);
                        bf.Write(clients[i].CheckPayment);
                        bf.Write(clients[i].Dolg);
                    }
                }
            }
        }