コード例 #1
0
        public void CreateNewCard()
        {
            if (_is_application_exit)
                return;

            _isMainTableRefreshNeeded = false;
            _dform = new DeceasedCardForm(_conn_str, _currentUser, _shiftInfo);
            _dform.SetFormState(anvlib.Enums.AddEditFormState.Add);
            _dform.CreateNewCard();
            var dr = _dform.ShowDialog();
            if (dr == System.Windows.Forms.DialogResult.OK)
            {
                //var dd = _dform.EditableItem;
                DrawTable();
                _isMainTableRefreshNeeded = true;
            }
        }
コード例 #2
0
        public void EditCard()
        {
            if (_is_application_exit)
                return;

            object card = null;
            var idxs = _mainView.GetSelectedRows();
            if (idxs.Length > 0)
                card = _mainView.GetRow(idxs[0]);

            if (card != null)
            {
                BureaRecord rec = (BureaRecord)card;

                _isMainTableRefreshNeeded = false;
                _dform = new DeceasedCardForm(_conn_str, _currentUser, _shiftInfo);
                _dform.SetFormState(anvlib.Enums.AddEditFormState.Edit);
                _dform.EditCard(rec.card_id);
                var dr = _dform.ShowDialog();
                if (dr == System.Windows.Forms.DialogResult.OK)
                {
                    //var dd = _dform.EditableItem;
                    _isMainTableRefreshNeeded = true;
                    DrawTable();
                }
                sqlmgr.Reconnect();
                sqlmgr.SetCardViewed(rec.card_id, _currentUser.Id);
                sqlmgr.Disconnect();
                DrawTable();
            }
        }