private void categoryToolStripMenuItem_Click(object sender, EventArgs e) { frmCategory frm = new frmCategory(); //frm.MdiParent = this; frm.ShowDialog(); }
private void categoryToolStripMenuItem_Click(object sender, EventArgs e) { frmCategory frm = new frmCategory(); frm.ShowDialog(); frm.Focus(); }
private void tsmiCategory_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; frmCategory frm = new frmCategory(false); this.Cursor = Cursors.Default; frm.ShowDialog(); }
private void btnAdd_Click(object sender, EventArgs e) { switch (CurrentPoco) { case CurrentPoco.Shipper: frmShipper fs = new frmShipper(); fs.ShowDialog(); break; case CurrentPoco.Category: frmCategory fc = new frmCategory(); fc.ShowDialog(); break; default: break; } }
private void dgvMain_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { switch (CurrentPoco) { case CurrentPoco.Shipper: frmShipper fs = new frmShipper(dgvMain.Rows[e.RowIndex].DataBoundItem as Shipper); fs.ShowDialog(); break; case CurrentPoco.Category: frmCategory fc = new frmCategory((Category)dgvMain.Rows[e.RowIndex].DataBoundItem); fc.ShowDialog(); break; default: break; } } }
private void menuCategory_Click(object sender, EventArgs e) { if (sender is ToolStripItem) { if (m_selectedNodeCategory != null) { ModelCategory selectedCategory = (ModelCategory)m_selectedNodeCategory.Tag; ToolStripItem item = (ToolStripItem)sender; switch (item.Name) { case "menuItemAddCategory": { if ("ETC".Equals(selectedCategory.Code)) { return; } frmCategory frm = new frmCategory(); frm.CurAction = frmCategory.ActionType.Add; frm.ParentModel = selectedCategory; if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (frm.CurModel != null) { DataManager.Current.Category.AddCategory(frm.ParentModel, frm.CurModel); } } } break; case "menuItemDelCategory": { if ("ROOT".Equals(selectedCategory.Code) || "ETC".Equals(selectedCategory.Code)) { return; } ModelCategory categoryChild = DataManager.Current.Category.FindByParentID(selectedCategory.Id); if (categoryChild != null) { MessageBox.Show("Can't delete because this has child categories", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } string sMessage = string.Format("Really delete {0}[{1}]?", selectedCategory.DisplayName, selectedCategory.Code); if (MessageBox.Show(sMessage, "CONFIRM", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { DataManager.Current.DeleteCategory(selectedCategory); } } break; case "menuItemEditCategory": { if ("ROOT".Equals(selectedCategory.Code) || "ETC".Equals(selectedCategory.Code)) { return; } frmCategory frm = new frmCategory(); frm.CurAction = frmCategory.ActionType.Edit; frm.ParentModel = selectedCategory.Parent; frm.CurModel = selectedCategory; if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { DataManager.Current.UpdateCategory(frm.CurModel); SelectedNodeChange(m_selectedNodeCategory); } } break; } } } }
private void bCAT_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { frmCategory frm = new frmCategory(); frm.ShowDialog(); }