コード例 #1
0
        private void addButton_Click(object sender, EventArgs e)
        {
            if (nameTextBox.Text == "" || contactTextBox.Text == "" || addressTextBox.Text == "")
            {
                MessageBox.Show("enter your info");
            }
            else
            {
                if (_customerManager.IsNameExists(nameTextBox.Text))
                {
                    MessageBox.Show(nameTextBox.Text + " Already Exists");
                    return;
                }
                bool isAdded = _customerManager.AddCustomers(nameTextBox.Text, contactTextBox.Text, addressTextBox.Text);

                if (isAdded)
                {
                    MessageBox.Show("data Saved successfully");
                }
                else
                {
                    MessageBox.Show("not saved");
                }
            }
        }
コード例 #2
0
        public int Post([FromBody] IEnumerable <customer> items)
        {
            CustomerManager manager = new CustomerManager();

            return(manager.AddCustomers(items));
        }