Beispiel #1
0
        private int SaveGuest()
        {
            var iResult = 0;

            if (guestNameTextBox.Text.Length > 0)
            {
                if (guestBindingSource == null)
                {
                    return(iResult);
                }
                Validate();
                guestBindingSource.EndEdit();
                iResult = GuestManager.Save((Guest)guestBindingSource.Current);
            }
            else
            {
                MessageBox.Show(@"Don't leave the Guest Name empty.", @"Warning",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            _iiResult = iResult;
            return(iResult);
        }