Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            ri = new RateInfo()
            {
                Startdate = dateTimePicker1.Text,
                Enddate   = dateTimePicker2.Text,
                Exchange  = textBox1.Text,
                Remark    = textBox2.Text
            };
            string messageStr = null;

            if (rm.Add(ri, out messageStr))
            {
                MessageBox.Show("添加成功");
                this.Hide();
            }
            else
            {
                MessageBox.Show(messageStr);
            }
        }