コード例 #1
0
        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);
        }
コード例 #2
0
        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);
            }
        }
コード例 #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);
        }