Exemplo n.º 1
0
        private void EditByContract(string contract)
        {
            bool isEdited = false;
            bool isFound  = false;

            for (int subject = 0; subject < main.ListOfClients.Count; subject++)
            {
                if (main.ListOfClients[subject].NumberOfContract.Equals(contract))
                {
                    isFound = true;
                    var EditClient = new AddClient(main.ListOfClients[subject]);
                    if (EditClient.ShowDialog() == DialogResult.OK)
                    {
                        main.ListOfClients[subject] = EditClient.NewClient;
                        isEdited = true;
                        RefreshTable(main);
                        break;
                    }
                    else
                    {
                        break;
                    }
                }
            }
            if (!isFound)
            {
                System.Windows.MessageBox.Show("None was found");
            }
            else if (!isEdited)
            {
                System.Windows.MessageBox.Show("Cancelled");
            }
        }
Exemplo n.º 2
0
        private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var AddClientForm = new AddClient();

            if (AddClientForm.ShowDialog() == DialogResult.OK)
            {
                main.AddClient(AddClientForm.NewClient);
                RefreshTable(main);
                WorldInfo.Claim(AddClientForm.NewClient.NumberOfContract);
            }
        }