Beispiel #1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            var fields = new Dictionary <string, object>();

            fields.Add("@id", id_place);
            var result = new IDataPlace().Delete(fields);

            MessageBox.Show(result.GetType().GetProperty("Message").GetValue(result, null));
            loadGrid();
        }
Beispiel #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            var fields = new Dictionary <string, object>();

            fields.Add("@place_name", tbPlaceName.Text);
            fields.Add("@place_address", tbPlaceAddress.Text);
            if (btnSave.Text == "Update")
            {
                fields.Add("@id", id_place);
                var result = new IDataPlace().Update(fields);
                MessageBox.Show(result.GetType().GetProperty("Message").GetValue(result, null));
            }
            else
            {
                var result = new IDataPlace().Insert(fields);
                MessageBox.Show(result.GetType().GetProperty("Message").GetValue(result, null));
            }

            loadGrid();
            reset();
        }