示例#1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            logic = new GeneralLogic();
            var obj = new Student();

            obj.name     = txtName.Text.Trim();
            obj.lastname = txtLastname.Text.Trim();
            obj.phone    = txtPhone.Text.Trim();
            obj.status   = (cboStatus.SelectedItem as Estado).Value;
            if (logic.AddStudent(obj))
            {
                MessageBox.Show("Se agregó correctamente");
            }
            else
            {
                MessageBox.Show("Sucedio un error");
            }
        }