private void barButtonItem18_ItemClick(object sender, ItemClickEventArgs e) { if (!Class_MyInfo.UseTypeValue.Equals("R005")) { Class_PublicMethod class_PublicMethod = new Class_PublicMethod(); Form_WindowSelect form_WindowSelect = new Form_WindowSelect(); form_WindowSelect.OperateType = "删除"; if (form_WindowSelect.ShowDialog() == DialogResult.OK) { if (class_PublicMethod.DeleteXml(form_WindowSelect.PageKey, form_WindowSelect.PageType)) { if (IsTabbedMdi) { XtraMdiTabPage xtraMdiTabPage = null; foreach (XtraMdiTabPage xtra in xtraTabbedMdiManager1.Pages) { if ((xtra.MdiChild.Tag as Class_WindowType).XmlFileName == form_WindowSelect.PageKey) { xtraMdiTabPage = xtra; } } if (xtraMdiTabPage != null) { xtraMdiTabPage.MdiChild.Close(); } } else { Form form = null; foreach (Form item in this.MdiChildren) { if ((item.Tag as Class_WindowType).XmlFileName == form_WindowSelect.PageKey) { form = item; } } if (form != null) { form.Close(); } } displayAlertMessage("温馨", "指定窗体已删除成功!", null, 3); } else { displayAlertMessage("温馨", "指定窗体删除失败!", null, 3); } } form_WindowSelect.Dispose(); } else { MessageBox.Show("前端开发者没有删除权限!", "温馨提示", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); } }
private void barButtonItem12_ItemClick(object sender, ItemClickEventArgs e) { Class_PublicMethod class_PublicMethod = new Class_PublicMethod(); Form_WindowSelect form_WindowSelect = new Form_WindowSelect(true); form_WindowSelect.OperateType = "效仿添加"; if (form_WindowSelect.ShowDialog() == DialogResult.OK) { string PageKey = form_WindowSelect.PageKey; if ((PageKey != null) && (PageKey.Length > 0)) { PageKey = class_PublicMethod.CopyToNewXml(PageKey, form_WindowSelect.NewPageType, form_WindowSelect.PageType); if (PageKey != null) { switch (form_WindowSelect.NewPageType) { case "select": OpenSelectWin(PageKey); break; case "insert": OpenInsertWin(PageKey); break; case "update": OpenUpdateWin(PageKey); break; case "delete": OpenDeleteWin(PageKey); break; default: OpenSelectWin(PageKey); break; } } } } form_WindowSelect.Dispose(); }
private void iOpen_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Form_WindowSelect form_WindowSelect = new Form_WindowSelect(); form_WindowSelect.OperateType = "打开"; if (form_WindowSelect.ShowDialog() == DialogResult.OK) { string PageKey = form_WindowSelect.PageKey; if ((PageKey != null) && (PageKey.Length > 0)) { switch (form_WindowSelect.PageType) { case "select": OpenSelectWin(PageKey); break; case "insert": OpenInsertWin(PageKey); break; case "update": OpenUpdateWin(PageKey); break; case "delete": OpenDeleteWin(PageKey); break; default: OpenSelectWin(PageKey); break; } } } form_WindowSelect.Dispose(); }