Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            TableConfig item = new TableConfig
            {
                name       = textBox1.Text.Trim(),
                alias      = textBox2.Text.Trim(),
                url        = textBox3.Text.Trim(),
                Bid        = textBox4.Text.Trim(),
                sourcesite = comboBox1.SelectedItem.ToString().Trim()
            };

            try
            {
                DapperDbContext context = new DapperDbContext(CurrentConfig.ConnectionString);
                if (!context.InsertTableConfigs(item))
                {
                    MessageBox.Show("新增保存失败.");
                    return;
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
                return;
            }
            refreshList();
        }