示例#1
0
        private void BtnAddClick(object sender, EventArgs e)
        {
            if (_type == typeof(Entry))
            {
                DialogResult = DialogResult.None;
                return;
            }
            ActionCreateEditForm action = new ActionCreateEditForm(EditEntryFormMode.Add, null, _type, new List <PropertyInfo>(), DataChanged, false);

            action.InvokeForm();
        }
示例#2
0
        private void BtnAddClick(object sender, EventArgs e)
        {
            Assembly lAssembly = AppDomain.CurrentDomain.GetAssemblies().SingleOrDefault(assembly => assembly.GetName().Name == "University");

            if (lAssembly != null)
            {
                Type type = lAssembly.GetType("University.DataObjects." + _tableName);
                ActionCreateEditForm action = new ActionCreateEditForm(EditEntryFormMode.Add, null, type, new List <PropertyInfo>(), DataChanged, false);
                Entry entry = action.InvokeForm();
                if (entry == null)
                {
                    return;
                }
                PropertyValue = entry.Id;
            }
            TextBoxTextChanged(this, new EventArgs());
        }
示例#3
0
        private void LabelLinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (string.IsNullOrEmpty((string)PropertyValue))
            {
                return;
            }
            List <Entry> entries = DataManagerLocal.Inst.Select(_tableName, new Guid((string)PropertyValue));

            if (entries.Count == 0)
            {
                return;
            }
            Entry entry = DataManagerLocal.Inst.Select(_tableName, new Guid((string)PropertyValue))[0];
            ActionCreateEditForm action = new ActionCreateEditForm(EditEntryFormMode.Edit, entry, entry.GetType(), new List <PropertyInfo>(), DataChanged, false);

            action.InvokeForm();
            TextBoxTextChanged(this, new EventArgs());
        }
示例#4
0
        private void BtnEditClick(object sender, EventArgs e)
        {
            TreeNode node = _treeView.SelectedNode;

            if (node == null)
            {
                return;
            }
            if (string.IsNullOrEmpty(node.Name))
            {
                return;
            }
            List <Entry> entries = DataManagerLocal.Inst.Select(node.Parent.Text, new Guid(node.Name));

            if (entries.Count == 0)
            {
                return;
            }
            Entry entry = entries[0];


            List <PropertyInfo> properties;
            bool isCusom;

            using (FilterPropertiesForm form = new FilterPropertiesForm())
            {
                form.Type = entry.GetType();

                if (form.ShowDialog() == DialogResult.Cancel)
                {
                    return;
                }

                properties = form.Properties;
                isCusom    = form.IsCustom;
            }

            ActionCreateEditForm action = new ActionCreateEditForm(EditEntryFormMode.Edit, entry, entry.GetType(), properties, UpdateData, isCusom);

            action.InvokeForm();
        }