Exemple #1
0
        private void _dialogIDReasonContentEdit_Load(object sender, EventArgs e)
        {
            try
            {
                //类别
                var categories = _IDService.GetIDReasonCategories();

                this.treeListLookUpEdit1.Properties.DisplayMember = "FullName";
                this.treeListLookUpEdit1.Properties.ValueMember   = "Id";
                this.treeListLookUpEdit1TreeList.Initialize(categories, "Id", "ParentId", editable: false, autoWidth: true, showColumns: false, showVertLines: false, showHorzLines: false);

                categories = null;

                this.treeListLookUpEdit1.EditValue = CategoryId;

                this._isEdit = ContentId > 0 ? true : false;

                if (this._isEdit)
                {
                    var reasonContent = _IDService.GetIDReasonContent(ContentId);

                    if (reasonContent == null)
                    {
                        return;
                    }

                    this.txtTitle.Text    = reasonContent.Title;
                    this.memoContent.Text = reasonContent.Content;
                }
            }
            catch (Exception ex)
            {
                DXMessage.ShowError(ex.Message);
            }
        }