コード例 #1
0
        private void tsbRemove_Click(object sender, EventArgs e)
        {
            if (dgvGuests.SelectedRows == null)
            {
                return;
            }
            var obj = dgvGuests.SelectedRows[0];

            var guest = obj.DataBoundItem as GuestInfo;

            if (MessageBox.Show(this, $"确定要删除{guest.Name} 及其随行人员吗?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                GuestMgr.RemoveGuest(guest);
                //QueryByFilter();
                pagerControl.InvokeIfRequired(c => c.RefreshData());
                dgvGuests.ClearSelection();
                splitContainer.Panel2Collapsed = true;
                LocateScrollBar();
            }
        }
コード例 #2
0
        private object Update(object obj)
        {
            var success = GuestMgr.UpdateGuestInfo(obj as GuestInfo);

            return(success);
        }
コード例 #3
0
        private object Register(object obj)
        {
            var success = GuestMgr.SaveOrUpdateFace(obj as GuestInfo);

            return(success);
        }