예제 #1
0
        private void Bind()
        {
            textEditComment.DataBindings.Clear();
            textEditComment.DataBindings.Add("EditValue", _item, nameof(_item.Comment), true, DataSourceUpdateMode.OnPropertyChanged);

            _tops = _repo.Get();
            searchLookUpEditTop.Properties.DataSource    = _tops;
            searchLookUpEditTop.Properties.ValueMember   = "Id";
            searchLookUpEditTop.Properties.DisplayMember = "Name";
            searchLookUpEditTop.DataBindings.Clear();
            searchLookUpEditTop.DataBindings.Add("EditValue", _item, nameof(_item.Id), true, DataSourceUpdateMode.OnPropertyChanged);
        }
예제 #2
0
        private bool Validation()
        {
            var items = _repo.Get();

            if (items.Any(x => x.Name.Trim().ToLower() == _item.Name.Trim().ToLower() && x.Id != _item.Id))
            {
                MessageBox.Show("База с таким названием уже существует");
                return(false);
            }

            return(true);
        }
예제 #3
0
파일: UCTop.cs 프로젝트: K8rvin/NailNotes
 private void GetData()
 {
     _items = _repo.Get();
 }