private void MenuGroupAddChild_Click(object sender, EventArgs e) { ds_addclassification.addclassificationgroupRow addclassificationgroupRow = AtTreeList.GetSelectedNode(this.treeListGroup) as ds_addclassification.addclassificationgroupRow; if (addclassificationgroupRow == null || InputBox.ShowDialog("Создание дочерней группы", "Введите имя", "Введите комментарий", addclassificationgroupRow["name"].ToString(), "") == DialogResult.Cancel) { return; } ds_addclassification.addclassificationgroupRow row = this.ds.addclassificationgroup.NewaddclassificationgroupRow(); row.idaddclassificationgroup = dbconn.GetGenId("gen_addclassificationgroup"); this.SaveDataMember((Control)this.treeListGroup); row.name = InputBox.Value; row.comment = InputBox.Value2; row.isactive = true; row.parentid = addclassificationgroupRow.idaddclassificationgroup; this.ds.addclassificationgroup.AddaddclassificationgroupRow(row); this.RestoreDataMember((Control)this.treeListGroup); this.RestoreDataMember((Control)this.treeListGroup); this.treeListGroup.FocusedNode = AtTreeList.FindNode(this.treeListGroup, (TreeListNode)null, "idaddclassificationgroup", row.idaddclassificationgroup); }
private void MenuGroupAddChild_Click(object sender, EventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeListGroup); if (selectedNode == null || InputBox.ShowDialog("Создание дочерней группы", "Введите имя", "Введите комментарий", selectedNode["name"].ToString(), "") == DialogResult.Cancel) { return; } this.SaveDataMember((Control)this.treeListGroup); DataRow row = this.table_SourceInfogroup.NewRow(); row["idSourceInfogroup"] = (object)dbconn.GetGenId("gen_SourceInfogroup"); row["name"] = (object)InputBox.Value; row["comment"] = (object)InputBox.Value2; row["parentid"] = selectedNode["idSourceInfogroup"]; row["isactive"] = (object)true; this.table_SourceInfogroup.Rows.Add(row); this.RestoreDataMember((Control)this.treeListGroup); this.treeListGroup.FocusedNode = AtTreeList.FindNode(this.treeListGroup, (TreeListNode)null, "idSourceInfogroup", (int)row["idSourceInfogroup"]); }