private void treeListPollGroup_FocusedNodeChanged(object sender, FocusedNodeChangedEventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeListPollGroup); if (selectedNode == null) { return; } if (this.MoveItems != null) { foreach (DataRow dataRow in this.MoveItems) { dataRow["idpollgroup"] = selectedNode["idpollgroup"]; } this.Cursor = Cursors.Default; this.MoveItems = (DataRow[])null; this.isKeyMove = false; } if (this.MoveGroup != null) { this.treeListPollGroup.DataSource = (object)null; if (this.MoveGroup["parentid"] == DBNull.Value) { this.MoveGroup["imageindex"] = (object)0; } this.MoveGroup["parentid"] = selectedNode["idpollgroup"]; this.Cursor = Cursors.Default; this.MoveGroup = (DataRow)null; this.isKeyMove = false; this.treeListPollGroup.DataSource = (object)this.bs; } this.isKeyMove = false; }
private void TemplateForm_FormClosing(object sender, FormClosingEventArgs e) { if (AtDataSet.IsModifDataSet((DataSet)this.ds)) { switch (MessageBox.Show("Данные были изменены!\nСохранить данные?", "Закрытие формы шаблонов", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question)) { case DialogResult.Cancel: e.Cancel = true; break; case DialogResult.Yes: this.SaveToBase(); break; } } DataRow dataRow = AtGrid.getDataRow((Control)this.gridControlTemplate); if (dataRow != null) { Settings.SavedValues.IdTemplateProduction = Useful.GetInt32(dataRow["idtemplate"]); } DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeListTemplateGroup); if (selectedNode == null) { return; } Settings.SavedValues.IdTemplateProductionGroup = Useful.GetInt32(selectedNode["idtemplategroup"]); }
private void toolStripMenuItem8_Click(object sender, EventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeList1); if (selectedNode == null) { return; } bool flag = false; foreach (DataRow dataRow in (InternalDataCollectionBase)this.table_goodanaloggroup.Rows) { if (dataRow.RowState != DataRowState.Deleted && dataRow["parentid"] != DBNull.Value && (int)dataRow["parentid"] == (int)selectedNode["idgoodanaloggroup"]) { flag = true; break; } } if (flag) { int num = (int)MessageBox.Show("Сначало необходимо удалить вложенные группы.", "Удаление группы", MessageBoxButtons.OK, MessageBoxIcon.Hand); } else { selectedNode.Delete(); } }
private void MenuGroupMoveToGroup_Click(object sender, EventArgs e) { if (!this.DocClass.SetMoveGroup(AtTreeList.GetSelectedNode(this.treeListTemplateGroup))) { return; } this.Cursor = Cursors.Hand; }
private void MenuGroupMove_Click(object sender, EventArgs e) { this.MoveGroup = AtTreeList.GetSelectedNode(this.treeListGroup); if (this.MoveGroup == null) { return; } this.Cursor = Cursors.Hand; }
private void toolStripMenuItemPoolGroupRemove_Click(object sender, EventArgs e) { this.MoveGroup = AtTreeList.GetSelectedNode(this.treeListPollGroup); if (this.MoveGroup == null) { return; } this.Cursor = Cursors.Hand; }
private void MenuGroupSetMain_Click(object sender, EventArgs e) { this.MoveGroup = AtTreeList.GetSelectedNode(this.treeListGroup); if (this.MoveGroup == null) { return; } this.MoveElements((DataRow)null); }
private void treeList1_FocusedNodeChanged(object sender, FocusedNodeChangedEventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeList1); if (selectedNode == null) { return; } this.gridView1.Columns["idgoodanaloggroup"].FilterInfo = new ColumnFilterInfo(this.gridView1.Columns["idgoodanaloggroup"], selectedNode["idgoodanaloggroup"], ""); }
public void MoveElements() { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeListGroup); if (selectedNode == null) { return; } this.MoveElements(selectedNode); }
private void toolStripMenuItem7_Click(object sender, EventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeList1); if (selectedNode == null || InputBox.ShowDialog("Изменение имени группы", "Введите новое имя", selectedNode["name"].ToString()) == DialogResult.Cancel) { return; } selectedNode["name"] = (object)InputBox.Value; }
private void MenuGroupRemove_Click(object sender, EventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeListGroup); if (selectedNode == null || MessageBox.Show("Вы действительно хотите удалить текущую группу?", "Удаление группы типов проёмов", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } selectedNode.Delete(); }
private void MenuGroupRemove_Click(object sender, EventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeListGroup); if (selectedNode == null) { return; } selectedNode.Delete(); }
private void MenuGroupSetMain_Click(object sender, EventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeListGroup); if (selectedNode == null) { return; } selectedNode["parentid"] = (object)DBNull.Value; }
private void MenuGroupAddChild_Click(object sender, EventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeListTemplateGroup); if (selectedNode == null) { return; } this.DocClass.AddTemplateGroup(selectedNode, TemplateType.ProductionType); }
private void toolStripMenuItemPollGroupMakeRoot_Click(object sender, EventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeListPollGroup); if (selectedNode == null || (int)selectedNode["imageindex"] == 5) { return; } selectedNode["parentid"] = (object)DBNull.Value; selectedNode["imageindex"] = (object)0; }
private void treeListGroup_FocusedNodeChanged(object sender, FocusedNodeChangedEventArgs e) { if (AtTreeList.GetSelectedNode(this.treeListGroup) == null) { return; } if (!this.isKeyMove) { this.MoveElements(); } this.isKeyMove = false; }
private void MenuGroupRename_Click(object sender, EventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeListGroup); if (selectedNode == null || InputBox.ShowDialog("Изменение группы", "Введите новое имя", "Введите новый комментарий", selectedNode["name"].ToString(), selectedNode["comment"].ToString()) == DialogResult.Cancel) { return; } this.SaveDataMember((Control)this.treeListGroup); selectedNode["name"] = (object)InputBox.Value; selectedNode["comment"] = (object)InputBox.Value2; this.RestoreDataMember((Control)this.treeListGroup); }
private void toolStripMenuItem6_Click(object sender, EventArgs e) { if (this.treeList1.Selection.Count == 0) { return; } DataRow row = ((DataRowView)this.treeList1.GetDataRecordByNode(this.treeList1.Selection[0])).Row; foreach (DataRow dataRow in AtTreeList.GetListNodesRows(this.treeList1, this.treeList1.FocusedNode)) { dataRow.Delete(); } }
private void MenuItemAdd_Click(object sender, EventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeListGroup); if (selectedNode == null) { return; } DataRow row = this.table_peoplepost.NewRow(); row["idpeoplepost"] = (object)dbconn.GetGenId("gen_peoplepost"); row["idpeoplepostgroup"] = selectedNode["idpeoplepostgroup"]; row["name"] = (object)"Новая должность"; this.table_peoplepost.Rows.Add(row); }
private void MenuItemAdd_Click(object sender, EventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeListGroup); if (selectedNode == null) { return; } DataRow row = this.table_SourceInfo.NewRow(); row["idSourceInfo"] = (object)dbconn.GetGenId("gen_SourceInfo"); row["idSourceInfogroup"] = selectedNode["idSourceInfogroup"]; row["name"] = (object)"Новый источник информации"; this.table_SourceInfo.Rows.Add(row); }
private void toolStripMenuItem1_Click(object sender, EventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeList1); if (selectedNode == null) { return; } DataRow row = this.table_goodanalog.NewRow(); row["idgoodanalog"] = (object)dbconn.GetGenId("gen_goodanalog"); row["name"] = (object)"Новый аналог"; row["idgoodanaloggroup"] = selectedNode["idgoodanaloggroup"]; this.table_goodanalog.Rows.Add(row); }
private void toolStripMenuItem1_Click(object sender, EventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeList1); if (selectedNode == null) { return; } DataRow row = this.table_color.NewRow(); row["idcolor"] = (object)dbconn.GetGenId("gen_color"); row["name"] = (object)"Новый цвет"; row["windraw"] = (object)1; row["idcolorgroup"] = selectedNode["idcolorgroup"]; row["color"] = (object)-1; this.table_color.Rows.Add(row); }
private void MenuGroupRename_Click(object sender, EventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeListGroup); if (selectedNode == null) { return; } InputBoxForm inputBoxForm = new InputBoxForm("Редактирование группы типов проёмов", "Наименование", "Комментарий", selectedNode["name"].ToString(), selectedNode["comment"].ToString()); if (inputBoxForm.ShowDialog() == DialogResult.Cancel) { return; } selectedNode["name"] = (object)inputBoxForm.Value; selectedNode["comment"] = (object)inputBoxForm.Value2; }
private void treeListTemplateGroup_FocusedNodeChanged(object sender, FocusedNodeChangedEventArgs e) { if (this.disableEvent) { return; } DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeListTemplateGroup); if (selectedNode == null) { return; } this.disableEvent = true; this.DocClass.MoveGroupMethod(selectedNode); this.DocClass.MoveItemToGroup(selectedNode); this.Cursor = Cursors.Default; this.disableEvent = false; }
private void toolStripMenuItem6_Click(object sender, EventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeList1); if (selectedNode == null) { return; } DataRow row = this.table_goodanaloggroup.NewRow(); row["idgoodanaloggroup"] = (object)dbconn.GetGenId("gen_goodanaloggroup"); if (InputBox.ShowDialog("Создание дочерней группы", "Введите имя", selectedNode["name"].ToString()) == DialogResult.Cancel) { return; } row["name"] = (object)InputBox.Value; row["parentid"] = selectedNode["idgoodanaloggroup"]; this.table_goodanaloggroup.Rows.Add(row); }
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 TemplateForm_Shown(object sender, EventArgs e) { AtTreeList.SelectNode(this.treeListTemplateGroup, "idtemplategroup", Settings.SavedValues.IdTemplateProductionGroup); AtGrid.SelectRow(this.gridControlTemplate, "idtemplate", (object)Settings.SavedValues.IdTemplateProduction, true); if (this.Is_Dialog) { this.treeListTemplateGroup.ContextMenuStrip = (ContextMenuStrip)null; this.gridControlTemplate.ContextMenuStrip = (ContextMenuStrip)null; this.gridViewTemplate.OptionsBehavior.Editable = false; this.gridViewTemplateParam.OptionsBehavior.Editable = false; this.gridControlTemplate.ViewCollection.Remove((BaseView)this.gridViewTemplateParam); this.gridControlTemplate.LevelTree.Nodes.Clear(); this.gridViewTemplate.OptionsView.ShowDetailButtons = false; } else { this.gridViewTemplate.OptionsView.ShowDetailButtons = true; } }
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"]); }
private void toolStripMenuItemPollAdd_Click(object sender, EventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeListPollGroup); if (selectedNode == null) { return; } DataRow dataRow = this.ds_poll.Tables["poll"].NewRow(); dataRow["idpoll"] = (object)dbconn.GetGenId("gen_poll"); dataRow["idpollgroup"] = selectedNode["idpollgroup"]; dataRow["dtedit"] = (object)DateTime.Now; this.ds_poll.Tables["poll"].Rows.Add(dataRow); if (this.db.quModifDataSet(this.ds_poll) > 0) { this.SaveToBase(); } MdiManager.Add((Control) new PollEditForm(dataRow)); }
private void MenuGroupAddChild_Click(object sender, EventArgs e) { DataRow selectedNode = AtTreeList.GetSelectedNode(this.treeListGroup); if (selectedNode == null) { return; } InputBoxForm inputBoxForm = new InputBoxForm("Добавление дочерней группы", "Наименование", "Комментарий", selectedNode["name"].ToString(), ""); if (inputBoxForm.ShowDialog() == DialogResult.Cancel) { return; } DataRow row = this.table_embrasuretypegroup.NewRow(); row["idembrasuretypegroup"] = (object)dbconn.GetGenId("gen_embrasuretypegroup"); row["parentid"] = selectedNode["idembrasuretypegroup"]; row["name"] = (object)inputBoxForm.Value; row["comment"] = (object)inputBoxForm.Value2; row["isactive"] = (object)true; this.table_embrasuretypegroup.Rows.Add(row); }