private void button1_Click(object sender, EventArgs e)
        {
            if (readandwritebime.search(txtid.Text) != null)
            {
                MessageBox.Show("wrong : two same idcode");
                return;
            }
            bime x = new bime(txtname.Text, txtfamilyname.Text, txtid.Text, Convert.ToDouble(txtaccount.Text));

            readandwritebime.writeone(x);
        }
        public double getbime()
        {
            bime nebim = readandwritebime.search(textBox2.Text);

            if (nebim != null)
            {
                double newpay = (Convert.ToDouble(txtpayment.Text) * nebim.percent / 100);;
                textBox3.Text = newpay.ToString();
                return(newpay);
            }
            else
            {
                MessageBox.Show("sorry you have not bime");
                return(0);
            }
        }
Beispiel #3
0
        public static void writeone(bime bime)
        {
            string save = bime.name + '*' + bime.familyname + '*' + bime.id + '*' + bime.percent + "\n";

            System.IO.File.AppendAllText(path, save);
        }