Exemplo n.º 1
0
        private void LBCompanies_SelectedIndexChanged(object sender, EventArgs e)
        {
            Main.Company C = Main.Companies[LBCompanies.SelectedIndex];

            TBName.Text     = C.Name;
            TBABRName.Text  = C.AbbrName;
            CBCategory.Text = C.Category;
            TBEmail.Text    = C.Email;
            TBPhone.Text    = C.Phone;
            TBURL.Text      = C.url;
            TBAddress.Lines = C.Address;
            TBNotes.Lines   = C.Notes;
            NUProTime.Value = C.ProcessingTime;

            BTNWrite.Text = "Update";
        }
Exemplo n.º 2
0
        private void BTNWrite_Click(object sender, EventArgs e)
        {
            Main.Company C = new Main.Company(TBName.Text,
                                              TBABRName.Text, CBCategory.Text,
                                              TBEmail.Text, TBPhone.Text, TBURL.Text,
                                              TBAddress.Lines, TBNotes.Lines,
                                              (int)NUProTime.Value);
            Main.Companies.Add(C);

            Main.CheckURI();
            if (BTNWrite.Text == "Data\\Update")
            {
                Main.Companies.RemoveAt(LBCompanies.SelectedIndex);
            }
            WriteCompanies();
        }