private void barButtonItem29_ItemClick(object sender, ItemClickEventArgs e) { try { Control item = new ShowItems(); documentManager1.View.AddDocument(item).Caption = "عرض"; int index = tabbedView1.Documents.Count - 1; DevExpress.XtraBars.Docking2010.Views.Tabbed.Document doc = tabbedView1.Documents[index] as DevExpress.XtraBars.Docking2010.Views.Tabbed.Document; tabbedView1.Controller.Select(doc); } catch (System.Data.Entity.Validation.DbEntityValidationException dbEx) { Exception raise = dbEx; foreach (var validationErrors in dbEx.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { string message = string.Format("{0}:{1}", validationErrors.Entry.Entity.ToString(), validationError.ErrorMessage); raise = new InvalidOperationException(message, raise); } } throw raise; } catch (Exception dbEx) { Exception raise = dbEx; var val = dbEx.InnerException; MessageBox.Show(val.ToString()); //throw raise; } }
public void ShowBotDetailsTab(SBot sbot) { try { foreach (var doc in tabbedViewMain.Documents) { if (doc.ControlName == "docBot" + sbot.CharName) { tabbedViewMain.ActivateDocument(doc.Control); return; } } this.Invoke(new MethodInvoker(() => { DevExpress.XtraBars.Docking2010.Views.Tabbed.Document nDoc = new DevExpress.XtraBars.Docking2010.Views.Tabbed.Document(this.components); nDoc.Caption = sbot.CharName; nDoc.ControlName = "docBot" + sbot.CharName; nDoc.Tag = sbot; //nDoc.Image = global::SbotControl.Properties.Resources.usergroup_16x16; tabbedViewMain.Documents.Add(nDoc); tabbedViewMain.ActivateDocument(nDoc.Control); })); } catch (Exception ex) { Program.dbOperations.SaveToEx(this.GetType().ToString(), ex.Message, ex.StackTrace); } }
private void barButtonItem11_ItemClick(object sender, ItemClickEventArgs e) { Control item = new constraint(); documentManager1.View.AddDocument(item).Caption = "إضافة قيد"; int index = tabbedView1.Documents.Count - 1; DevExpress.XtraBars.Docking2010.Views.Tabbed.Document doc = tabbedView1.Documents[index] as DevExpress.XtraBars.Docking2010.Views.Tabbed.Document; tabbedView1.Controller.Select(doc); }
private void barButtonItem27_ItemClick_1(object sender, ItemClickEventArgs e) { Control item = new priceshow(); documentManager1.View.AddDocument(item).Caption = "عروض الاسعار"; int index = tabbedView1.Documents.Count - 1; DevExpress.XtraBars.Docking2010.Views.Tabbed.Document doc = tabbedView1.Documents[index] as DevExpress.XtraBars.Docking2010.Views.Tabbed.Document; tabbedView1.Controller.Select(doc); }
private void barButtonItem32_ItemClick(object sender, ItemClickEventArgs e) { Control item = new VenforVendpliersReview(); documentManager1.View.AddDocument(item).Caption = "عرض"; int index = tabbedView1.Documents.Count - 1; DevExpress.XtraBars.Docking2010.Views.Tabbed.Document doc = tabbedView1.Documents[index] as DevExpress.XtraBars.Docking2010.Views.Tabbed.Document; tabbedView1.Controller.Select(doc); }
private void barButtonItem27_ItemClick(object sender, ItemClickEventArgs e) { Control item = new rptSales(); documentManager1.View.AddDocument(item).Caption = "تقارير المبيعات"; int index = tabbedView1.Documents.Count - 1; DevExpress.XtraBars.Docking2010.Views.Tabbed.Document doc = tabbedView1.Documents[index] as DevExpress.XtraBars.Docking2010.Views.Tabbed.Document; tabbedView1.Controller.Select(doc); }
private void barButtonItem36_ItemClick(object sender, ItemClickEventArgs e) { Control item = new InvoiceSearching(InvoiceWorkflowState.Payment); documentManager1.View.AddDocument(item).Caption = "طلبات شراء مصدقة"; int index = tabbedView1.Documents.Count - 1; DevExpress.XtraBars.Docking2010.Views.Tabbed.Document doc = tabbedView1.Documents[index] as DevExpress.XtraBars.Docking2010.Views.Tabbed.Document; tabbedView1.Controller.Select(doc); }
private void barButtonItem21_ItemClick(object sender, ItemClickEventArgs e) { Control item = new InvoiceRequest(InvoiceWorkflowState.Request, null); documentManager1.View.AddDocument(item).Caption = "إذن شراء"; int index = tabbedView1.Documents.Count - 1; DevExpress.XtraBars.Docking2010.Views.Tabbed.Document doc = tabbedView1.Documents[index] as DevExpress.XtraBars.Docking2010.Views.Tabbed.Document; tabbedView1.Controller.Select(doc); }
private void barButtonItem31_ItemClick(object sender, ItemClickEventArgs e) { try { Control item = new ReportsPage(); documentManager1.View.AddDocument(item).Caption = "المخازن"; int index = tabbedView1.Documents.Count - 1; DevExpress.XtraBars.Docking2010.Views.Tabbed.Document doc = tabbedView1.Documents[index] as DevExpress.XtraBars.Docking2010.Views.Tabbed.Document; tabbedView1.Controller.Select(doc); } catch (Exception) { } }
private void barButtonItem16_ItemClick(object sender, ItemClickEventArgs e) { UserControl Sup = new Suppliers(); try { Control item = new Suppliers(); documentManager1.View.AddDocument(item).Caption = "الموردين"; int index = tabbedView1.Documents.Count - 1; DevExpress.XtraBars.Docking2010.Views.Tabbed.Document doc = tabbedView1.Documents[index] as DevExpress.XtraBars.Docking2010.Views.Tabbed.Document; tabbedView1.Controller.Select(doc); } catch (Exception ed) { MessageBox.Show(ed.ToString()); } }
private void ActivateDoc(string controlName, string caption, Image img) { try { foreach (var doc in tabbedViewMain.Documents) { if (doc.ControlName == controlName) return; } DevExpress.XtraBars.Docking2010.Views.Tabbed.Document nDoc = new DevExpress.XtraBars.Docking2010.Views.Tabbed.Document(this.components); nDoc.Caption = caption; nDoc.Image = img; nDoc.ControlName = controlName; tabbedViewMain.Documents.Add(nDoc); } catch (Exception ex) { MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ActivateDoc(string controlName, string caption, Image img) { try { foreach (var doc in tabbedViewMain.Documents) { if (doc.ControlName == controlName) { return; } } DevExpress.XtraBars.Docking2010.Views.Tabbed.Document nDoc = new DevExpress.XtraBars.Docking2010.Views.Tabbed.Document(this.components); nDoc.Caption = caption; nDoc.Image = img; nDoc.ControlName = controlName; tabbedViewMain.Documents.Add(nDoc); } catch (Exception ex) { MessageBox.Show(ex.Message, "error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void bbiAccount_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { foreach (var doc in tabbedViewMain.Documents) { if (doc.ControlName == "docAccount") return; } DevExpress.XtraBars.Docking2010.Views.Tabbed.Document nDoc = new DevExpress.XtraBars.Docking2010.Views.Tabbed.Document(this.components); nDoc.Caption = "Accounts"; nDoc.ControlName = "docAccount"; nDoc.FloatLocation = new System.Drawing.Point(57, 178); nDoc.FloatSize = new System.Drawing.Size(985, 375); nDoc.Image = global::SbotControl.Properties.Resources.usergroup_16x16; docAccountCtr = new UI.AccountUC(); tabbedViewMain.Documents.Add(nDoc); } catch (Exception ex) { Program.dbOperations.SaveToEx(this.GetType().ToString(), ex.Message, ex.StackTrace); } }
private void GenerateLayoutBodyDock(FanLayoutDock body) { Container.GetDockManager().BeginInit(); DockPanel[] list = new DockPanel[body.Panels.Count]; int index = 0; foreach (FanLayoutPanel panel in body.Panels) { DockPanel dockPanel = new DockPanel(); dockPanel.Options.ShowCloseButton = true; dockPanel.Options.ShowAutoHideButton = true; dockPanel.Options.ShowMaximizeButton = true; dockPanel.ClosingPanel += dockPanel_ClosingPanel; if (panel.TabView) //是否属于TabView面板 { //生成DockPanel对象 dockPanel.DockedAsTabbedDocument = true; dockPanel.ID = new System.Guid(panel.Guid); dockPanel.Location = new System.Drawing.Point(0, 200); dockPanel.Name = panel.Name; dockPanel.Width = panel.Width; dockPanel.Height = panel.Height; dockPanel.Text = panel.Title; ControlContainer container = new ControlContainer(); container.Location = new System.Drawing.Point(0, 0); container.Dock = DockStyle.Fill; container.Name = panel.Name + "_Container"; container.Size = new System.Drawing.Size(493, 242); container.TabIndex = 0; dockPanel.Controls.Add(container); //加载UiView界面 LoadAssemblyToPanel(dockPanel, container, panel.Assembly, panel.AssemblyType); //将Panel加载到TabbedView中 DevExpress.XtraBars.Docking2010.Views.Tabbed.Document document = new DevExpress.XtraBars.Docking2010.Views.Tabbed.Document(Container.GetComponents()); document.Caption = panel.Title; document.ControlName = panel.Name; document.FloatLocation = new System.Drawing.Point(0, 0); document.FloatSize = new System.Drawing.Size(200, 200); document.Properties.AllowClose = DevExpress.Utils.DefaultBoolean.True; document.Properties.AllowFloat = DevExpress.Utils.DefaultBoolean.True; document.Properties.AllowFloatOnDoubleClick = DevExpress.Utils.DefaultBoolean.True; //Container.GetTabbedView().AddDocument(dockPanel); //Container.GetTabbedView().ActivateDocument(dockPanel); Container.GetTabbedView().Documents.Add(document); } else { //生成DockPanel对象 dockPanel.Dock = FanLayoutDockPositionEnumHelper.toDockingStyle(panel.DockPosistion); dockPanel.ID = new System.Guid(panel.Guid); dockPanel.Location = new System.Drawing.Point(0, 200); dockPanel.Name = panel.Name; dockPanel.OriginalSize = new System.Drawing.Size(panel.Width, panel.Height); dockPanel.Width = panel.Width; dockPanel.Height = panel.Height; dockPanel.Text = panel.Title; if (panel.ChildPanelItems.Count == 0) //没有子面板 { ControlContainer container = new ControlContainer(); container.Location = new System.Drawing.Point(0, 0); container.Dock = DockStyle.Fill; container.Name = panel.Name + "_Container"; dockPanel.OriginalSize = new System.Drawing.Size(dockPanel.Width, dockPanel.Height); dockPanel.Width = dockPanel.Width; dockPanel.Height = dockPanel.Height; container.TabIndex = 0; dockPanel.Controls.Add(container); //将Assembly加载到面板中,构建面板内容 LoadAssemblyToPanel(dockPanel, container, panel.Assembly, panel.AssemblyType); } else //有子面板 { //生成子Panel GenerateLayoutChildPanels(panel.ChildPanelItems, dockPanel); } } list[index++] = dockPanel; //将面板句柄注册到寻址服务中 this.GetAddressService().Register(dockPanel.Name, dockPanel, ControlTypeEnum.Panel); } Container.GetDockManager().RootPanels.AddRange(list); Container.Controls.AddRange(list); Container.GetDockManager().EndInit(); //GenerateLayoutDocumentContainer(body); }
private void bbiWorldMap_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { try { foreach (var doc in tabbedViewMain.Documents) { if (doc.ControlName == "docMap") return; } DevExpress.XtraBars.Docking2010.Views.Tabbed.Document nDoc = new DevExpress.XtraBars.Docking2010.Views.Tabbed.Document(this.components); nDoc.Caption = "World Map"; nDoc.ControlName = "docMap"; nDoc.Image = global::SbotControl.Properties.Resources.shapelabels_16x16; docMapCtr = new UI.MapUC(); tabbedViewMain.Documents.Add(nDoc); } catch (Exception ex) { Program.dbOperations.SaveToEx(this.GetType().ToString(), ex.Message, ex.StackTrace); } }
private void barButtonItem8_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { DevExpress.XtraBars.Docking2010.Views.Tabbed.Document newDoc = tabbedView1.AddDocument(new ucContent()) as DevExpress.XtraBars.Docking2010.Views.Tabbed.Document; newDoc.Caption = "New Document " + (tabbedView1.Documents.Count).ToString(); }
private void AddPage(string sSourceName) { DevExpress.XtraBars.Docking.DockPanel dockPanel = new DevExpress.XtraBars.Docking.DockPanel(); DevExpress.XtraBars.Docking.ControlContainer dockPanel_Container = new DevExpress.XtraBars.Docking.ControlContainer(); DevExpress.XtraBars.Docking2010.Views.Tabbed.Document page = new DevExpress.XtraBars.Docking2010.Views.Tabbed.Document(this.components); DevExpress.XtraGrid.GridControl gridControl = new DevExpress.XtraGrid.GridControl(); DevExpress.XtraGrid.Views.Grid.GridView gridView = new DevExpress.XtraGrid.Views.Grid.GridView(); m_aryDocPanels.Add(dockPanel); m_aryDocPages.Add(page); m_aryGridCtrls.Add(gridControl); string sCtrlIndex = string.Format("{0:00}", m_aryDocPages.Count); this.documentMainGroup.Items.Add(page); this.dockManager1.AddPanel(DevExpress.XtraBars.Docking.DockingStyle.Float, dockPanel); // // dockPanel // dockPanel.Controls.Add(dockPanel_Container); dockPanel.DockedAsTabbedDocument = true; dockPanel.FloatLocation = new System.Drawing.Point(1920, 0); dockPanel.ID = Guid.NewGuid(); dockPanel.Name = string.Format("dockPanel{0}", sCtrlIndex); dockPanel.OriginalSize = new System.Drawing.Size(200, 200); dockPanel.Text = sSourceName; dockPanel.ClosingPanel += DockPanel_ClosingPanel; // // dockPanel_Container // dockPanel_Container.Controls.Add(gridControl); dockPanel_Container.Location = new System.Drawing.Point(0, 0); dockPanel_Container.Name = string.Format("dockPanel{0}_Container", sCtrlIndex); dockPanel_Container.Size = new System.Drawing.Size(1029, 476); dockPanel_Container.TabIndex = 0; // // gridControl // gridControl.Dock = System.Windows.Forms.DockStyle.Fill; gridControl.Location = new System.Drawing.Point(0, 0); gridControl.MainView = gridView; gridControl.Name = string.Format("gridControl{0}", sCtrlIndex); gridControl.Size = new System.Drawing.Size(1037, 359); gridControl.TabIndex = 0; gridControl.ViewCollection.Add(gridView); gridControl.Resize += new System.EventHandler(this.gridControl_Resize); // // gridView // gridView.Appearance.Row.Font = new System.Drawing.Font("Consolas", 9F); gridView.Appearance.Row.Options.UseFont = true; gridView.ColumnPanelRowHeight = 0; gridView.FooterPanelHeight = 0; gridView.GridControl = gridControl; gridView.GroupRowHeight = 0; gridView.Name = string.Format("gridView{0}", sCtrlIndex); gridView.OptionsBehavior.AllowAddRows = DevExpress.Utils.DefaultBoolean.False; gridView.OptionsBehavior.AllowDeleteRows = DevExpress.Utils.DefaultBoolean.False; gridView.OptionsCustomization.AllowColumnMoving = false; gridView.OptionsCustomization.AllowGroup = false; gridView.OptionsCustomization.AllowRowSizing = true; gridView.OptionsLayout.Columns.AddNewColumns = false; gridView.OptionsLayout.Columns.RemoveOldColumns = false; gridView.OptionsView.ColumnAutoWidth = false; gridView.OptionsView.RowAutoHeight = true; gridView.OptionsView.ShowGroupExpandCollapseButtons = false; gridView.OptionsView.ShowGroupPanel = false; gridView.OptionsView.ShowIndicator = false; gridView.RowHeight = 0; gridView.ScrollStyle = DevExpress.XtraGrid.Views.Grid.ScrollStyleFlags.LiveHorzScroll; gridView.ViewCaptionHeight = 0; CriteriaOperator criteria = new BinaryOperator(new OperandProperty("source"), new OperandValue(sSourceName), BinaryOperatorType.Equal); gridView.ActiveFilterCriteria = criteria; // // page // page.Caption = sSourceName; page.ControlName = dockPanel.Name; page.FloatLocation = new System.Drawing.Point(this.Location.X / 2, this.Location.Y / 2); page.FloatSize = new System.Drawing.Size(400, 400); page.Properties.AllowClose = DevExpress.Utils.DefaultBoolean.True; page.Properties.AllowFloat = DevExpress.Utils.DefaultBoolean.True; page.Properties.AllowFloatOnDoubleClick = DevExpress.Utils.DefaultBoolean.True; Application.DoEvents(); BuildupDataGrid(gridView); }