Beispiel #1
0
        /// <summary>
        /// Adds all skin menu items.
        /// </summary>
        private void AddAllMenuItems()
        {
            Caption = "系统界面皮肤(&K)";
            Glyph = Resource.colors;

            foreach (string skinName in GetSortedSkinNames())
            {
                BarItem menuItem = new BarCheckItem(bar.Manager, SkinManager.DefaultSkinName == skinName ? true : false) { Caption = skinName };
                menuItem.ItemClick += OnSwitchSkin;
                AddItem(menuItem);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 加载皮肤列表
        /// </summary>
        public static void LoadSkinList(BarSubItem owner)
        {
            _CurrentSkinList = owner;

            foreach (DevExpress.Skins.SkinContainer skin in DevExpress.Skins.SkinManager.Default.Skins)
            {
                BarCheckItem item = new BarCheckItem(owner.Manager);
                item.Caption = skin.SkinName;
                item.Checked = skin.SkinName == SystemConfig.CurrentConfig.SkinName;
                item.ItemClick += new ItemClickEventHandler(OnSetSkinClick);
                owner.ItemLinks.Add(item);
            }
        }
Beispiel #3
0
        private void InitQuickQueryType(QueryConfig queryConfig)
        {
            BarCheckItem bbi = new BarCheckItem(bmQueryControl, queryConfig.QuickQuery.QuickQueryType == QuickQueryType.Exact);
            bbi.GroupIndex = 2;
            bbi.Name = "bbiQueryType_" + Guid.NewGuid().ToString("N");
            bbi.Caption = "精确查找";
            bbi.Tag = (int)QuickQueryType.Exact;
            bbi.ItemClick += bbi_ItemClick;
            if (bbi.Checked)
                btnQuery.Tag = bbi.Tag;
            popQucikFields.LinksPersistInfo.Add(new LinkPersistInfo(bbi, true));


            bbi = new BarCheckItem(bmQueryControl, queryConfig.QuickQuery.QuickQueryType == QuickQueryType.LeftMatch);
            bbi.GroupIndex = 2;
            bbi.Name = "bbiQueryType_" + Guid.NewGuid().ToString("N");
            bbi.Caption = "左匹配";
            bbi.Tag = (int)QuickQueryType.LeftMatch;
            bbi.ItemClick += bbi_ItemClick;
            if (bbi.Checked)
                btnQuery.Tag = bbi.Tag;
            popQucikFields.LinksPersistInfo.Add(new LinkPersistInfo(bbi));

            bbi = new BarCheckItem(bmQueryControl, queryConfig.QuickQuery.QuickQueryType == QuickQueryType.Fuzzy);
            bbi.GroupIndex = 2;
            bbi.Name = "bbiQueryType_" + Guid.NewGuid().ToString("N");
            bbi.Caption = "模糊查找";
            bbi.Tag = (int)QuickQueryType.Fuzzy;
            bbi.ItemClick += bbi_ItemClick;
            if (bbi.Checked)
                btnQuery.Tag = bbi.Tag;
            popQucikFields.LinksPersistInfo.Add(new LinkPersistInfo(bbi));

            bbi = new BarCheckItem(bmQueryControl, queryConfig.QuickQuery.QuickQueryType == QuickQueryType.Combinatorial);
            bbi.GroupIndex = 2;
            bbi.Name = "bbiQueryType_" + Guid.NewGuid().ToString("N");
            bbi.Caption = "组合查找";
            bbi.Tag = (int)QuickQueryType.Combinatorial;
            bbi.ItemClick += bbi_ItemClick;
            if (bbi.Checked)
                btnQuery.Tag = bbi.Tag;
            popQucikFields.LinksPersistInfo.Add(new LinkPersistInfo(bbi));

        }
Beispiel #4
0
 public PdfViewerForm()
 {
     InitializeComponent();
     UpdateGlass();
     pdfViewer.DocumentCreator  = "PDF Viewer Demo";
     pdfViewer.DocumentProducer = "Developer Express Inc., " + AssemblyInfo.Version;
     UserLookAndFeel.Default.SetSkinStyle("Office 2016 Colorful");
     pdfViewer.CreateRibbon();
     foreach (RibbonPage page in ribbonControl.Pages)
     {
         if (page.Text == "PDF Viewer")
         {
             popupSkins.BeginUpdate();
             popupSkins.Ribbon                  = ribbonControl;
             checkItemAllowFormSkins            = new BarCheckItem(ribbonControl.Manager);
             checkItemAllowFormSkins.Caption    = "Allow Form Skins";
             checkItemAllowFormSkins.ItemClick += new ItemClickEventHandler(OnAllowFormSkinsItemClick);
             popupSkins.AddItem(checkItemAllowFormSkins);
             SkinHelper.InitSkinPopupMenu(popupSkins);
             popupSkins.ItemLinks[1].BeginGroup = true;
             popupSkins.EndUpdate();
             popupSkins.Popup += new EventHandler(OnPmSkinsPopup);
             RibbonPageGroup skinsPage = new RibbonPageGroup(ribbonGallerySkins.Caption);
             SkinHelper.InitSkinGallery(ribbonGallerySkins, true);
             skinsPage.CaptionButtonClick += new RibbonPageGroupEventHandler(OnSkinsPageCaptionButtonClick);
             skinsPage.ItemLinks.Add(ribbonGallerySkins);
             RibbonPageGroup devExpressPage = new RibbonPageGroup("DevExpress");
             devExpressPage.ShowCaptionButton = false;
             AddBarItem(devExpressPage, "Getting Started", "GetStarted", OnGettingStartedItemClicked);
             AddBarItem(devExpressPage, "Get Free Support", "GetSupport", OnGetFreeSupportItemClicked);
             AddBarItem(devExpressPage, "Buy Now", "BuyNow", OnBuyNowItemClicked);
             AddBarItem(devExpressPage, "About", "Info", OnAboutItemClicked);
             page.Groups.AddRange(new RibbonPageGroup[] { skinsPage, devExpressPage });
             break;
         }
     }
     mainFormText = Text;
     pdfViewer.DocumentChanged += new PdfDocumentChangedEventHandler(OnPdfViewerDocumentChanged);
     pdfViewer.UriOpening      += OnPdfViewerUriOpening;
     pdfViewer.LoadDocument(GetDocumentStream());
 }
Beispiel #5
0
        /// <summary>
        /// 初始化皮肤
        /// </summary>
        void InitSkins()
        {
            bool isCheck = false;

            foreach (DevExpress.Skins.SkinContainer cnt in DevExpress.Skins.SkinManager.Default.Skins)
            {
                if (!skinCodes.Contains(cnt.SkinName))
                {
                    continue;
                }
                BarCheckItem item = new BarCheckItem(barMainMenu, false);
                item.Tag     = cnt.SkinName;
                item.Caption = GetSkinName(cnt.SkinName, true);
                barSkinItem.AddItem(item);
                item.ItemClick += new ItemClickEventHandler(OnSkinClick);
                //默认选择一种皮肤
                if (FormatNullValue(item.Tag) == defaultLookAndFeel.LookAndFeel.SkinName)
                {
                    item.Checked        = true;//
                    isCheck             = true;
                    barSkinItem.Caption = skinMask + item.Tag;
                    barSkinItem.Hint    = barSkinItem.Caption;
                }
            }
            if (isCheck == false)
            {
                foreach (BarCheckItemLink link in barSkinItem.ItemLinks)
                {
                    BarCheckItem citem = link.Item as BarCheckItem;
                    if (citem != null && Convert.ToString(citem.Tag) == "Office 2013")
                    {
                        citem.Checked       = true;
                        barSkinItem.Caption = skinMask + citem.Tag;
                        barSkinItem.Hint    = Convert.ToString(barSkinItem.Tag);
                        defaultLookAndFeel.LookAndFeel.SkinName = Convert.ToString(citem.Tag);

                        break;
                    }
                }
            }
        }
        private void bCheckItem_CheckedChanged(object sender, ItemClickEventArgs e)
        {
            BarCheckItem item = sender as BarCheckItem;
            int          j    = 0;

            if (item.Checked)
            {
                foreach (XtraMdiTabPage page in xtraTabbedMdiManager1.Pages)
                {
                    page.Appearance.Header.BackColor = TabColor[j % 6];
                    j++;
                }
            }
            else
            {
                foreach (XtraMdiTabPage page in xtraTabbedMdiManager1.Pages)
                {
                    page.Appearance.Header.BackColor = Color.Empty;
                }
            }
        }
Beispiel #7
0
        private void mnuTaskScenes_BeforePopup(object sender, CancelEventArgs e)
        {
            mnuTaskScenes.ItemLinks.Clear();
            var pr = Program.CurUser;

            if (pr == null || pr.ProjectDescription == null || String.IsNullOrEmpty(pr.TaskName))
            {
                e.Cancel = true;
            }
            else
            {
                var t = pr.ProjectDescription.GetTask(pr.TaskName);
                foreach (var s in t.Scenes)
                {
                    var item = new BarCheckItem(barMgr, s.Name == pr.SceneName);
                    item.Caption    = s.Name;
                    item.ItemClick += new ItemClickEventHandler(mnuTaskScenes_ItemClick);
                    mnuTaskScenes.ItemLinks.Add(item);
                }
            }
        }
Beispiel #8
0
        private void Form1_Load(object sender, EventArgs e)
        {
            MyBar bar = new MyBar();

            bar.DockRow   = 3;
            bar.DockStyle = BarDockStyle.Top;

            BarItem item = new BarButtonItem(myBarManager1, "barButtonItem");

            bar.AddItem(item);
            bar.FixedItems.Add(item);
            item         = new BarCheckItem();
            item.Caption = "barCheckItem";
            bar.AddItem(item);
            bar.FixedItems.Add(item);
            item         = new BarStaticItem();
            item.Caption = "barStaticItem";
            bar.AddItem(item);

            myBarManager1.Bars.Add(bar);
        }
		private void InitContextMenu()
		{
			_barManager.BeginInit();

			var maxId = _barManager.MaxItemId++;

			ItemDoNotGeneratePreview = new BarCheckItem
			{
				Id = maxId,
				Caption = "No PNG Preview",
				CheckBoxVisibility = CheckBoxVisibility.AfterText
			};
			ItemDoNotGeneratePreview.CheckedChanged += (o, e) => DocumentSettingsLoader.OnValuesChanged();
			maxId++;

			ItemDoNotGenerateContentText = new BarCheckItem
			{
				Id = maxId,
				Caption = "No Data File",
				CheckBoxVisibility = CheckBoxVisibility.AfterText
			};
			ItemDoNotGenerateContentText.CheckedChanged += (o, e) => DocumentSettingsLoader.OnValuesChanged();
			maxId++;

			ItemForcePreview = new BarCheckItem
			{
				Id = maxId,
				Caption = "Launch Browser Tab",
				CheckBoxVisibility = CheckBoxVisibility.AfterText
			};
			ItemForcePreview.CheckedChanged += (o, e) => DocumentSettingsLoader.OnValuesChanged();
			maxId++;

			_barManager.Items.Add(ItemDoNotGeneratePreview);
			_barManager.Items.Add(ItemDoNotGenerateContentText);
			_barManager.Items.Add(ItemForcePreview);
			_barManager.MaxItemId = maxId;

			_barManager.EndInit();
		}
Beispiel #10
0
        private object CreateControl(ICommand cmd, string caption, Image icon)
        {
            BarItem barItem = null;

            if (cmd is ICommandEx)
            {
                object objControl = (cmd as ICommandEx).ExControl;
                if (objControl is BarItem)
                {
                    barItem = objControl as BarItem;
                }
                else
                {
                    if (objControl is Control)
                    {
                        (objControl as Control).Text            = caption;
                        (objControl as Control).BackgroundImage = icon;
                    }
                    return(objControl);
                }
            }
            else if (cmd is ICommand)
            {
                if (cmd is ITool)
                {
                    barItem = new BarCheckItem();
                }
                else
                {
                    barItem = new BarButtonItem();
                }
            }
            barItem.Caption     = string.IsNullOrWhiteSpace(caption) ? cmd.Caption : caption;
            barItem.Glyph       = icon;// (icon == null ? cmd.Icon : icon);
            barItem.Hint        = cmd.Tooltip;
            barItem.Tag         = cmd.Name;
            barItem.RibbonStyle = RibbonItemStyles.Large;

            return(barItem);
        }
		private void InitContextMenu()
		{
			_barManager.BeginInit();

			var maxId = _barManager.MaxItemId++;

			ItemDoNotGenerateContentText = new BarCheckItem
			{
				Id = maxId,
				Caption = "No Data File",
				CheckBoxVisibility = CheckBoxVisibility.AfterText
			};
			ItemDoNotGenerateContentText.CheckedChanged += (o, e) => ExcelSettingsLoader.OnValuesChanged();
			maxId++;

			ItemForceDownload = new BarCheckItem
			{
				Id = maxId,
				Caption = "Instant Download",
				CheckBoxVisibility = CheckBoxVisibility.AfterText
			};
			ItemForceDownload.CheckedChanged += (o, e) => ExcelSettingsLoader.OnValuesChanged();
			maxId++;

			ItemForceOpen = new BarCheckItem
			{
				Id = maxId,
				Caption = "Auto Open",
				CheckBoxVisibility = CheckBoxVisibility.AfterText
			};
			ItemForceOpen.CheckedChanged += (o, e) => ExcelSettingsLoader.OnValuesChanged();
			maxId++;

			_barManager.Items.Add(ItemForceDownload);
			_barManager.Items.Add(ItemDoNotGenerateContentText);
			_barManager.Items.Add(ItemForceOpen);
			_barManager.MaxItemId = maxId;

			_barManager.EndInit();
		}
 private void Form1_Load(object sender, EventArgs e)
 {
     foreach (Control control in panelContainer1.Controls)
     {
         if (control is DockPanel)
         {
             DockPanel    panel = (DockPanel)control;
             BarCheckItem item  = new BarCheckItem();
             item.GroupIndex = 1;
             item.Caption    = panel.Text;
             if (panelContainer1.ActiveChild == panel)
             {
                 item.Checked = true;
             }
             item.ItemClick += delegate(object sender1, ItemClickEventArgs args) {
                 panelContainer1.ActiveChild = panel;
                 MakePanelVisible(panelContainer1, panel);
             };
             popupMenu1.AddItem(item);
         }
     }
 }
Beispiel #13
0
        BarItem[] GetRadialMenuItems(BarManager barManager)
        {
            BarItem btnNew = new BarButtonItem(barManager, "New");

            btnNew.ImageOptions.ImageUri.Uri = "New;Size16x16";

            BarSubItem   btnMenuEditors     = new BarSubItem(barManager, "Edit");
            BarCheckItem btnEditAppointment = new BarCheckItem(barManager, false);

            btnEditAppointment.Caption = "Appointment";
            btnEditAppointment.ImageOptions.ImageUri.Uri = "Edit;Size16x16";

            BarCheckItem btnEditMembers = new BarCheckItem(barManager, true);

            btnEditMembers.Caption = "Members";
            btnEditMembers.ImageOptions.ImageUri.Uri = "Edit;Size16x16";

            BarCheckItem btnEditAttendance = new BarCheckItem(barManager, true);

            btnEditAttendance.Caption = "Attendance";
            btnEditAttendance.ImageOptions.ImageUri.Uri = "Edit;Size16x16";

            BarItem[] subMenuItems = new BarItem[] { btnEditAttendance, btnEditAppointment, btnEditMembers };
            btnMenuEditors.AddItems(subMenuItems);

            BarItem btnCopy = new BarButtonItem(barManager, "Copy");

            btnCopy.ImageOptions.ImageUri.Uri = "Copy;Size16x16";

            BarItem btnDelete = new BarButtonItem(barManager, "Delete");

            btnDelete.ImageOptions.ImageUri.Uri = "Delete;Size16x16";

            BarItem btnPaste = new BarButtonItem(barManager, "Paste");

            btnPaste.ImageOptions.ImageUri.Uri = "Paste;Size16x16";

            return(new BarItem[] { btnNew, btnMenuEditors, btnCopy, btnPaste, btnDelete });
        }
Beispiel #14
0
        private static BarSubItem CreateBarSubItem(string displayText, string propertyName, PivotGridField field)
        {
            BarSubItem barSubItem = new BarSubItem();

            barSubItem.Name    = "bsi" + propertyName;
            barSubItem.Content = displayText;

            PropertyInfo property = typeof(PivotGridField).GetProperty(propertyName);

            foreach (object enumValue in Enum.GetValues(property.PropertyType))
            {
                BarCheckItem checkItem = new BarCheckItem();
                checkItem.Name       = "bci" + propertyName + enumValue;
                checkItem.Content    = enumValue.ToString();
                checkItem.IsChecked  = Object.Equals(property.GetValue(field, new object[0]), enumValue);
                checkItem.Tag        = new object[] { field, property, enumValue };
                checkItem.ItemClick += itemClickEventHandler;

                barSubItem.ItemLinks.Add(checkItem);
            }
            return(barSubItem);
        }
Beispiel #15
0
        void SetDockPanelVisibility(BarCheckItem item)
        {
            switch (item.Caption)
            {
            case "Watch List":
                if (!item.Checked)
                {
                    watchListDockPanel.Visibility = XtraBars.Docking.DockVisibility.Hidden;
                }
                else
                {
                    watchListDockPanel.Visibility = XtraBars.Docking.DockVisibility.Visible;
                }
                break;

            case "Transaction":
                if (!item.Checked)
                {
                    transactionGridDockPanel.Visibility = XtraBars.Docking.DockVisibility.Hidden;
                }
                else
                {
                    transactionGridDockPanel.Visibility = XtraBars.Docking.DockVisibility.Visible;
                }
                break;

            case "Top Volumes":
                if (!item.Checked)
                {
                    topVolumesDockPanel.Visibility = XtraBars.Docking.DockVisibility.Hidden;
                }
                else
                {
                    topVolumesDockPanel.Visibility = XtraBars.Docking.DockVisibility.Visible;
                }
                break;
            }
        }
Beispiel #16
0
        public static BarItem CreateItem(CommandType itemType)
        {
            BarItem result = null;

            switch (itemType)
            {
            case CommandType.Button:
                result = new BarButtonItem();
                break;

            case CommandType.CheckButton:
                result = new BarCheckItem();
                break;

            case CommandType.Group:
                result = new BarSubItem();
                break;

            default:
                throw new NotSupportedException(string.Format("BarItemFactory. Command type = {0} not supported.", itemType.ToString()));
            }
            return(result);
        }
        private void bsPanes_GetItemData(object sender, EventArgs e)
        {
            if (this.bsPanes.ItemLinks.Count != 0)
            {
                return;
            }
            XYDiagram dg = (XYDiagram)this.chartControl.Diagram;

            if (dg == null)
            {
                return;
            }
            foreach (XYDiagramPane item in dg.Panes)
            {
                BarCheckItem ch = new BarCheckItem(this.barManager1)
                {
                    Caption = item.Name, Checked = item.Visibility == ChartElementVisibility.Visible
                };
                ch.Tag             = item;
                ch.CheckedChanged += OnPaneCheckedChanged;
                this.bsPanes.ItemLinks.Add(ch);
            }
        }
Beispiel #18
0
        private void chlDG_CheckedChanged(object sender, ItemClickEventArgs e)
        {
            BarCheckItem checkEdit = sender as BarCheckItem;

            switch (checkEdit.Name)
            {
            case "chlDG":
                WindowsFormsSettings.ColumnAutoFilterMode             = ColumnAutoFilterMode.Text;
                WindowsFormsSettings.AllowAutoFilterConditionChange   = DevExpress.Utils.DefaultBoolean.False;
                WindowsFormsSettings.DefaultSettingsCompatibilityMode = SettingsCompatibilityMode.v18_1;
                break;

            default:
                WindowsFormsSettings.ColumnAutoFilterMode             = ColumnAutoFilterMode.Value;
                WindowsFormsSettings.AllowAutoFilterConditionChange   = DevExpress.Utils.DefaultBoolean.Default;
                WindowsFormsSettings.DefaultSettingsCompatibilityMode = SettingsCompatibilityMode.Latest;
                break;
            }
            RegistryKey key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\THCRM", true);

            key.SetValue("TKNC", chkNC.Checked);
            key.Close();
        }
        private void CreateDataSource(FactoryContainer fc)
        {
            if (fc.Factory.Title == null)
            {
                return;
            }



            BarCheckItem bci = new BarCheckItem(barManager1, fc.Factory.FactoryId == activeProvider);

            bci.Manager            = barManager1;
            bci.CheckBoxVisibility = CheckBoxVisibility.BeforeText;
            bci.Caption            = fc.Factory.Title;
            bci.Enabled            = fc.FactorySetting.Status != DataProviderFactoryStatus.Disabled;
            bci.Glyph      = fc.Factory.SmallImage;
            bci.ItemClick += (s, e) =>
            {
                bci.Checked = true;
                LoadFactory(fc);
            };
            bsiDataProviders.AddItem(bci);
        }
        void CreateSubItemLinks()
        {
            var list = DockLayoutSource.GetItems().Where(n => (n.ItemType == DevExpress.Xpf.Layout.Core.LayoutItemType.Document || n.ItemType == DevExpress.Xpf.Layout.Core.LayoutItemType.Panel)).ToList <BaseLayoutItem>();

            foreach (BarItemLinkBase linkItem in SubItem.ItemLinks)
            {
                var baseItem = linkItem as BarCheckItemLink;
                if (baseItem != null)
                {
                    var checkItem = baseItem.Item as BarCheckItem;
                    checkItem.CheckedChanged -= checkItem_CheckedChanged;
                }
            }

            SubItem.ItemLinks.Clear();

            foreach (BaseLayoutItem item in list)
            {
                var checkItem = new BarCheckItem();
                checkItem.Content = item.Caption.ToString();
                checkItem.Tag     = item;

                if (DockLayoutSource.ActiveLayoutItem == item || DockLayoutSource.ActiveDockItem == item)
                {
                    checkItem.IsChecked = true;
                }
                else
                {
                    checkItem.IsChecked = false;
                }

                SubItem.ItemLinks.Add(checkItem);

                checkItem.CheckedChanged += checkItem_CheckedChanged;
            }
        }
Beispiel #21
0
        private void tableview0_ShowGridMenu(object sender, DevExpress.Xpf.Grid.GridMenuEventArgs e)
        {
            // 특정 컬럼 컨텍스트 메뉴 팝업
            if (e.MenuInfo.Column.VisibleIndex == 4)
            {
                e.MenuInfo.Column.AllowEditing = DevExpress.Utils.DefaultBoolean.False;
                BarButtonItem item0 = new BarButtonItem {
                    Content = "일괄 선택"
                };
                item0.ItemClick += (s, ex) => { MessageBox.Show("clicked!!"); };
                BarItemLinkActionBase.SetItemLinkIndex(item0, 0);
                e.Customizations.Add(item0);

                BarItemLinkSeparator item2 = new BarItemLinkSeparator();
                BarItemLinkActionBase.SetItemLinkIndex(item2, 1);
                e.Customizations.Add(item2);

                BarCheckItem item1 = new BarCheckItem {
                    Content = "Checked", IsChecked = true
                };
                BarItemLinkActionBase.SetItemLinkIndex(item1, 2);
                e.Customizations.Add(item1);
            }
        }
        //void OnAllowCollapsingClick(object sender, ItemClickEventArgs e)
        //{
        //    ChartDashboardItem dashboardItem = dashboardDesigner.SelectedDashboardItem as ChartDashboardItem;
        //    MultiPaneSettings settings = MultiPaneSettings.FromJson(dashboardItem.CustomProperties[customPropertyName]);
        //    settings.AllowPaneCollapsing = !settings.AllowPaneCollapsing;
        //    string status = settings.AllowPaneCollapsing == true ? "enabled" : "disabled";
        //    CustomPropertyHistoryItem historyItem = new CustomPropertyHistoryItem(dashboardItem, customPropertyName, settings.ToJson(), $"Pane Collapsing for {dashboardItem.ComponentName} is {status}");
        //    dashboardDesigner.AddToHistory(historyItem);
        //    UpdateBarItems();
        //}


        void AddButtonToRibbon()
        {
            RibbonControl   ribbon = dashboardDesigner.Ribbon;
            RibbonPage      page   = ribbon.GetDashboardRibbonPage(DashboardBarItemCategory.ChartTools, DashboardRibbonPage.Design);
            RibbonPageGroup group  = page.GetGroupByName(ribonPageGroupName);

            if (group == null)
            {
                group = new RibbonPageGroup(ribonPageGroupName)
                {
                    Name = ribonPageGroupName
                };
                page.Groups.Add(group);
            }
            enableBarItem          = CreateEnableBarItem();
            showTitlesBarItem      = CreateShowTitlesBarItem();
            allowCollapsingBarItem = CreateAllowCollapsingBarItem();
            layoutModeBarItem      = CreateLayoutModeBarItem();

            group.ItemLinks.Add(enableBarItem);
            group.ItemLinks.Add(showTitlesBarItem);
            group.ItemLinks.Add(allowCollapsingBarItem);
            group.ItemLinks.Add(layoutModeBarItem);
        }
Beispiel #23
0
        private void InitializeReportPopupMenu()
        {
            reportPopupMenu.Name = "popupMenu_Rerort";
            reportPopupMenu.Ribbon = this.mainRibbonControl;

            bbiReport.ItemClick += bbiReport_Priview_ItemClick;

            bbiReport_Print = new BarButtonItem();
            bbiReport_Print.Name = "bbiReport_Print";
            bbiReport_Print.Glyph = Properties.Resources.Action_Print_16x16;
            bbiReport_Print.ItemClick += bbiReport_Print_ItemClick;
            this.mainRibbonControl.Items.Add(bbiReport_Print);
            reportPopupMenu.ItemLinks.Add(bbiReport_Print);

            //生成报表菜单
            foreach (var subItem in this.reportEntitySet)
            {
                var formatList = reportFormatEntitySet.Where(p => p.ReportId == subItem.Iden);
                bool hasDefaultFormat = reportFormatEntitySet.Any(p => p.IsDefault);

                if (formatList.Count() <= 0) continue;

                var barSubItem = new BarSubItem();
                barSubItem.Caption = subItem.Name;
                barSubItem.Glyph = Properties.Resources.Icon_Report_16x16;
                this.mainRibbonControl.Items.Add(barSubItem);
                reportPopupMenu.ItemLinks.Add(barSubItem);
                listReportBarItems.Add(barSubItem);

                foreach (var item in formatList)
                {
                    var barCheckItem = new BarCheckItem();
                    barCheckItem.Caption = item.Name;
                    barCheckItem.Name = "bbiReport_ReportFormatList_{0}".FormatWith(item.Iden);
                    barCheckItem.GroupIndex = 100000;
                    barCheckItem.Checked = item.IsDefault;
                    barCheckItem.Tag = item;

                    barCheckItem.CheckedChanged += barCheckItem_CheckedChanged;
                    this.mainRibbonControl.Items.Add(barCheckItem);
                    barSubItem.ItemLinks.Add(barCheckItem);

                    listReportFormatBarItems.Add(barCheckItem);
                }

                if (!hasDefaultFormat && listReportFormatBarItems.Count > 0)
                {
                    listReportFormatBarItems[0].Checked = true;
                }
            }

            RefreshReportBarItemCaption();
        }
        public void SaveCustomerCarRecord(LookUpEdit customer, LookUpEdit car, TextEdit VIN, TextEdit registrationNum, MemoEdit remarks, DateEdit dateCreated, CheckEdit status, string tableName, bool canWrite, BarCheckItem editing, int currentRow)
        {
            if (!editing.Checked && !canWrite)
            {
                XtraMessageBox.Show("You dont Have Write Access, Contact Admin", "You cant write", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (customer.EditValue == null)
            {
                XtraMessageBox.Show("Select a Customer ", "Specify Customer", MessageBoxButtons.OK, MessageBoxIcon.Information);
                customer.Focus();
                return;
            }
            if (car.EditValue == null)
            {
                XtraMessageBox.Show("Select a car ", "Specify Customer Car", MessageBoxButtons.OK, MessageBoxIcon.Information);
                car.Focus();
                return;
            }
            if (string.IsNullOrWhiteSpace(VIN.Text))
            {
                XtraMessageBox.Show("Enter car unique VIN ", "Car VIN Required", MessageBoxButtons.OK, MessageBoxIcon.Information);
                VIN.Focus();
                return;
            }
            if (string.IsNullOrWhiteSpace(registrationNum.Text))
            {
                XtraMessageBox.Show("Enter car registration number ", "Car registration Required", MessageBoxButtons.OK, MessageBoxIcon.Information);
                registrationNum.Focus();
                return;
            }

            Setup.comm = new SqlCommand();
            Setup.comm.Parameters.Add(new SqlParameter("@Customer", customer.EditValue));
            Setup.comm.Parameters.Add(new SqlParameter("@Car", car.EditValue));
            Setup.comm.Parameters.Add(new SqlParameter("@VIN", VIN.Text));
            Setup.comm.Parameters.Add(new SqlParameter("@RegNum", registrationNum.Text));

            Setup.comm.Parameters.Add(new SqlParameter("@Remarks", remarks.Text));
            Setup.comm.Parameters.Add(new SqlParameter("@DateCreated", dateCreated.DateTime));
            Setup.comm.Parameters.Add(new SqlParameter("@Status", status.Checked));

            try
            {
                using (Setup.connx = new SqlConnection(Setup.connString))
                {
                    Setup.connx.Open();
                    if (!Setup.mode[19])
                    {
                        Setup.comm.CommandText = "Select ccID from etblCustomerCar where ccVIN=@VIN or ccRegistrationNum=@RegNum";
                        Setup.comm.Connection  = Setup.connx;
                        Setup.reader           = Setup.comm.ExecuteReader();
                        while (Setup.reader.Read())
                        {
                            XtraMessageBox.Show("A customer with a similar car VIN or car number already exist!", "Car VIN or Registration Number Exist", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            return;
                        }
                        Setup.reader.Close();
                        Setup.comm.Parameters.Add(new SqlParameter("@CreatorID", 1));
                        Setup.comm.Parameters.Add(new SqlParameter("@CreatedDate", DateTime.Now));
                        Setup.comm.CommandText = "Insert into etblCustomerCar (ccCusID,ccCarID,ccVIN,ccRegistrationNum,ccremarks,ccDateCreated,ccstatus,ccCreatorID,ccCreatedDate) values(@Customer,@Car,@VIN,@RegNum,@remarks,@DateCreated,@status,@creatorID,@createdDate);select scope_identity()";
                        Setup.primaryKey       = Convert.ToInt32(Setup.comm.ExecuteScalar());
                        Setup.dataSet.Tables[tableName].Rows.Add(Setup.primaryKey, customer.Text, car.Text, VIN.Text, registrationNum.Text, remarks.Text, dateCreated.DateTime, status.Checked, Setup.UserName);
                        XtraMessageBox.Show(customer.Text + " Car  Saved Sussusfully", "Customer Car Saved", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        Setup.comm.Parameters.Add(new SqlParameter("@EditorID", Setup.userID));
                        Setup.comm.Parameters.Add(new SqlParameter("@EditedDate", DateTime.Now));
                        Setup.comm.Parameters.Add(new SqlParameter("@ID", Setup.dataSet.Tables[tableName].Rows[currentRow].ItemArray[0]));

                        Setup.comm.Parameters.Add(new SqlParameter("@UserName", Setup.dataSet.Tables[tableName].Rows[currentRow].ItemArray[8]));
                        Setup.comm.CommandText = "Select ccID from etblCustomerCar where ccID !=@ID and (ccVIN=@VIN or ccRegistrationNum=@RegNum)";
                        Setup.comm.Connection  = Setup.connx;
                        Setup.reader           = Setup.comm.ExecuteReader();
                        while (Setup.reader.Read())
                        {
                            XtraMessageBox.Show("A customer with a similar car VIN or car number already exist!", "Car VIN or Registration Number Exist", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            return;
                        }
                        Setup.reader.Close();
                        Setup.comm.CommandText = "Update etblCustomerCar set ccCusID=@Customer,ccCarID=@Car,ccVIN=@VIN,ccRegistrationNum=@RegNum,ccremarks=@remarks,ccDateCreated=@DateCreated,ccStatus=@status,ccEditorID=@EditorID,ccEditedDate=@EditedDate where ccID=@ID";
                        Setup.comm.ExecuteNonQuery();
                        Setup.dataSet.Tables[tableName].Rows[currentRow].ItemArray = new object[] { Setup.comm.Parameters["@ID"].Value, customer.Text, car.Text, VIN.Text, registrationNum.Text, remarks.Text, dateCreated.DateTime, status.Checked, Setup.comm.Parameters["@UserName"].Value };

                        XtraMessageBox.Show(customer.Text + " Car Updated Sussusfully", "Customer Car Updated", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("OOPs! cud not connect to server now Contact HR\r\n" + ex.Message, "Notification", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
        public MainWindow()
        {
            // show splash screen
            splashscreen = new Splash();
            splashscreen.Show();

            InitializeComponent();

            Messenger.Default.Register <NotificationMessage <string> >(this, PopNotificationMessage);

            // create DocumentPanel per the logical motion components defined in the config file
            var service = SimpleIoc.Default.GetInstance <SystemService>();

            #region Create logical motioin components panels
            foreach (var aligner in service.LogicalMotionComponentCollection)
            {
                // create a motion component panel control
                // which is the content of the document panel
                MotionComponentPanel uc = new MotionComponentPanel()
                {
                    // set the datacontext to the LogicalMotionComponent
                    DataContext = aligner
                };

                // create a document panel in the window
                DocumentPanel panel = new DocumentPanel()
                {
                    Name          = string.Format("dp{0}", aligner.Caption.Replace(" ", "")),
                    Caption       = aligner.Caption,
                    AllowMaximize = false,
                    AllowSizing   = false,
                    AllowFloat    = false,
                    AllowDock     = false,
                    //AllowClose = false,
                    ClosingBehavior = ClosingBehavior.HideToClosedPanelsCollection,

                    // put the user control into the panel
                    Content = uc
                };

                // add the documentpanel to the documentgroup
                MotionComponentPanelHost.Items.Add(panel);

                // find the icon shown in the button
                var image = (BitmapFrame)TryFindResource(aligner.Icon);

                // add view buttons to Ribbon toolbar
                BarCheckItem chk = new BarCheckItem()
                {
                    Content    = aligner.Caption,
                    LargeGlyph = image
                };

                // bind the IsCheck property to the document panel's Closed property
                Binding b = new Binding()
                {
                    Source    = panel,
                    Path      = new PropertyPath("Visibility"),
                    Mode      = BindingMode.TwoWay,
                    Converter = new VisibilityToBoolean()
                };
                chk.SetBinding(BarCheckItem.IsCheckedProperty, b);

                rpgView_MotionComponent.Items.Add(chk);

                // add buttons to show the preset position window
                BarButtonItem btn = new BarButtonItem()
                {
                    Content     = aligner.Caption,
                    LargeGlyph  = image,
                    DataContext = aligner
                };

                // raise the click event
                btn.ItemClick += (s, e) =>
                {
                    var view = new ViewMassMove(service, aligner);
                    var win  = new MassMoveWindow
                    {
                        DataContext = view
                    };
                    win.ShowDialog();
                };

                rpgPresetPositionButtonsHost.Items.Add(btn);
            }
            #endregion

            #region Create control panels for instruments

            ViewModelBase viewInstr;
            foreach (var instr in service.MeasurementInstrumentCollection)
            {
                UserControl uctrl = null;

                //TODO The following codes is not elegant, the code must be expanded if new type of instrument added into the system
                if (instr is Keithley2400)
                {
                    // create the user control for k2400
                    viewInstr = new ViewKeithley2400(instr as Keithley2400);
                    uctrl     = new Keithley2400ControlPanel()
                    {
                        DataContext = viewInstr
                    };
                }
                else if (instr is Newport2832C)
                {
                    // create the user control for k2400
                    viewInstr = new ViewNewport2832C(instr as Newport2832C);
                    uctrl     = new Newport2832cControlPanel()
                    {
                        DataContext = viewInstr
                    };
                }

                // create document panel in the window
                DocumentPanel panel = new DocumentPanel()
                {
                    Name            = string.Format("dp{0}", instr.DeviceClass.ToString("N")),
                    Caption         = instr.Config.Caption,
                    AllowMaximize   = false,
                    AllowSizing     = false,
                    AllowDock       = false,
                    AllowFloat      = false,
                    ClosingBehavior = ClosingBehavior.HideToClosedPanelsCollection,

                    // put the user control into the panel
                    Content = uctrl
                };

                // add the documentpanel to the documentgroup
                MotionComponentPanelHost.Items.Add(panel);

                // find the icon shown in the button
                var image = (BitmapFrame)TryFindResource(instr.Config.Icon);

                // add view buttons to Ribbon toolbar
                BarCheckItem chk = new BarCheckItem()
                {
                    Content    = instr.Config.Caption,
                    LargeGlyph = image
                };

                // bind the IsCheck property to the document panel's Closed property
                Binding b = new Binding()
                {
                    Source    = panel,
                    Path      = new PropertyPath("Visibility"),
                    Mode      = BindingMode.TwoWay,
                    Converter = new VisibilityToBoolean()
                };
                chk.SetBinding(BarCheckItem.IsCheckedProperty, b);

                rpgView_Equipments.Items.Add(chk);
            }

            #endregion

            #region Restore workspace layout
            var config = SimpleIoc.Default.GetInstance <ConfigManager>();
            for (int i = 0; i < MotionComponentPanelHost.Items.Count; i++)
            {
                var panel = MotionComponentPanelHost.Items[i];

                if (panel is DocumentPanel)
                {
                    //var layout =
                    //    (from items
                    //    in config.WorkspaceLayoutHelper.WorkspaceLayout
                    //     where items.PanelName == panel.Name
                    //     select items).First();

                    try
                    {
                        var setting = ((IEnumerable)config.ConfWSLayout.WorkspaceLayout).Cast <dynamic>().Where(item => item.PanelName == panel.Name).First();
                        panel.Visibility = setting.IsClosed ? Visibility.Hidden : Visibility.Visible;
                        ((DocumentPanel)panel).MDILocation = setting.MDILocation;
                    }
                    catch
                    {
                        ; // do nothing if the panel was not found in layout setting file
                    }
                }
            }
            #endregion
        }
		private void InitContextMenu()
		{
			_barManager.BeginInit();

			var colorEditor = new RepositoryItemHtmlColorEdit
			{
				AutoHeight = false,
			};
			colorEditor.Buttons.Clear();
			colorEditor.Buttons.AddRange(new[] { new EditorButton(ButtonPredefines.Ellipsis) });
			colorEditor.OnColorSelected += (o, e) =>
			{
				_barManager.CloseMenus();
			};

			var maxId = _barManager.MaxItemId++;

			ItemBoldFont = new BarCheckItem
			{
				Id = maxId,
				Caption = "Bold",
				CheckBoxVisibility = CheckBoxVisibility.AfterText
			};

			var boldFont = new Font(ItemBoldFont.ItemInMenuAppearance.Normal.Font.Name,
				ItemBoldFont.ItemInMenuAppearance.Normal.Font.Size, FontStyle.Bold);
			ItemBoldFont.ItemInMenuAppearance.Normal.Font = boldFont;
			ItemBoldFont.ItemInMenuAppearance.Pressed.Font = boldFont;
			ItemBoldFont.ItemInMenuAppearance.Hovered.Font = boldFont;

			ItemBoldFont.CheckedChanged += (o, e) => LibraryObjectLoader.OnFontChanged();
			maxId++;

			ItemItalicFont = new BarCheckItem
			{
				Id = maxId,
				Caption = "Italics",
				CheckBoxVisibility = CheckBoxVisibility.AfterText
			};

			var italicFont = new Font(ItemItalicFont.ItemInMenuAppearance.Normal.Font.Name,
				ItemItalicFont.ItemInMenuAppearance.Normal.Font.Size, FontStyle.Italic);
			ItemItalicFont.ItemInMenuAppearance.Normal.Font = italicFont;
			ItemItalicFont.ItemInMenuAppearance.Pressed.Font = italicFont;
			ItemItalicFont.ItemInMenuAppearance.Hovered.Font = italicFont;

			ItemItalicFont.CheckedChanged += (o, e) => LibraryObjectLoader.OnFontChanged();
			maxId++;

			ItemUnderlinedFont = new BarCheckItem
			{
				Id = maxId,
				Caption = "Underline",
				CheckBoxVisibility = CheckBoxVisibility.AfterText
			};

			var underlineFont = new Font(ItemUnderlinedFont.ItemInMenuAppearance.Normal.Font.Name,
				ItemUnderlinedFont.ItemInMenuAppearance.Normal.Font.Size, FontStyle.Underline);
			ItemUnderlinedFont.ItemInMenuAppearance.Normal.Font = underlineFont;
			ItemUnderlinedFont.ItemInMenuAppearance.Pressed.Font = underlineFont;
			ItemUnderlinedFont.ItemInMenuAppearance.Hovered.Font = underlineFont;

			ItemUnderlinedFont.CheckedChanged += (o, e) => LibraryObjectLoader.OnFontChanged();
			maxId++;

			ItemFontColor = new BarEditItem
			{
				Id = maxId,
				Caption = "Font Color  ",
				Edit = colorEditor,
				Width = 150
			};
			maxId++;
			ItemFontColor.EditValueChanged += (o, e) =>
			{
				LibraryObjectLoader.OnColorChanged();
				_barManager.CloseMenus();
			};

			_barManager.Items.Add(ItemBoldFont);
			_barManager.Items.Add(ItemItalicFont);
			_barManager.Items.Add(ItemUnderlinedFont);
			_barManager.Items.Add(ItemFontColor);
			_barManager.MaxItemId = maxId;

			_barManager.EndInit();
		}
Beispiel #27
0
 void RegisterNavigationMenuItem(BarLinkContainerItem menuItem, ModuleType type) {
     BarCheckItem biModule = new BarCheckItem();
     biModule.Caption = ViewModel.GetModuleCaption(type);
     biModule.Name = "biModule" + ViewModel.GetModuleName(type);
     biModule.Glyph = (System.Drawing.Image)ViewModel.GetModuleImage(type);
     biModule.GroupIndex = 1;
     biModule.BindCommand((t) => ViewModel.SelectModule(t), ViewModel, () => type);
     menuItem.AddItem(biModule);
 }
Beispiel #28
0
 private static void AddXemTatCa(BarManager barManager, Bar mainBar, BarButtonItem barButtonItemSearch,
     PopupControlContainer popUP, BarCheckItem filter, GridView gridViewMaster,
     string filterString)
 {
     AddXemTatCa(barManager, mainBar, barButtonItemSearch, popUP, filter, gridViewMaster, filterString, null,
                 null, "");
 }
Beispiel #29
0
        void AddWordBinder(WordBinder binder)
        {
            object docId = binder.Document.DocID();
            if (docId == null) {
                docId = Guid.NewGuid().ToString();
                binder.Document.Variables.Add("ID", ref docId);
            }
            if (openDocuments.ContainsKey(docId.ToString())) return;

            openDocuments.Add(docId.ToString(), binder);

            var item = new BarCheckItem {
                Caption = binder.Document.Name,
                Glyph = Resources.WordDocument16,
                Tag = binder
            };
            item.ItemClick += item_ItemClick;
            binder.IsDirtyChanged += binder_IsDirtyChanged;
            ribbon.Items.Add(item);
            wordBinderMenu.AddItem(item);
        }
        public void SaveCustomerRecord(TextEdit fname, TextEdit sname, TextEdit cusID, LookUpEdit title, TextEdit address, TextEdit phone, MemoEdit remarks, DateEdit dateCreated, CheckEdit status, string tableName, bool canWrite, BarCheckItem editing, int currentRow)
        {
            if (!editing.Checked && !canWrite)
            {
                XtraMessageBox.Show("You dont Have Write Access, Contact Admin", "You cant write", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (string.IsNullOrWhiteSpace(fname.Text))
            {
                XtraMessageBox.Show("Full Name Required", "Specify Customer Name", MessageBoxButtons.OK, MessageBoxIcon.Information);
                fname.Focus();
                return;
            }
            if (title.EditValue == null)
            {
                XtraMessageBox.Show("Select a Title ", "Specify Customer Title", MessageBoxButtons.OK, MessageBoxIcon.Information);
                title.Focus();
                return;
            }
            if (string.IsNullOrWhiteSpace(phone.Text))
            {
                XtraMessageBox.Show("Enter custmer's Phone number ", "Phone Number Required", MessageBoxButtons.OK, MessageBoxIcon.Information);
                phone.Focus();
            }
            string[] numbers  = phone.Text.Split(',');
            int      phoneNum = 0;

            foreach (string num in numbers)
            {
                if (!int.TryParse(num, out phoneNum))
                {
                    XtraMessageBox.Show("Separate each phone number with a comma if more than 1", "Phone number not in right format", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    phone.Focus();
                    return;
                }
            }
            string[] names = fname.Text.Split(' ');
            string   ID    = "";

            foreach (string name in names)
            {
                ID += name[0];
            }
            cusID.Text = ID.ToUpper() + numbers[0];
            Setup.comm = new SqlCommand();
            Setup.comm.Parameters.Add(new SqlParameter("@FName", fname.Text));
            Setup.comm.Parameters.Add(new SqlParameter("@SName", sname.Text));
            Setup.comm.Parameters.Add(new SqlParameter("@CusID", cusID.Text));
            Setup.comm.Parameters.Add(new SqlParameter("@Title", title.EditValue));
            Setup.comm.Parameters.Add(new SqlParameter("@Address", address.Text));

            Setup.comm.Parameters.Add(new SqlParameter("@Phone", phone.Text));
            Setup.comm.Parameters.Add(new SqlParameter("@Remarks", remarks.Text));
            Setup.comm.Parameters.Add(new SqlParameter("@DateCreated", dateCreated.DateTime));
            Setup.comm.Parameters.Add(new SqlParameter("@Status", status.Checked));

            try
            {
                using (Setup.connx = new SqlConnection(Setup.connString))
                {
                    Setup.connx.Open();
                    if (!Setup.mode[4])
                    {
                        Setup.comm.CommandText = "select cusID from etblCustomer where cusCustomerID=@CusID";
                        Setup.comm.Connection  = Setup.connx;
                        Setup.reader           = Setup.comm.ExecuteReader();
                        while (Setup.reader.Read())
                        {
                            XtraMessageBox.Show(fname.Text + " exist!", "This Customer Exist", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            return;
                        }
                        Setup.reader.Close();
                        Setup.comm.Parameters.Add(new SqlParameter("@CreatorID", 1));
                        Setup.comm.Parameters.Add(new SqlParameter("@CreatedDate", DateTime.Now));
                        Setup.comm.CommandText = "Insert into etblCustomer (cusTID,cusfname,cussname,cusCustomerID,cusAddress,cusPhone,cusremarks,cusDateCreated,cusstatus,cusCreatorID,cusCreatedDate) values(@Title,@fname,@sname,@CusID,@Address,@Phone,@remarks,@DateCreated,@status,@creatorID,@createdDate);select scope_identity()";
                        Setup.primaryKey       = Convert.ToInt32(Setup.comm.ExecuteScalar());
                        Setup.dataSet.Tables[tableName].Rows.Add(Setup.primaryKey, title.Text, fname.Text, sname.Text, cusID.Text, address.Text, phone.Text, remarks.Text, dateCreated.DateTime, status.Checked, Setup.UserName);
                        XtraMessageBox.Show(fname.Text + " Saved Sussusfully", "Title Saved", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        Setup.comm.Parameters.Add(new SqlParameter("@EditorID", 1));
                        Setup.comm.Parameters.Add(new SqlParameter("@EditedDate", DateTime.Now));
                        Setup.comm.Parameters.Add(new SqlParameter("@ID", Setup.dataSet.Tables[tableName].Rows[currentRow].ItemArray[0]));

                        Setup.comm.Parameters.Add(new SqlParameter("@UserName", Setup.dataSet.Tables[tableName].Rows[currentRow].ItemArray[10]));
                        Setup.comm.CommandText = "select cusID from etblCustomer where cusFName=@Fname and cusID !=@ID";
                        Setup.comm.Connection  = Setup.connx;
                        Setup.reader           = Setup.comm.ExecuteReader();
                        while (Setup.reader.Read())
                        {
                            XtraMessageBox.Show(fname.Text + " exist!", "This Customer Exist", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            return;
                        }
                        Setup.reader.Close();
                        Setup.comm.CommandText = "Update etblcustomer set cusfname=@fname, cussname=@sname,custID=@Title,cusCustomerID=@CusID,cusAddress=@Address,cusPhone=@Phone,cusremarks=@remarks,cusStatus=@status,cusEditorID=@EditorID,cusEditedDate=@EditedDate where cusID=@ID";
                        Setup.comm.ExecuteNonQuery();
                        Setup.dataSet.Tables[tableName].Rows[currentRow].ItemArray = new object[] { Setup.comm.Parameters["@ID"].Value, title.Text, fname.Text, sname.Text, cusID.Text, address.Text, phone.Text, remarks.Text, dateCreated.DateTime, status.Checked, Setup.comm.Parameters["@UserName"].Value };

                        XtraMessageBox.Show(fname.Text + " Updated Sussusfully", "Customer Updated", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("OOPs! cud not connect to server now Contact HR\r\n" + ex.Message, "Notification", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Beispiel #31
0
        private void InitMainMenu()
        {
            // load modules
            _modules = _mainPage.OrderBy(c => c.Metadata.LevelNo).ToList();
            foreach (var page in _modules)
            {
                var module = page.Value;
                switch (module.Type)
                {
                case TypeModule.BcSuspension:
                    if (!Program.IsDecBc)
                    {
                        continue;
                    }
                    break;

                case TypeModule.FcSuspension:
                    if (!Program.IsDecFc)
                    {
                        continue;
                    }
                    break;

                case TypeModule.Cnss:
                    if (!Program.IsCnss)
                    {
                        continue;
                    }
                    break;

                case TypeModule.VirementBancaire:
                    if (!Program.IsVirement)
                    {
                        continue;
                    }
                    break;

                case TypeModule.DecEmp:
                    if (!Program.IsEmp)
                    {
                        continue;
                    }
                    break;

                case TypeModule.Liasse:
                    if (!Program.IsLiasse)
                    {
                        continue;
                    }
                    break;

                default:
                    continue;
                    break;
                }
                module.Init(Program.Context);
                // load commande modules
                var commands = module.GetCommands().OrderBy(x => x.Metadata.LevelNo).ToList();

                //var pnvPage = new RibbonPage
                //{
                //    Name = page.Metadata.PageName,
                //    Text = page.Metadata.Caption,
                //    Tag = page.Metadata.AllowTabbedViewHeader
                //};
                var pnvPage = rbMain.Pages.GetPageByText("Fichier");

                // add page to ribbon
                //  rbMain.Pages.Add(pnvPage);
                var rpgroup = new RibbonPageGroup
                {
                    Text = page.Metadata.Caption,
                    AllowTextClipping = false,
                    ShowCaptionButton = true,
                    Visible           = false
                };
                pnvPage.Groups.Add(rpgroup);


                if (commands.Count == 1)
                {
                    rpgroup.Tag = commands[0];
                }

                foreach (var i in commands)
                {
                    // gerer les simples bouttons du ribbon
                    if (i.Metadata.TypeButton == TypeButton.SimpleButton)
                    {
                        var item = new BarButtonItem
                        {
                            Name       = i.Metadata.ItemName,
                            Caption    = i.Metadata.Caption,
                            LargeGlyph = i.Value.GetLargeImage,
                            Glyph      = i.Value.GetSmallImage,
                        };
                        rbMain.Items.Add(item);
                        rpgroup.ItemLinks.Add(item);

                        item.ItemClick += (o, e) => {
                            i.Value.Execute(Program.Context);
                        };
                    }
                    // gerer les check boutton du ribbon
                    if (i.Metadata.TypeButton == TypeButton.CheckButton)
                    {
                        var item = new BarCheckItem()
                        {
                            Name       = i.Metadata.ItemName,
                            Caption    = i.Metadata.Caption,
                            LargeGlyph = i.Value.GetLargeImage,
                            Glyph      = i.Value.GetSmallImage,
                        };
                        rbMain.Items.Add(item);
                        rpgroup.ItemLinks.Add(item);

                        item.ItemClick += (o, e) =>
                        {
                            var groupeIndex = item.GroupIndex;
                            var groupPage   = pnvPage.Groups[groupeIndex];

                            // reinitialiser l'etat des bouttons checked
                            foreach (var itemLink in groupPage.ItemLinks)
                            {
                                var checkLink = itemLink as BarCheckItemLink;
                                if (checkLink == null)
                                {
                                    continue;
                                }
                                var checkItem = checkLink.Item as BarCheckItem;
                                if (checkItem == null)
                                {
                                    continue;
                                }
                                if (checkLink.Caption == item.Caption)
                                {
                                    continue;
                                }
                                checkItem.Checked = false;
                            }

                            try
                            {
                                i.Value.Execute(Program.Context);
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show(ex.Message);
                            }
                        };
                    }
                }
            }
        }
Beispiel #32
0
        private object CreateControl(ICommand cmd, string caption, Image icon)
        {
            BarItem barItem = null;
            if (cmd is ICommandEx)
            {
                object objControl = (cmd as ICommandEx).ExControl;
                if (objControl is BarItem)
                {
                    barItem = objControl as BarItem;
                }
                else
                {
                    if (objControl is Control)
                    {
                        (objControl as Control).Text = caption;
                        (objControl as Control).BackgroundImage = icon;
                    }
                    return objControl;
                }
            }
            else  if (cmd is ICommand)
            {
                if (cmd is ITool)
                {
                    barItem = new BarCheckItem();
                }
                else
                {
                    barItem = new BarButtonItem();
                }
            }
            barItem.Caption = string.IsNullOrWhiteSpace(caption) ? cmd.Caption : caption;
            barItem.Glyph = icon;// (icon == null ? cmd.Icon : icon);
            barItem.Hint = cmd.Tooltip;
            barItem.Tag = cmd.Name;
            barItem.RibbonStyle = RibbonItemStyles.Large;

            return barItem;
        }
Beispiel #33
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MainForm));
     this.barDockMgr = new DevExpress.XtraBars.BarAndDockingController(this.components);
     this.dockMgr = new DevExpress.XtraBars.Docking.DockManager();
     this.pnlCountersTree = new DevExpress.XtraBars.Docking.DockPanel();
     this.dockPanel1_Container = new DevExpress.XtraBars.Docking.ControlContainer();
     this.cmdNewTab = new DevExpress.XtraBars.BarButtonItem();
     this.barSubItem1 = new DevExpress.XtraBars.BarSubItem();
     this.barButtonItem1 = new DevExpress.XtraBars.BarButtonItem();
     this.barSubItem2 = new DevExpress.XtraBars.BarSubItem();
     this.lsttopToolbarImages = new DevExpress.Utils.ImageCollection(this.components);
     this.tabsMgr = new DevExpress.XtraTabbedMdi.XtraTabbedMdiManager(this.components);
     this.defaultLookAndFeel1 = new DevExpress.LookAndFeel.DefaultLookAndFeel(this.components);
     this.imgRibbon = new DevExpress.Utils.ImageCollection(this.components);
     this.bar4 = new DevExpress.XtraBars.Bar();
     this.ribbonMain = new DevExpress.XtraBars.Ribbon.RibbonControl();
     this.barButtonGroup1 = new DevExpress.XtraBars.BarButtonGroup();
     this.chkPanelCounters = new DevExpress.XtraBars.BarCheckItem();
     this.barStaticItem1 = new DevExpress.XtraBars.BarStaticItem();
     this.cmdScaleUp = new DevExpress.XtraBars.BarButtonItem();
     this.cmdScaleDown = new DevExpress.XtraBars.BarButtonItem();
     this.cmdAddCounters = new DevExpress.XtraBars.BarButtonItem();
     this.cmdCreateRootNode = new DevExpress.XtraBars.BarButtonItem();
     this.cmdCreateChildNode = new DevExpress.XtraBars.BarButtonItem();
     this.cmdRemoveNode = new DevExpress.XtraBars.BarButtonItem();
     this.cmdCreateFolderFromActiveMonitor = new DevExpress.XtraBars.BarButtonItem();
     this.cmdSaveCountersToCurrentFolder = new DevExpress.XtraBars.BarButtonItem();
     this.cmdSetCounterMachineNames = new DevExpress.XtraBars.BarButtonItem();
     this.cmdAddNodeToNewTab = new DevExpress.XtraBars.BarButtonItem();
     this.barButtonItem13 = new DevExpress.XtraBars.BarButtonItem();
     this.chkTextReport = new DevExpress.XtraBars.BarCheckItem();
     this.chkShowToolbar = new DevExpress.XtraBars.BarCheckItem();
     this.chkLegend = new DevExpress.XtraBars.BarCheckItem();
     this.chkShowVGrid = new DevExpress.XtraBars.BarCheckItem();
     this.chkShowHGrid = new DevExpress.XtraBars.BarCheckItem();
     this.barStaticItem2 = new DevExpress.XtraBars.BarStaticItem();
     this.cmdRenameFolder = new DevExpress.XtraBars.BarButtonItem();
     this.cmdRenameTab = new DevExpress.XtraBars.BarButtonItem();
     this.barButtonGroup2 = new DevExpress.XtraBars.BarButtonGroup();
     this.cmdImport = new DevExpress.XtraBars.BarButtonItem();
     this.cmdExport = new DevExpress.XtraBars.BarButtonItem();
     this.barButtonGroup3 = new DevExpress.XtraBars.BarButtonGroup();
     this.barButtonGroup4 = new DevExpress.XtraBars.BarButtonGroup();
     this.barButtonGroup5 = new DevExpress.XtraBars.BarButtonGroup();
     this.barButtonItem2 = new DevExpress.XtraBars.BarButtonItem();
     this.barButtonItem3 = new DevExpress.XtraBars.BarButtonItem();
     this.barButtonItem4 = new DevExpress.XtraBars.BarButtonItem();
     this.barButtonItem5 = new DevExpress.XtraBars.BarButtonItem();
     this.barButtonItem6 = new DevExpress.XtraBars.BarButtonItem();
     this.barButtonItem7 = new DevExpress.XtraBars.BarButtonItem();
     this.lblVersionCaption = new DevExpress.XtraBars.BarStaticItem();
     this.lblVersion = new DevExpress.XtraBars.BarStaticItem();
     this.cmdCloseTab = new DevExpress.XtraBars.BarButtonItem();
     this.cmdSetInstanceName = new DevExpress.XtraBars.BarButtonItem();
     this.ribPageGeneral = new DevExpress.XtraBars.Ribbon.RibbonPage();
     this.ribbonPageGroup1 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribbonPageGroup2 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribbonPageGroup4 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribbonPageGroup16 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribPageActiveMonitor = new DevExpress.XtraBars.Ribbon.RibbonPage();
     this.ribbonPageGroup5 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribbonPageGroup6 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribbonPageGroup3 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribbonPageGroup15 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribPageLibFolder = new DevExpress.XtraBars.Ribbon.RibbonPage();
     this.ribbonPageGroup7 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribbonPageGroup12 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribbonPageGroup10 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribbonPageGroup11 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribPageLibCounter = new DevExpress.XtraBars.Ribbon.RibbonPage();
     this.ribbonPageGroup13 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribbonPageGroup14 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribbonPage1 = new DevExpress.XtraBars.Ribbon.RibbonPage();
     this.ribbonPageGroup17 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribbonPageGroup18 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribbonPageGroup19 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribbonPageGroup20 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribbonStatusBar1 = new DevExpress.XtraBars.Ribbon.RibbonStatusBar();
     this.ribbonPageGroup8 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.ribbonPageGroup9 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
     this.popupMenu1 = new DevExpress.XtraBars.PopupMenu(this.components);
     this.popupMenu2 = new DevExpress.XtraBars.PopupMenu(this.components);
     this.popupMenu3 = new DevExpress.XtraBars.PopupMenu(this.components);
     this.toolTipController1 = new DevExpress.Utils.ToolTipController(this.components);
     ((System.ComponentModel.ISupportInitialize)(this.barDockMgr)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dockMgr)).BeginInit();
     this.pnlCountersTree.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.lsttopToolbarImages)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.tabsMgr)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.imgRibbon)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.popupMenu1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.popupMenu2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.popupMenu3)).BeginInit();
     this.SuspendLayout();
     //
     // barDockMgr
     //
     this.barDockMgr.AppearancesRibbon.PageHeader.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(224)), ((System.Byte)(224)), ((System.Byte)(224)));
     this.barDockMgr.AppearancesRibbon.PageHeader.BackColor2 = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(192)), ((System.Byte)(192)));
     this.barDockMgr.AppearancesRibbon.PageHeader.Options.UseBackColor = true;
     this.barDockMgr.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Flat;
     this.barDockMgr.PaintStyleName = "Skin";
     this.barDockMgr.PropertiesBar.AllowLinkLighting = false;
     //
     // dockMgr
     //
     this.dockMgr.Controller = this.barDockMgr;
     this.dockMgr.Form = this;
     this.dockMgr.RootPanels.AddRange(new DevExpress.XtraBars.Docking.DockPanel[] {
                                                                                      this.pnlCountersTree});
     this.dockMgr.TopZIndexControls.AddRange(new string[] {
                                                              "DevExpress.XtraBars.BarDockControl",
                                                              "System.Windows.Forms.StatusBar",
                                                              "DevExpress.XtraBars.Ribbon.RibbonStatusBar",
                                                              "DevExpress.XtraBars.Ribbon.RibbonControl"});
     //
     // pnlCountersTree
     //
     this.pnlCountersTree.Controls.Add(this.dockPanel1_Container);
     this.pnlCountersTree.Dock = DevExpress.XtraBars.Docking.DockingStyle.Left;
     this.pnlCountersTree.ID = new System.Guid("67d03641-787f-4ee4-abc7-e67c35e02bd4");
     this.pnlCountersTree.Location = new System.Drawing.Point(0, 144);
     this.pnlCountersTree.Name = "pnlCountersTree";
     this.pnlCountersTree.Size = new System.Drawing.Size(206, 326);
     this.pnlCountersTree.Text = "Counter Library";
     //
     // dockPanel1_Container
     //
     this.dockPanel1_Container.Location = new System.Drawing.Point(3, 25);
     this.dockPanel1_Container.Name = "dockPanel1_Container";
     this.dockPanel1_Container.Size = new System.Drawing.Size(200, 298);
     this.dockPanel1_Container.TabIndex = 0;
     //
     // cmdNewTab
     //
     this.cmdNewTab.Caption = "&New tab";
     this.cmdNewTab.Glyph = ((System.Drawing.Image)(resources.GetObject("cmdNewTab.Glyph")));
     this.cmdNewTab.Hint = "New Tab";
     this.cmdNewTab.Id = 3;
     this.cmdNewTab.ImageIndex = 0;
     this.cmdNewTab.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N));
     this.cmdNewTab.Name = "cmdNewTab";
     this.cmdNewTab.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.cmdNewTab_ItemClick);
     //
     // barSubItem1
     //
     this.barSubItem1.Caption = "&File";
     this.barSubItem1.Id = 0;
     this.barSubItem1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
                                                                                              new DevExpress.XtraBars.LinkPersistInfo(this.barButtonItem1)});
     this.barSubItem1.Name = "barSubItem1";
     //
     // barButtonItem1
     //
     this.barButtonItem1.Caption = "E&xit";
     this.barButtonItem1.Glyph = ((System.Drawing.Image)(resources.GetObject("barButtonItem1.Glyph")));
     this.barButtonItem1.Hint = "Exit";
     this.barButtonItem1.Id = 1;
     this.barButtonItem1.ImageIndex = 1;
     this.barButtonItem1.Name = "barButtonItem1";
     //
     // barSubItem2
     //
     this.barSubItem2.Caption = "&Tabs";
     this.barSubItem2.Id = 2;
     this.barSubItem2.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
                                                                                              new DevExpress.XtraBars.LinkPersistInfo(this.cmdNewTab)});
     this.barSubItem2.Name = "barSubItem2";
     //
     // lsttopToolbarImages
     //
     this.lsttopToolbarImages.ImageStream = ((DevExpress.Utils.ImageCollectionStreamer)(resources.GetObject("lsttopToolbarImages.ImageStream")));
     //
     // tabsMgr
     //
     this.tabsMgr.AllowDragDrop = DevExpress.Utils.DefaultBoolean.True;
     this.tabsMgr.AppearancePage.HeaderActive.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(192)));
     this.tabsMgr.AppearancePage.HeaderActive.BorderColor = System.Drawing.Color.Red;
     this.tabsMgr.AppearancePage.HeaderActive.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
     this.tabsMgr.AppearancePage.HeaderActive.Options.UseBackColor = true;
     this.tabsMgr.AppearancePage.HeaderActive.Options.UseBorderColor = true;
     this.tabsMgr.AppearancePage.HeaderActive.Options.UseFont = true;
     this.tabsMgr.Controller = this.barDockMgr;
     this.tabsMgr.HeaderButtons = ((DevExpress.XtraTab.TabButtons)(((DevExpress.XtraTab.TabButtons.Prev | DevExpress.XtraTab.TabButtons.Next)
         | DevExpress.XtraTab.TabButtons.Close)));
     this.tabsMgr.MdiParent = this;
     this.tabsMgr.SelectedPageChanged += new System.EventHandler(this.tabsMgr_SelectedPageChanged);
     this.tabsMgr.MouseDown += new System.Windows.Forms.MouseEventHandler(this.tabsMgr_MouseDown);
     //
     // defaultLookAndFeel1
     //
     this.defaultLookAndFeel1.LookAndFeel.SkinName = "The Asphalt World";
     //
     // imgRibbon
     //
     this.imgRibbon.ImageStream = ((DevExpress.Utils.ImageCollectionStreamer)(resources.GetObject("imgRibbon.ImageStream")));
     //
     // bar4
     //
     this.bar4.BarName = "barActions";
     this.bar4.DockCol = 0;
     this.bar4.DockRow = 0;
     this.bar4.DockStyle = DevExpress.XtraBars.BarDockStyle.Top;
     this.bar4.FloatLocation = new System.Drawing.Point(229, 161);
     this.bar4.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
                                                                                       new DevExpress.XtraBars.LinkPersistInfo(this.barButtonItem1)});
     this.bar4.OptionsBar.AllowDelete = true;
     this.bar4.OptionsBar.AllowQuickCustomization = false;
     this.bar4.OptionsBar.DisableClose = true;
     this.bar4.OptionsBar.DisableCustomization = true;
     this.bar4.OptionsBar.DrawDragBorder = false;
     this.bar4.OptionsBar.UseWholeRow = true;
     this.bar4.Text = "Actions";
     //
     // ribbonMain
     //
     this.ribbonMain.Images = this.imgRibbon;
     this.ribbonMain.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
                                                                          this.barSubItem1,
                                                                          this.barButtonItem1,
                                                                          this.barSubItem2,
                                                                          this.cmdNewTab,
                                                                          this.barButtonGroup1,
                                                                          this.chkPanelCounters,
                                                                          this.barStaticItem1,
                                                                          this.cmdScaleUp,
                                                                          this.cmdScaleDown,
                                                                          this.cmdAddCounters,
                                                                          this.cmdCreateRootNode,
                                                                          this.cmdCreateChildNode,
                                                                          this.cmdRemoveNode,
                                                                          this.cmdCreateFolderFromActiveMonitor,
                                                                          this.cmdSaveCountersToCurrentFolder,
                                                                          this.cmdSetCounterMachineNames,
                                                                          this.cmdAddNodeToNewTab,
                                                                          this.barButtonItem13,
                                                                          this.chkTextReport,
                                                                          this.chkShowToolbar,
                                                                          this.chkLegend,
                                                                          this.chkShowVGrid,
                                                                          this.chkShowHGrid,
                                                                          this.barStaticItem2,
                                                                          this.cmdRenameFolder,
                                                                          this.cmdRenameTab,
                                                                          this.barButtonGroup2,
                                                                          this.cmdImport,
                                                                          this.cmdExport,
                                                                          this.barButtonGroup3,
                                                                          this.barButtonGroup4,
                                                                          this.barButtonGroup5,
                                                                          this.barButtonItem2,
                                                                          this.barButtonItem3,
                                                                          this.barButtonItem4,
                                                                          this.barButtonItem5,
                                                                          this.barButtonItem6,
                                                                          this.barButtonItem7,
                                                                          this.lblVersionCaption,
                                                                          this.lblVersion,
                                                                          this.cmdCloseTab,
                                                                          this.cmdSetInstanceName});
     this.ribbonMain.Location = new System.Drawing.Point(0, 0);
     this.ribbonMain.MaxItemId = 42;
     this.ribbonMain.Name = "ribbonMain";
     this.ribbonMain.Pages.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPage[] {
                                                                                    this.ribPageGeneral,
                                                                                    this.ribPageActiveMonitor,
                                                                                    this.ribPageLibFolder,
                                                                                    this.ribPageLibCounter,
                                                                                    this.ribbonPage1});
     this.ribbonMain.SelectedPage = this.ribPageActiveMonitor;
     this.ribbonMain.Size = new System.Drawing.Size(712, 144);
     this.ribbonMain.Toolbar.ItemLinks.Add(this.barButtonItem1);
     this.ribbonMain.Toolbar.ItemLinks.Add(this.cmdNewTab, true);
     this.ribbonMain.Toolbar.ItemLinks.Add(this.cmdRenameTab);
     this.ribbonMain.Toolbar.ItemLinks.Add(this.cmdAddCounters, true);
     this.ribbonMain.ToolbarLocation = DevExpress.XtraBars.Ribbon.RibbonQuickAccessToolbarLocation.Below;
     this.ribbonMain.SelectedPageChanged += new System.EventHandler(this.ribbonMain_SelectedPageChanged);
     //
     // barButtonGroup1
     //
     this.barButtonGroup1.Caption = "barButtonGroup1";
     this.barButtonGroup1.Id = 0;
     this.barButtonGroup1.Name = "barButtonGroup1";
     //
     // chkPanelCounters
     //
     this.chkPanelCounters.Caption = "Show Counter Library";
     this.chkPanelCounters.Checked = true;
     this.chkPanelCounters.Glyph = ((System.Drawing.Image)(resources.GetObject("chkPanelCounters.Glyph")));
     this.chkPanelCounters.Hint = "Show counter library panel";
     this.chkPanelCounters.Id = 1;
     this.chkPanelCounters.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.L));
     this.chkPanelCounters.LargeGlyph = ((System.Drawing.Image)(resources.GetObject("chkPanelCounters.LargeGlyph")));
     this.chkPanelCounters.Name = "chkPanelCounters";
     this.chkPanelCounters.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.Caption;
     this.chkPanelCounters.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.chkPanelCounters_CheckedChanged);
     //
     // barStaticItem1
     //
     this.barStaticItem1.Caption = "Actions on the active perfomance monitor";
     this.barStaticItem1.Glyph = ((System.Drawing.Image)(resources.GetObject("barStaticItem1.Glyph")));
     this.barStaticItem1.Id = 2;
     this.barStaticItem1.Name = "barStaticItem1";
     this.barStaticItem1.RibbonStyle = DevExpress.XtraBars.Ribbon.RibbonItemStyles.Large;
     this.barStaticItem1.TextAlignment = System.Drawing.StringAlignment.Near;
     //
     // cmdScaleUp
     //
     this.cmdScaleUp.Caption = "Scale up";
     this.cmdScaleUp.Glyph = ((System.Drawing.Image)(resources.GetObject("cmdScaleUp.Glyph")));
     this.cmdScaleUp.Hint = "Scale up current counter";
     this.cmdScaleUp.Id = 3;
     this.cmdScaleUp.ItemShortcut = new DevExpress.XtraBars.BarShortcut(System.Windows.Forms.Keys.Add);
     this.cmdScaleUp.Name = "cmdScaleUp";
     this.cmdScaleUp.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.cmdScaleUp_ItemClick);
     //
     // cmdScaleDown
     //
     this.cmdScaleDown.Caption = "Scale down                 ";
     this.cmdScaleDown.Glyph = ((System.Drawing.Image)(resources.GetObject("cmdScaleDown.Glyph")));
     this.cmdScaleDown.Hint = "Scale down current counter";
     this.cmdScaleDown.Id = 4;
     this.cmdScaleDown.ItemShortcut = new DevExpress.XtraBars.BarShortcut(System.Windows.Forms.Keys.Subtract);
     this.cmdScaleDown.Name = "cmdScaleDown";
     this.cmdScaleDown.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.barButtonItem3_ItemClick);
     //
     // cmdAddCounters
     //
     this.cmdAddCounters.Caption = "Add counter(s)";
     this.cmdAddCounters.Glyph = ((System.Drawing.Image)(resources.GetObject("cmdAddCounters.Glyph")));
     this.cmdAddCounters.Hint = "Add Counters...";
     this.cmdAddCounters.Id = 5;
     this.cmdAddCounters.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A));
     this.cmdAddCounters.Name = "cmdAddCounters";
     this.cmdAddCounters.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.cmdAddCounters_ItemClick);
     //
     // cmdCreateRootNode
     //
     this.cmdCreateRootNode.Caption = "Create Root";
     this.cmdCreateRootNode.Glyph = ((System.Drawing.Image)(resources.GetObject("cmdCreateRootNode.Glyph")));
     this.cmdCreateRootNode.Hint = "Create root folder in library";
     this.cmdCreateRootNode.Id = 6;
     this.cmdCreateRootNode.Name = "cmdCreateRootNode";
     this.cmdCreateRootNode.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.cmdCreateRootNode_ItemClick);
     //
     // cmdCreateChildNode
     //
     this.cmdCreateChildNode.Caption = "Create Child";
     this.cmdCreateChildNode.Glyph = ((System.Drawing.Image)(resources.GetObject("cmdCreateChildNode.Glyph")));
     this.cmdCreateChildNode.Hint = "Create sub folder in library";
     this.cmdCreateChildNode.Id = 7;
     this.cmdCreateChildNode.Name = "cmdCreateChildNode";
     this.cmdCreateChildNode.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.cmdCreateChildNode_ItemClick);
     //
     // cmdRemoveNode
     //
     this.cmdRemoveNode.Caption = "&Remove";
     this.cmdRemoveNode.Hint = "Remove folder or counter from library";
     this.cmdRemoveNode.Id = 8;
     this.cmdRemoveNode.ImageIndex = 1;
     this.cmdRemoveNode.Name = "cmdRemoveNode";
     this.cmdRemoveNode.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.cmdRemoveNode_ItemClick);
     //
     // cmdCreateFolderFromActiveMonitor
     //
     this.cmdCreateFolderFromActiveMonitor.Caption = "Import Tab Counters to new folder";
     this.cmdCreateFolderFromActiveMonitor.Glyph = ((System.Drawing.Image)(resources.GetObject("cmdCreateFolderFromActiveMonitor.Glyph")));
     this.cmdCreateFolderFromActiveMonitor.Hint = "Import tab counters to a new library folder";
     this.cmdCreateFolderFromActiveMonitor.Id = 10;
     this.cmdCreateFolderFromActiveMonitor.ItemShortcut = new DevExpress.XtraBars.BarShortcut(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
         | System.Windows.Forms.Keys.N));
     this.cmdCreateFolderFromActiveMonitor.Name = "cmdCreateFolderFromActiveMonitor";
     this.cmdCreateFolderFromActiveMonitor.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.cmdCreateFolderFromActiveMonitor_ItemClick);
     //
     // cmdSaveCountersToCurrentFolder
     //
     this.cmdSaveCountersToCurrentFolder.Caption = "Import tab counters to selected folder";
     this.cmdSaveCountersToCurrentFolder.Glyph = ((System.Drawing.Image)(resources.GetObject("cmdSaveCountersToCurrentFolder.Glyph")));
     this.cmdSaveCountersToCurrentFolder.Hint = "Import tab counters to the selected library folder";
     this.cmdSaveCountersToCurrentFolder.Id = 11;
     this.cmdSaveCountersToCurrentFolder.ItemShortcut = new DevExpress.XtraBars.BarShortcut(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
         | System.Windows.Forms.Keys.F));
     this.cmdSaveCountersToCurrentFolder.Name = "cmdSaveCountersToCurrentFolder";
     this.cmdSaveCountersToCurrentFolder.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.cmdSaveCountersToCurrentFolder_ItemClick);
     //
     // cmdSetCounterMachineNames
     //
     this.cmdSetCounterMachineNames.Caption = "Set machine name";
     this.cmdSetCounterMachineNames.Glyph = ((System.Drawing.Image)(resources.GetObject("cmdSetCounterMachineNames.Glyph")));
     this.cmdSetCounterMachineNames.Hint = "set the machine name for the library counter(s)";
     this.cmdSetCounterMachineNames.Id = 12;
     this.cmdSetCounterMachineNames.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.M));
     this.cmdSetCounterMachineNames.Name = "cmdSetCounterMachineNames";
     this.cmdSetCounterMachineNames.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.cmdChangeMachinNameForCOunters_ItemClick);
     //
     // cmdAddNodeToNewTab
     //
     this.cmdAddNodeToNewTab.Caption = "Add folder to new tab";
     this.cmdAddNodeToNewTab.Glyph = ((System.Drawing.Image)(resources.GetObject("cmdAddNodeToNewTab.Glyph")));
     this.cmdAddNodeToNewTab.Hint = "add this library folder\'s counters to a new tab";
     this.cmdAddNodeToNewTab.Id = 13;
     this.cmdAddNodeToNewTab.ItemShortcut = new DevExpress.XtraBars.BarShortcut(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
         | System.Windows.Forms.Keys.Right));
     this.cmdAddNodeToNewTab.Name = "cmdAddNodeToNewTab";
     this.cmdAddNodeToNewTab.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.cmdAddNodeToNewTab_ItemClick);
     //
     // barButtonItem13
     //
     this.barButtonItem13.Caption = "Add to selected tab";
     this.barButtonItem13.Glyph = ((System.Drawing.Image)(resources.GetObject("barButtonItem13.Glyph")));
     this.barButtonItem13.Hint = "add this library folder/counter to the current tab";
     this.barButtonItem13.Id = 16;
     this.barButtonItem13.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Right));
     this.barButtonItem13.Name = "barButtonItem13";
     this.barButtonItem13.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.barButtonItem13_ItemClick);
     //
     // chkTextReport
     //
     this.chkTextReport.Caption = "Text Report";
     this.chkTextReport.Glyph = ((System.Drawing.Image)(resources.GetObject("chkTextReport.Glyph")));
     this.chkTextReport.Hint = "Set the perfmon display to \"Text Report\"";
     this.chkTextReport.Id = 17;
     this.chkTextReport.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.R));
     this.chkTextReport.LargeGlyph = ((System.Drawing.Image)(resources.GetObject("chkTextReport.LargeGlyph")));
     this.chkTextReport.Name = "chkTextReport";
     this.chkTextReport.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.chkTextReport_CheckedChanged);
     //
     // chkShowToolbar
     //
     this.chkShowToolbar.Caption = "Toolbar";
     this.chkShowToolbar.Checked = true;
     this.chkShowToolbar.Glyph = ((System.Drawing.Image)(resources.GetObject("chkShowToolbar.Glyph")));
     this.chkShowToolbar.Hint = "Show/Hide the perfmon toolbar";
     this.chkShowToolbar.Id = 18;
     this.chkShowToolbar.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.T));
     this.chkShowToolbar.Name = "chkShowToolbar";
     this.chkShowToolbar.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.chkShowToolbar_CheckedChanged);
     //
     // chkLegend
     //
     this.chkLegend.Caption = "Legend";
     this.chkLegend.Checked = true;
     this.chkLegend.Glyph = ((System.Drawing.Image)(resources.GetObject("chkLegend.Glyph")));
     this.chkLegend.Hint = "Show/Hide the perfmon legend";
     this.chkLegend.Id = 19;
     this.chkLegend.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.L));
     this.chkLegend.Name = "chkLegend";
     this.chkLegend.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.chkLegend_CheckedChanged);
     //
     // chkShowVGrid
     //
     this.chkShowVGrid.Caption = "Vertical Grid Lines";
     this.chkShowVGrid.Glyph = ((System.Drawing.Image)(resources.GetObject("chkShowVGrid.Glyph")));
     this.chkShowVGrid.Hint = "Show/Hide perfmon vertical grid lines";
     this.chkShowVGrid.Id = 20;
     this.chkShowVGrid.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.V));
     this.chkShowVGrid.Name = "chkShowVGrid";
     this.chkShowVGrid.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.chkShowVGrid_CheckedChanged);
     //
     // chkShowHGrid
     //
     this.chkShowHGrid.Caption = "Horizontal Grid Lines";
     this.chkShowHGrid.Glyph = ((System.Drawing.Image)(resources.GetObject("chkShowHGrid.Glyph")));
     this.chkShowHGrid.Hint = "Show/Hide perfmon Horizontal grid lines";
     this.chkShowHGrid.Id = 21;
     this.chkShowHGrid.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.H));
     this.chkShowHGrid.Name = "chkShowHGrid";
     this.chkShowHGrid.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.chkShowHGrid_CheckedChanged);
     //
     // barStaticItem2
     //
     this.barStaticItem2.Caption = "Perf+                                                                            " +
         "";
     this.barStaticItem2.Id = 22;
     this.barStaticItem2.Name = "barStaticItem2";
     this.barStaticItem2.TextAlignment = System.Drawing.StringAlignment.Near;
     //
     // cmdRenameFolder
     //
     this.cmdRenameFolder.Caption = "&Rename";
     this.cmdRenameFolder.Id = 23;
     this.cmdRenameFolder.Name = "cmdRenameFolder";
     this.cmdRenameFolder.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.cmdRenameFolder_ItemClick);
     //
     // cmdRenameTab
     //
     this.cmdRenameTab.Caption = "&Rename Tab";
     this.cmdRenameTab.Glyph = ((System.Drawing.Image)(resources.GetObject("cmdRenameTab.Glyph")));
     this.cmdRenameTab.Hint = "Rename Tab";
     this.cmdRenameTab.Id = 25;
     this.cmdRenameTab.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R));
     this.cmdRenameTab.Name = "cmdRenameTab";
     this.cmdRenameTab.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.cmdRenameTab_ItemClick);
     //
     // barButtonGroup2
     //
     this.barButtonGroup2.Caption = "Share";
     this.barButtonGroup2.Id = 26;
     this.barButtonGroup2.Name = "barButtonGroup2";
     //
     // cmdImport
     //
     this.cmdImport.Caption = "&Import Library...";
     this.cmdImport.Glyph = ((System.Drawing.Image)(resources.GetObject("cmdImport.Glyph")));
     this.cmdImport.Hint = "Import existing library counters from file";
     this.cmdImport.Id = 27;
     this.cmdImport.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I));
     this.cmdImport.Name = "cmdImport";
     this.cmdImport.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.cmdImport_ItemClick);
     //
     // cmdExport
     //
     this.cmdExport.Caption = "Export Library...";
     this.cmdExport.Glyph = ((System.Drawing.Image)(resources.GetObject("cmdExport.Glyph")));
     this.cmdExport.Hint = "Export coutner library to file";
     this.cmdExport.Id = 28;
     this.cmdExport.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E));
     this.cmdExport.Name = "cmdExport";
     this.cmdExport.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.cmdExport_ItemClick);
     //
     // barButtonGroup3
     //
     this.barButtonGroup3.Caption = "barButtonGroup3";
     this.barButtonGroup3.Id = 29;
     this.barButtonGroup3.Name = "barButtonGroup3";
     //
     // barButtonGroup4
     //
     this.barButtonGroup4.Caption = "View ptions";
     this.barButtonGroup4.Id = 30;
     this.barButtonGroup4.ItemLinks.Add(this.chkLegend);
     this.barButtonGroup4.ItemLinks.Add(this.chkShowToolbar);
     this.barButtonGroup4.Name = "barButtonGroup4";
     //
     // barButtonGroup5
     //
     this.barButtonGroup5.Caption = "barButtonGroup5";
     this.barButtonGroup5.Id = 31;
     this.barButtonGroup5.ItemLinks.Add(this.chkShowHGrid);
     this.barButtonGroup5.ItemLinks.Add(this.chkShowVGrid);
     this.barButtonGroup5.Name = "barButtonGroup5";
     //
     // barButtonItem2
     //
     this.barButtonItem2.Caption = "Team Agile";
     this.barButtonItem2.Glyph = ((System.Drawing.Image)(resources.GetObject("barButtonItem2.Glyph")));
     this.barButtonItem2.Id = 32;
     this.barButtonItem2.Name = "barButtonItem2";
     this.barButtonItem2.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.barButtonItem2_ItemClick);
     //
     // barButtonItem3
     //
     this.barButtonItem3.Caption = "Other Tools from Roy";
     this.barButtonItem3.Glyph = ((System.Drawing.Image)(resources.GetObject("barButtonItem3.Glyph")));
     this.barButtonItem3.Id = 33;
     this.barButtonItem3.Name = "barButtonItem3";
     this.barButtonItem3.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.barButtonItem3_ItemClick_1);
     //
     // barButtonItem4
     //
     this.barButtonItem4.Caption = "Roy\'s Blog";
     this.barButtonItem4.Id = 34;
     this.barButtonItem4.LargeGlyph = ((System.Drawing.Image)(resources.GetObject("barButtonItem4.LargeGlyph")));
     this.barButtonItem4.Name = "barButtonItem4";
     this.barButtonItem4.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.barButtonItem4_ItemClick);
     //
     // barButtonItem5
     //
     this.barButtonItem5.Caption = "Bug/ Feature request";
     this.barButtonItem5.Glyph = ((System.Drawing.Image)(resources.GetObject("barButtonItem5.Glyph")));
     this.barButtonItem5.Id = 35;
     this.barButtonItem5.Name = "barButtonItem5";
     this.barButtonItem5.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.barButtonItem5_ItemClick);
     //
     // barButtonItem6
     //
     this.barButtonItem6.Caption = "Email the author";
     this.barButtonItem6.Glyph = ((System.Drawing.Image)(resources.GetObject("barButtonItem6.Glyph")));
     this.barButtonItem6.Id = 36;
     this.barButtonItem6.Name = "barButtonItem6";
     this.barButtonItem6.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.barButtonItem6_ItemClick);
     //
     // barButtonItem7
     //
     this.barButtonItem7.Caption = "barButtonItem7";
     this.barButtonItem7.Id = 37;
     this.barButtonItem7.Name = "barButtonItem7";
     //
     // lblVersionCaption
     //
     this.lblVersionCaption.Caption = "Version:";
     this.lblVersionCaption.Id = 38;
     this.lblVersionCaption.Name = "lblVersionCaption";
     this.lblVersionCaption.TextAlignment = System.Drawing.StringAlignment.Near;
     //
     // lblVersion
     //
     this.lblVersion.Caption = "       1.0      ";
     this.lblVersion.Id = 39;
     this.lblVersion.Name = "lblVersion";
     this.lblVersion.TextAlignment = System.Drawing.StringAlignment.Near;
     //
     // cmdCloseTab
     //
     this.cmdCloseTab.Caption = "&Close";
     this.cmdCloseTab.Id = 40;
     this.cmdCloseTab.Name = "cmdCloseTab";
     //
     // cmdSetInstanceName
     //
     this.cmdSetInstanceName.Caption = "Set Target Application Instance";
     this.cmdSetInstanceName.Glyph = ((System.Drawing.Image)(resources.GetObject("cmdSetInstanceName.Glyph")));
     this.cmdSetInstanceName.Hint = "Set the counter(s) target application instance";
     this.cmdSetInstanceName.Id = 41;
     this.cmdSetInstanceName.ItemShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T));
     this.cmdSetInstanceName.Name = "cmdSetInstanceName";
     this.cmdSetInstanceName.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.cmdSetInstanceName_ItemClick);
     //
     // ribPageGeneral
     //
     this.ribPageGeneral.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
                                                                                              this.ribbonPageGroup1,
                                                                                              this.ribbonPageGroup2,
                                                                                              this.ribbonPageGroup4,
                                                                                              this.ribbonPageGroup16});
     this.ribPageGeneral.Name = "ribPageGeneral";
     this.ribPageGeneral.Text = "General";
     //
     // ribbonPageGroup1
     //
     this.ribbonPageGroup1.ItemLinks.Add(this.barButtonItem1);
     this.ribbonPageGroup1.Name = "ribbonPageGroup1";
     this.ribbonPageGroup1.ShowCaptionButton = false;
     this.ribbonPageGroup1.Text = "Program";
     //
     // ribbonPageGroup2
     //
     this.ribbonPageGroup2.ItemLinks.Add(this.cmdNewTab);
     this.ribbonPageGroup2.ItemLinks.Add(this.cmdRenameTab);
     this.ribbonPageGroup2.Name = "ribbonPageGroup2";
     this.ribbonPageGroup2.ShowCaptionButton = false;
     this.ribbonPageGroup2.Text = "Tabs";
     //
     // ribbonPageGroup4
     //
     this.ribbonPageGroup4.ItemLinks.Add(this.chkPanelCounters);
     this.ribbonPageGroup4.Name = "ribbonPageGroup4";
     this.ribbonPageGroup4.Text = "Panels";
     //
     // ribbonPageGroup16
     //
     this.ribbonPageGroup16.ItemLinks.Add(this.cmdImport);
     this.ribbonPageGroup16.ItemLinks.Add(this.cmdExport);
     this.ribbonPageGroup16.Name = "ribbonPageGroup16";
     this.ribbonPageGroup16.Text = "Share";
     //
     // ribPageActiveMonitor
     //
     this.ribPageActiveMonitor.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
                                                                                                    this.ribbonPageGroup5,
                                                                                                    this.ribbonPageGroup6,
                                                                                                    this.ribbonPageGroup3,
                                                                                                    this.ribbonPageGroup15});
     this.ribPageActiveMonitor.Name = "ribPageActiveMonitor";
     this.ribPageActiveMonitor.Text = "Active Monitor";
     //
     // ribbonPageGroup5
     //
     this.ribbonPageGroup5.ItemLinks.Add(this.cmdScaleUp);
     this.ribbonPageGroup5.ItemLinks.Add(this.cmdScaleDown);
     this.ribbonPageGroup5.Name = "ribbonPageGroup5";
     this.ribbonPageGroup5.Text = "Active Counter";
     //
     // ribbonPageGroup6
     //
     this.ribbonPageGroup6.ItemLinks.Add(this.cmdAddCounters, true);
     this.ribbonPageGroup6.ItemLinks.Add(this.cmdRenameTab);
     this.ribbonPageGroup6.ItemLinks.Add(this.cmdNewTab);
     this.ribbonPageGroup6.Name = "ribbonPageGroup6";
     this.ribbonPageGroup6.Text = "Monitor";
     //
     // ribbonPageGroup3
     //
     this.ribbonPageGroup3.ItemLinks.Add(this.barButtonGroup4);
     this.ribbonPageGroup3.ItemLinks.Add(this.barButtonGroup5);
     this.ribbonPageGroup3.ItemLinks.Add(this.chkTextReport);
     this.ribbonPageGroup3.Name = "ribbonPageGroup3";
     this.ribbonPageGroup3.Text = "Toggle Visible";
     //
     // ribbonPageGroup15
     //
     this.ribbonPageGroup15.ItemLinks.Add(this.cmdCreateFolderFromActiveMonitor);
     this.ribbonPageGroup15.ItemLinks.Add(this.cmdSaveCountersToCurrentFolder);
     this.ribbonPageGroup15.Name = "ribbonPageGroup15";
     this.ribbonPageGroup15.Text = "Library";
     //
     // ribPageLibFolder
     //
     this.ribPageLibFolder.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
                                                                                                this.ribbonPageGroup7,
                                                                                                this.ribbonPageGroup12,
                                                                                                this.ribbonPageGroup10,
                                                                                                this.ribbonPageGroup11});
     this.ribPageLibFolder.Name = "ribPageLibFolder";
     this.ribPageLibFolder.Text = "Library Folder";
     //
     // ribbonPageGroup7
     //
     this.ribbonPageGroup7.ItemLinks.Add(this.cmdCreateRootNode, true);
     this.ribbonPageGroup7.ItemLinks.Add(this.cmdCreateChildNode);
     this.ribbonPageGroup7.ItemLinks.Add(this.cmdRemoveNode, true);
     this.ribbonPageGroup7.ItemLinks.Add(this.cmdRenameFolder);
     this.ribbonPageGroup7.Name = "ribbonPageGroup7";
     this.ribbonPageGroup7.Text = "Folders";
     //
     // ribbonPageGroup12
     //
     this.ribbonPageGroup12.ItemLinks.Add(this.cmdAddNodeToNewTab);
     this.ribbonPageGroup12.ItemLinks.Add(this.barButtonItem13);
     this.ribbonPageGroup12.Name = "ribbonPageGroup12";
     this.ribbonPageGroup12.Text = "Monitor";
     //
     // ribbonPageGroup10
     //
     this.ribbonPageGroup10.ItemLinks.Add(this.cmdCreateFolderFromActiveMonitor);
     this.ribbonPageGroup10.ItemLinks.Add(this.cmdSaveCountersToCurrentFolder);
     this.ribbonPageGroup10.Name = "ribbonPageGroup10";
     this.ribbonPageGroup10.Text = "Import";
     //
     // ribbonPageGroup11
     //
     this.ribbonPageGroup11.ItemLinks.Add(this.cmdSetCounterMachineNames);
     this.ribbonPageGroup11.ItemLinks.Add(this.cmdSetInstanceName);
     this.ribbonPageGroup11.Name = "ribbonPageGroup11";
     this.ribbonPageGroup11.Text = "Current Folder\\Counter";
     //
     // ribPageLibCounter
     //
     this.ribPageLibCounter.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
                                                                                                 this.ribbonPageGroup13,
                                                                                                 this.ribbonPageGroup14});
     this.ribPageLibCounter.Name = "ribPageLibCounter";
     this.ribPageLibCounter.Text = "Library Counter";
     //
     // ribbonPageGroup13
     //
     this.ribbonPageGroup13.ItemLinks.Add(this.cmdSetCounterMachineNames);
     this.ribbonPageGroup13.Name = "ribbonPageGroup13";
     this.ribbonPageGroup13.Text = "Modify Counter";
     //
     // ribbonPageGroup14
     //
     this.ribbonPageGroup14.ItemLinks.Add(this.cmdAddNodeToNewTab);
     this.ribbonPageGroup14.ItemLinks.Add(this.barButtonItem13);
     this.ribbonPageGroup14.Name = "ribbonPageGroup14";
     this.ribbonPageGroup14.Text = "Monitor";
     //
     // ribbonPage1
     //
     this.ribbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
                                                                                           this.ribbonPageGroup17,
                                                                                           this.ribbonPageGroup18,
                                                                                           this.ribbonPageGroup19,
                                                                                           this.ribbonPageGroup20});
     this.ribbonPage1.Name = "ribbonPage1";
     this.ribbonPage1.Text = "Help";
     //
     // ribbonPageGroup17
     //
     this.ribbonPageGroup17.ItemLinks.Add(this.lblVersionCaption);
     this.ribbonPageGroup17.ItemLinks.Add(this.lblVersion);
     this.ribbonPageGroup17.Name = "ribbonPageGroup17";
     this.ribbonPageGroup17.Text = "About";
     //
     // ribbonPageGroup18
     //
     this.ribbonPageGroup18.ItemLinks.Add(this.barButtonItem2);
     this.ribbonPageGroup18.ItemLinks.Add(this.barButtonItem3);
     this.ribbonPageGroup18.ItemLinks.Add(this.barButtonItem4, true);
     this.ribbonPageGroup18.Name = "ribbonPageGroup18";
     this.ribbonPageGroup18.Text = "Other Sites";
     //
     // ribbonPageGroup19
     //
     this.ribbonPageGroup19.ItemLinks.Add(this.barButtonItem5);
     this.ribbonPageGroup19.ItemLinks.Add(this.barButtonItem6);
     this.ribbonPageGroup19.Name = "ribbonPageGroup19";
     this.ribbonPageGroup19.Text = "Support";
     //
     // ribbonPageGroup20
     //
     this.ribbonPageGroup20.Name = "ribbonPageGroup20";
     this.ribbonPageGroup20.Text = "Videos";
     //
     // ribbonStatusBar1
     //
     this.ribbonStatusBar1.ItemLinks.Add(this.barStaticItem2);
     this.ribbonStatusBar1.ItemLinks.Add(this.cmdScaleUp);
     this.ribbonStatusBar1.ItemLinks.Add(this.cmdScaleDown);
     this.ribbonStatusBar1.Location = new System.Drawing.Point(0, 470);
     this.ribbonStatusBar1.Name = "ribbonStatusBar1";
     this.ribbonStatusBar1.Ribbon = this.ribbonMain;
     this.ribbonStatusBar1.Size = new System.Drawing.Size(712, 24);
     //
     // ribbonPageGroup8
     //
     this.ribbonPageGroup8.ItemLinks.Add(this.barStaticItem1);
     this.ribbonPageGroup8.Name = "ribbonPageGroup8";
     this.ribbonPageGroup8.Text = "Description";
     //
     // ribbonPageGroup9
     //
     this.ribbonPageGroup9.ItemLinks.Add(this.barStaticItem1);
     this.ribbonPageGroup9.Name = "ribbonPageGroup9";
     this.ribbonPageGroup9.Text = "Description";
     //
     // popupMenu1
     //
     this.popupMenu1.Name = "popupMenu1";
     this.popupMenu1.Ribbon = this.ribbonMain;
     //
     // popupMenu2
     //
     this.popupMenu2.Name = "popupMenu2";
     this.popupMenu2.Ribbon = this.ribbonMain;
     //
     // popupMenu3
     //
     this.popupMenu3.ItemLinks.Add(this.cmdRenameTab);
     this.popupMenu3.ItemLinks.Add(this.cmdCloseTab);
     this.popupMenu3.Name = "popupMenu3";
     this.popupMenu3.Ribbon = this.ribbonMain;
     //
     // toolTipController1
     //
     this.toolTipController1.Rounded = true;
     this.toolTipController1.ShowBeak = true;
     //
     // MainForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize = new System.Drawing.Size(712, 494);
     this.Controls.Add(this.pnlCountersTree);
     this.Controls.Add(this.ribbonMain);
     this.Controls.Add(this.ribbonStatusBar1);
     this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.IsMdiContainer = true;
     this.Name = "MainForm";
     this.Text = "Perf+  (Alpha - Expires February 2007)";
     this.Load += new System.EventHandler(this.MainForm_Load);
     ((System.ComponentModel.ISupportInitialize)(this.barDockMgr)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dockMgr)).EndInit();
     this.pnlCountersTree.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.lsttopToolbarImages)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.tabsMgr)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.imgRibbon)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.popupMenu1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.popupMenu2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.popupMenu3)).EndInit();
     this.ResumeLayout(false);
 }
Beispiel #34
0
        public static BarButtonItem AddXemTatCa(BarManager barManager, Bar mainBar, 
            BarButtonItem barButtonItemSearch,PopupControlContainer popUP,BarCheckItem filter, GridView gridViewMaster,RepositoryItemCheckedComboBoxEdit listChoseColumn, string filterString
            )
        {
            int index = 0;
            for (int i = 0; i < mainBar.LinksPersistInfo.Count; i++)
            {
                LinkPersistInfo info =mainBar.LinksPersistInfo[i];
                if (info.Item.Name == barButtonItemSearch.Name)
                {
                    info.BeginGroup = false;
                    index = i;
                    break;
                }
            }

            BarButtonItem viewAll = new BarButtonItem();
            viewAll.Caption = "Xem tất c&ả";
            viewAll.PaintStyle = BarItemPaintStyle.CaptionGlyph;
            viewAll.Glyph = FrameworkParams.imageStore.GetImage2020("Picture.png");
            viewAll.Visibility = BarItemVisibility.Always;

            viewAll.Appearance.ForeColor = Color.Red;
            Font bk = viewAll.Font;
            viewAll.Appearance.Font = new Font(bk, FontStyle.Bold);
            viewAll.Appearance.Options.UseFont = true;
            viewAll.Appearance.Options.UseForeColor = true;

            mainBar.LinksPersistInfo.Insert(index, new LinkPersistInfo(viewAll, true));
            barManager.Items.Add(viewAll);

            viewAll.ItemClick += delegate(object sender, ItemClickEventArgs e)
            {
                try
                {
                    if (listChoseColumn != null)
                    {
                        AppCtrl.DisplayTheoTuyBienCot(gridViewMaster, listChoseColumn);
                    }
                    QueryBuilder query = new QueryBuilder(filterString);
                    foreach (string sort in BIEN_MUC.DEFAUT_SORT_ASC_FIELDS)
                    {
                        query.setAscOrderBy(sort);
                    }
                    DataSet ds = HelpDB.getDBService().LoadDataSet(query);
                    if (ds != null && ds.Tables.Count > 0)
                        gridViewMaster.GridControl.DataSource = ds.Tables[0];
                    else gridViewMaster.GridControl.DataSource = null;
                    popUP.Visible = false;
                    filter.Checked = false;
                    foreach (Control ctrl in popUP.Controls)
                    {
                        if (ctrl is PLMultiCombobox)
                        {
                            PLMultiCombobox plm = ctrl as PLMultiCombobox;
                            plm._setSelectedIDs(new long[] {-1});
                        }
                        else if (ctrl is SpinEdit)
                        {
                            SpinEdit spin = ctrl as SpinEdit;
                            spin.EditValue = null;
                        }
                        else if (ctrl is TextEdit)
                        {
                            TextEdit txt = ctrl as TextEdit;
                            txt.Text = null;
                        }
                        else if (ctrl is DateEdit)
                        {
                            DateEdit date = ctrl as DateEdit;
                            date.EditValue = null;
                        }
                        else if (ctrl is CheckedListBoxControl)
                        {
                            CheckedListBoxControl check = ctrl as CheckedListBoxControl;
                            check.UnCheckAll();
                        }
                        else if(ctrl is PLDateSelection)
                        {
                            PLDateSelection date = ctrl as PLDateSelection;
                            if (date.AllowNull) date.SelectedType = SelectionTypes.None;
                        }

                    }
                }
                catch
                {

                }
            };
            return viewAll;
        }
Beispiel #35
0
        public MainWindow()
        {
            #region Show Splash Screen
            // show splash screen
            ResetSplashCreated = new ManualResetEvent(false);

            // Create a new thread for the splash screen to run on
            SplashThread = new Thread(ShowSplash);
            SplashThread.SetApartmentState(ApartmentState.STA);
            SplashThread.IsBackground = true;
            SplashThread.Name         = "Splash Screen";
            SplashThread.Start();

            ResetSplashCreated.WaitOne();

            #endregion

            splashscreen.ShowMessage("Initializing main window ...");
            InitializeComponent();

            DevExpress.Xpf.Core.DXGridDataController.DisableThreadingProblemsDetection = true;


            Messenger.Default.Register <NotificationMessage <string> >(this, PopNotificationMessage);

            // create DocumentPanel per the logical motion components defined in the config file
            var service = SimpleIoc.Default.GetInstance <ViewSystemService>().Service;

            #region Create logical motioin components panels
            foreach (LogicalMotionComponent aligner in service.LogicalMotionComponentCollection)
            {
                splashscreen.ShowMessage(string.Format("Initializing {0} panel ...", aligner));

                // create a motion component panel control
                // which is the content of the document panel
                MotionComponentPanel mcPanel = new MotionComponentPanel()
                {
                    // set the datacontext to the LogicalMotionComponent
                    DataContext = aligner
                };

                // create a document panel
                DocumentPanel panel = new DocumentPanel()
                {
                    Name             = string.Format("dp{0}", aligner.Caption.Replace(" ", "")),
                    Caption          = aligner.Caption,
                    AllowContextMenu = false,
                    AllowMaximize    = false,
                    AllowSizing      = false,
                    AllowFloat       = false,
                    AllowDock        = false,
                    //AllowClose = false,
                    ClosingBehavior = ClosingBehavior.HideToClosedPanelsCollection,

                    // put the user control into the panel
                    Content = mcPanel
                };

                // add the documentpanel to the documentgroup
                MotionComponentPanelHost.Items.Add(panel);

                // find the icon shown in the button
                var image = (BitmapFrame)TryFindResource(aligner.Icon);

                // add view buttons to Ribbon toolbar
                BarCheckItem chk = new BarCheckItem()
                {
                    Content    = aligner.Caption,
                    LargeGlyph = image
                };

                // bind the IsCheck property to the document panel's Closed property
                Binding b = new Binding()
                {
                    Source    = panel,
                    Path      = new PropertyPath("Visibility"),
                    Mode      = BindingMode.TwoWay,
                    Converter = new VisibilityToBoolean()
                };
                chk.SetBinding(BarCheckItem.IsCheckedProperty, b);

                rpgView_MotionComponent.Items.Add(chk);
            }
            #endregion

            #region Create control panels for instruments

            ViewModelBase viewInstr;
            foreach (IInstrument instr in service.CollectionViewDefinedInstruments)
            {
                // if not icon specified, do not create the control panel.
                if (instr.Config.Icon == null)
                {
                    continue;
                }

                UserControl uctrl = null;

                //TODO The following codes is not elegant, the code must be expanded if new type of instrument added into the system
                if (instr is Keithley2400)
                {
                    // create the user control for k2400
                    viewInstr = new ViewKeithley2400(instr as Keithley2400);
                    uctrl     = new Keithley2400ControlPanel()
                    {
                        DataContext = viewInstr
                    };
                }
                else if (instr is Newport2832C)
                {
                    // create the user control for k2400
                    viewInstr = new ViewNewport2832C(instr as Newport2832C);
                    uctrl     = new Newport2832cControlPanel()
                    {
                        DataContext = viewInstr
                    };
                }

                splashscreen.ShowMessage(string.Format("Initializing {0} panel ...", instr));

                // create document panel in the window
                DocumentPanel panel = new DocumentPanel()
                {
                    Name            = string.Format("dp{0}", instr.DeviceClass.ToString("N")),
                    Caption         = instr.Config.Caption,
                    AllowMaximize   = false,
                    AllowSizing     = false,
                    AllowDock       = false,
                    AllowFloat      = false,
                    ClosingBehavior = ClosingBehavior.HideToClosedPanelsCollection,

                    // put the user control into the panel
                    Content = uctrl
                };

                // add the documentpanel to the documentgroup
                MotionComponentPanelHost.Items.Add(panel);

                // find the icon shown in the button
                var image = (BitmapFrame)TryFindResource(instr.Config.Icon);

                // add view buttons to Ribbon toolbar
                BarCheckItem chk = new BarCheckItem()
                {
                    Content    = instr.Config.Caption,
                    LargeGlyph = image
                };

                // bind the IsCheck property to the document panel's Closed property
                Binding b = new Binding()
                {
                    Source    = panel,
                    Path      = new PropertyPath("Visibility"),
                    Mode      = BindingMode.TwoWay,
                    Converter = new VisibilityToBoolean()
                };
                chk.SetBinding(BarCheckItem.IsCheckedProperty, b);

                rpgView_Equipments.Items.Add(chk);
            }

            #endregion

            splashscreen.ShowMessage(string.Format("Restoring workspace ..."));

            #region Restore workspace layout

            var config = service.SystemSettings;
            for (int i = 0; i < MotionComponentPanelHost.Items.Count; i++)
            {
                var panel = MotionComponentPanelHost.Items[i];

                if (panel is DocumentPanel)
                {
                    try
                    {
                        var setting = ((IEnumerable)config.ConfWSLayout.WorkspaceLayout).Cast <dynamic>().Where(item => item.PanelName == panel.Name).First();

                        // set visibility
                        panel.Visibility = setting.IsClosed ? Visibility.Hidden : Visibility.Visible;

                        // set location
                        ((DocumentPanel)panel).MDILocation = setting.MDILocation;
                    }
                    catch
                    {
                        ; // do nothing if the panel was not found in layout setting file
                    }
                }
            }
            #endregion
        }
Beispiel #36
0
        private static BarButtonItem AddXemTatCa(BarManager barManager, Bar mainBar,
            BarButtonItem barButtonItemSearch, PopupControlContainer popUP,
            BarCheckItem filter, GridView gridViewMaster, string filterString,
            string ascSortClause, string descSortClause, string groupClause
            )
        {
            int index = 0;
            for (int i = 0; i < mainBar.LinksPersistInfo.Count; i++)
            {
                LinkPersistInfo info = mainBar.LinksPersistInfo[i];
                if (info.Item.Name == barButtonItemSearch.Name)
                {
                    info.BeginGroup = false;
                    index = i;
                    break;
                }
            }

            var viewAll = new BarButtonItem
                              {
                                  Caption = "Xem tất c&ả",
                                  PaintStyle = BarItemPaintStyle.CaptionGlyph,
                                  Glyph = FrameworkParams.imageStore.GetImage2020("Picture.png"),
                                  Visibility = BarItemVisibility.Always
                              };

            viewAll.Appearance.ForeColor = Color.Red;
            Font bk = viewAll.Font;
            viewAll.Appearance.Font = new Font(bk, FontStyle.Bold);
            viewAll.Appearance.Options.UseFont = true;
            viewAll.Appearance.Options.UseForeColor = true;

            mainBar.LinksPersistInfo.Insert(index, new LinkPersistInfo(viewAll, true));
            barManager.Items.Add(viewAll);

            viewAll.ItemClick += delegate
                                     {

                                         var wait = new FWWaitingMsg();

                                         try
                                         {

                                             var query = new QueryBuilder(filterString);
                                             if (!string.IsNullOrEmpty(groupClause))
                                             {
                                                 query.addGroupBy(groupClause);
                                             }
                                             if (ascSortClause != "")
                                                 query.setAscOrderBy(ascSortClause);
                                             if (descSortClause != "")
                                                 query.setDescOrderBy(descSortClause);
                                             var ds = HelpDB.getDBService().LoadDataSet(query);
                                             gridViewMaster.ClearSelection();
                                             if (ds != null && ds.Tables.Count > 0)
                                             {
                                                 gridViewMaster.GridControl.DataSource = ds.Tables[0];
                                                 if (gridViewMaster.RowCount > 0)
                                                 {
                                                     gridViewMaster.FocusedRowHandle = -1;
                                                     gridViewMaster.SelectRow(0);
                                                     gridViewMaster.FocusedRowHandle = 0;
                                                 }
                                                 else
                                                 {
                                                     gridViewMaster.SelectRow(-1);
                                                 }

                                             }
                                             else gridViewMaster.GridControl.DataSource = null;

                                             filter.Checked = false;

                                             //if (frm == null
                                             //    || !(frm is PhieuQuanLyBandedChange)
                                             //    || ((PhieuQuanLyBandedChange)frm)._UsingCheckFiler)
                                             //{
                                             //    popUP.Visible = false;
                                             //}

                                             ClearDataCtrl(popUP.Controls);
                                         }
                                         catch (Exception ex)
                                         {
                                             PLException.AddException(ex);
                                         }
                                         finally
                                         {
                                             wait.Finish();
                                         }
                                     };
            return viewAll;
        }
 private void SetChecked(BarCheckItem item, bool isChecked)
 {
     item.Checked = isChecked;
 }
Beispiel #38
0
        /// <summary>
        ///     加载头部左侧菜单
        /// </summary>
        private void LoadGridHeaderMenu(BarManager barManager)
        {
            if (!ShowCustomHeaderMenu)
            {
                return;
            }
            BarManagerMain = barManager;
            var gridView = MainView as GridView;

            if (gridView == null)
            {
                return;
            }
            gridView.FixedLineWidth = 2;
            //gridView.Appearance.FixedLine.BackColor = Color.PaleVioletRed;


            gridView.CustomDrawRowIndicator += gridView_CustomDrawRowIndicator;
            gridView.Click           += gridView_Click;           //单击gridview
            gridView.DragObjectStart += gridView_DragObjectStart; //开始拖拽grid列头,用于处理拖拽动态生成冻结列
            gridView.DragObjectDrop  += gridView_DragObjectDrop;  //停止拖拽grid列头,用于处理拖拽动态生成冻结列
            gridView.MouseDown       += gridView_MouseDown;
            //初始化菜单
            PopupMenuMain        = new PopupMenu();
            _pbarbtnColumnConfig = new BarButtonItem
            {
                Caption = @"列数",
                Id      = 0,
                Name    = "pbarbtn_ColumnConfig"
            };

            _pbarbtnAdvanceSearch = new BarButtonItem
            {
                Caption    = @"高级查询",
                Id         = 2,
                Name       = "pbarbtn_AdvanceSearch",
                Visibility = _advanceSearchItemClick == null && AdvanceSearchMethod == null
                                        ? BarItemVisibility.Never
                                        : BarItemVisibility.Always
            };

            _pbarbtnRowNumber = new BarCheckItem
            {
                Caption = @"行号",
                Id      = 3,
                Name    = "pbarbtn_RowHeight"
            };


            _pbarbtnRowHeight = new BarButtonItem
            {
                Caption = @"行高",
                Id      = 4,
                Name    = "pbarbtn_RowHeight"
            };

            _pbarbtnImmediatelyDownload = new BarCheckItem
            {
                Caption    = @"打开后立即下载",
                Id         = 5,
                Name       = "pbarbtn_ImmediatelyDownload",
                Visibility = ShowImmediatelyDownLoadMenu
                                        ? BarItemVisibility.Always
                                        : BarItemVisibility.Never
            };

            _pbarbtnColumnConfig.ItemClick        += pbarbtn_ItemClick;
            _pbarbtnAdvanceSearch.ItemClick       += pbarbtn_ItemClick;
            _pbarbtnRowHeight.ItemClick           += pbarbtn_ItemClick;
            _pbarbtnRowNumber.ItemClick           += pbarbtn_ItemClick;
            _pbarbtnImmediatelyDownload.ItemClick += pbarbtn_ItemClick;

            PopupMenuMain.LinksPersistInfo.AddRange(new[]
            {
                new LinkPersistInfo(_pbarbtnAdvanceSearch),
                new LinkPersistInfo(_pbarbtnColumnConfig, true),
                new LinkPersistInfo(_pbarbtnRowNumber),
                new LinkPersistInfo(_pbarbtnRowHeight),
                new LinkPersistInfo(_pbarbtnImmediatelyDownload, true)
            });
            PopupMenuMain.Manager = BarManagerMain;
            PopupMenuMain.Name    = "popupMenu_Main";
            //加载行号
            var rowNumberChecked = Ini.ReadItem("GridRowNumber", _rowNumberName);

            _pbarbtnRowNumber.Checked = !string.IsNullOrEmpty(rowNumberChecked) && Convert.ToBoolean(rowNumberChecked);
            gridView.IndicatorWidth   = _pbarbtnRowNumber.Checked ? 35 : 20;           //行号列宽
            //打开后是否立即下载
            var immediatelyDownload = Ini.ReadItem("ImmediatelyDownload", _immediatelyDownloadName);

            _pbarbtnImmediatelyDownload.Checked = !string.IsNullOrEmpty(immediatelyDownload) && Convert.ToBoolean(immediatelyDownload);
            ImmediatelyDownLoad = _pbarbtnImmediatelyDownload.Checked;
        }
Beispiel #39
0
        private void OnExchangeFormClosed(object sender, FormClosedEventArgs e)
        {
            BarCheckItem item = (BarCheckItem)((Form)sender).Tag;

            item.Checked = false;
        }
        private void PopularDadosGrafico()
        {
            ViewType[] ignorarOsTipos = new ViewType[]
            {
                ViewType.PolarArea,
                ViewType.PolarLine,
                ViewType.PolarPoint,
                //ViewType.SideBySideGantt,
                ViewType.SideBySideRangeBar,
                ViewType.RangeBar,
                //ViewType.Gantt,
                ViewType.Stock,
                ViewType.SwiftPlot,
                ViewType.CandleStick,
                //ViewType.SideBySideFullStackedBar,
                //ViewType.SideBySideFullStackedBar3D,
                //ViewType.SideBySideStackedBar,
                //ViewType.SideBySideStackedBar3D
            };

            #region Layout

            Enum.GetValues(typeof(ViewType))
            .OfType <ViewType>()
            .Where(w => !ignorarOsTipos.Contains(w))
            .ToList()
            .ForEach(f =>
            {
                BarCheckItem barCheckItem = new BarCheckItem();
                barCheckItem.Caption      = f.ToString();
                barCheckItem.Tag          = f;

                barCheckItem.ItemClick += delegate(object senderItemClick, ItemClickEventArgs eItemClick)
                {
                    if ((eItemClick.Item as BarCheckItem).Checked)
                    {
                        // Procura e desmarca o item selecionado
                        this.brMngrCustomGrid.Items
                        .OfType <BarCheckItem>()
                        .Where(w => w.Tag != null && w.Tag is ViewType && eItemClick.Item != w && w.Checked)
                        .Update(u => u.Checked = false);

                        this.chtCtrlVisualizacoes.SeriesTemplate.ChangeView((ViewType)eItemClick.Item.Tag);

                        this.chtCtrlVisualizacoes.Legend.Visible = this.brChckItmLegenda.Checked;
                        this.pvtGrdVisualizacoes.OptionsChartDataSource.ProvideDataByColumns     = this.brChckItmAlterarLinhasPorColunas.Checked;
                        this.pvtGrdVisualizacoes.OptionsChartDataSource.SelectionOnly            = this.brChckItmSomenteOSelecionado.Checked;
                        this.pvtGrdVisualizacoes.OptionsChartDataSource.ProvideColumnGrandTotals = this.brChckItmMostrarTotalColuna.Checked;
                        this.pvtGrdVisualizacoes.OptionsChartDataSource.ProvideRowGrandTotals    = this.brChckItmMostrarTotalLinha.Checked;
                        this.chtCtrlVisualizacoes.Legend.Visible = this.brChckItmLegenda.Checked;
                        if (this.chtCtrlVisualizacoes.SeriesTemplate.Label != null)
                        {
                            this.chtCtrlVisualizacoes.SeriesTemplate.Label.Visible = this.brChckItmValor.Checked;
                        }

                        if (this.Diagram3D != null)
                        {
                            this.Diagram3D.RuntimeRotation  = true;
                            this.Diagram3D.RuntimeZooming   = true;
                            this.Diagram3D.RuntimeScrolling = true;
                        }
                        else
                        if (this.XyDiagram != null)
                        {
                            this.XyDiagram.AxisX.Visible                  = this.brChckItmEixoX.Checked;
                            this.XyDiagram.AxisX.Title.Visible            = true;
                            this.XyDiagram.AxisX.Range.MaxValue           = 20;
                            this.XyDiagram.AxisX.Range.Auto               = true;
                            this.XyDiagram.AxisX.Range.SideMarginsEnabled = true;

                            this.XyDiagram.AxisY.Visible                  = this.brChckItmEixoY.Checked;
                            this.XyDiagram.AxisY.Title.Visible            = true;
                            this.XyDiagram.AxisY.Range.MaxValue           = 20;
                            this.XyDiagram.AxisY.Range.Auto               = true;
                            this.XyDiagram.AxisY.Range.SideMarginsEnabled = true;

                            this.XyDiagram.Rotated = this.brChckItmVirar.Checked;
                            this.XyDiagram.DefaultPane.EnableAxisXScrolling = DevExpress.Utils.DefaultBoolean.True;
                        }


                        this.chtCtrlVisualizacoes.Series
                        .OfType <Series>()
                        .ToList()
                        .ForEach(f1 =>
                        {
                            ISupportTransparency supportTransparency = f1.View as ISupportTransparency;
                            if (supportTransparency != null &&
                                (f1.View is AreaSeriesView ||
                                 f1.View is Area3DSeriesView ||
                                 f1.View is RadarAreaSeriesView ||
                                 f1.View is Bar3DSeriesView))
                            {
                                supportTransparency.Transparency = 135;
                            }
                        });

                        Series series = this.chtCtrlVisualizacoes.Series
                                        .OfType <Series>()
                                        .FirstOrDefault();

                        if (series != null && series.View != null)
                        {
                            this.brSbItmTipo.Enabled = series.View is PointSeriesView;
                            this.brMngrCustomGrid.Items
                            .OfType <BarCheckItem>()
                            .Where(w => w.Checked)
                            .FirstOrDefault()
                            .PerformClick();
                        }
                    }
                    else
                    {
                        (eItemClick.Item as BarCheckItem).Checked = true;
                    }
                };

                if (f.ToString().ToUpper().IndexOf("RADAR") != -1)
                {
                    this.brSbItmRadar.AddItem(barCheckItem);
                }
                else
                if (f.ToString().ToUpper().IndexOf("BAR") != -1)
                {
                    this.brSbItmBarra.AddItem(barCheckItem);
                }
                else
                if (f.ToString().ToUpper().IndexOf("LINE") != -1)
                {
                    this.brSbItmLinha.AddItem(barCheckItem);
                }
                else
                if (f.ToString().ToUpper().IndexOf("AREA") != -1)
                {
                    this.brSbItmArea.AddItem(barCheckItem);
                }
                else
                if (f.ToString().ToUpper().IndexOf("PIE") != -1 || f.ToString().ToUpper().IndexOf("DOUGHNUT") != -1)
                {
                    this.brSbItmPizza.AddItem(barCheckItem);
                }
                else
                {
                    this.brSbItmOutros.AddItem(barCheckItem);
                }
            });

            #endregion

            #region Tipo

            Enum.GetValues(typeof(MarkerKind))
            .OfType <MarkerKind>()
            .ToList()
            .ForEach(u =>
            {
                BarCheckItem barCheckItem = new BarCheckItem();
                barCheckItem.Caption      = u.ToString();
                barCheckItem.Tag          = u;

                barCheckItem.ItemClick += delegate(object senderItemClick, ItemClickEventArgs eItemClick)
                {
                    if ((eItemClick.Item as BarCheckItem).Checked)
                    {
                        // Procura e desmarca o item selecionado
                        this.brSbItmTipo.LinksPersistInfo
                        .OfType <LinkPersistInfo>()
                        .Where(w => eItemClick.Item != w.Item && (w.Item as BarCheckItem).Checked)
                        .Update(u1 => (u1.Item as BarCheckItem).Checked = false);

                        // Altera o Kind de todas series
                        MarkerKind markerKind = (MarkerKind)eItemClick.Item.Tag;
                        this.chtCtrlVisualizacoes.Series
                        .OfType <Series>()
                        .ToList()
                        .ForEach(f1 =>
                        {
                            PointSeriesView pointSeriesView = f1.View as PointSeriesView;
                            if (pointSeriesView != null)
                            {
                                pointSeriesView.PointMarkerOptions.Kind          = markerKind;
                                pointSeriesView.PointMarkerOptions.BorderVisible = false;
                            }
                        });
                    }
                    else
                    {
                        (eItemClick.Item as BarCheckItem).Checked = true;
                    }
                };
                this.brSbItmTipo.AddItem(barCheckItem);
            });

            #endregion

            this.chtCtrlVisualizacoes.DataSource = this.pvtGrdVisualizacoes;
            this.chtCtrlVisualizacoes.RefreshData();

            this.brMngrCustomGrid.Items
            .OfType <BarCheckItem>()
            .Where(w => w.Tag != null && w.Tag.Equals(ViewType.Line))
            .FirstOrDefault()
            .PerformClick();

            this.brMngrCustomGrid.Items
            .OfType <BarCheckItem>()
            .Where(w => w.Tag != null && w.Tag.Equals(MarkerKind.Circle))
            .FirstOrDefault()
            .PerformClick();
        }
Beispiel #41
0
 private void SetStdFilterHint(BarCheckItem ABarCheckItem)
 {
     try
     {
         ABarCheckItem.Hint = ABarCheckItem.Tag + ": Filter=" +
                              (string)(ABarCheckItem.Checked ? "On" : "Off");
     }
     catch (Exception error)
     {
         throw new Exception("An error occurred while setting the status bar filter hint for: " + ABarCheckItem.Name + "." + Environment.NewLine +
              "Error CNF-019 in " + FORM_NAME + ".SetStdFilterHint(): " + error.Message);
     }
 }
Beispiel #42
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(StrategiesCollectionForm));
     this.barManager1 = new DevExpress.XtraBars.BarManager(this.components);
     this.bar1 = new DevExpress.XtraBars.Bar();
     this.siAdd = new DevExpress.XtraBars.BarSubItem();
     this.biRemove = new DevExpress.XtraBars.BarButtonItem();
     this.biEdit = new DevExpress.XtraBars.BarButtonItem();
     this.biStart = new DevExpress.XtraBars.BarButtonItem();
     this.biStop = new DevExpress.XtraBars.BarButtonItem();
     this.biSimulation = new DevExpress.XtraBars.BarButtonItem();
     this.biOptimizeParams = new DevExpress.XtraBars.BarButtonItem();
     this.btShowData = new DevExpress.XtraBars.BarButtonItem();
     this.bcShowLog = new DevExpress.XtraBars.BarCheckItem();
     this.biSettings = new DevExpress.XtraBars.BarButtonItem();
     this.bar3 = new DevExpress.XtraBars.Bar();
     this.siStatus = new DevExpress.XtraBars.BarStaticItem();
     this.beSimulationProgress = new DevExpress.XtraBars.BarEditItem();
     this.repositoryItemProgressBar1 = new DevExpress.XtraEditors.Repository.RepositoryItemProgressBar();
     this.barDockControlTop = new DevExpress.XtraBars.BarDockControl();
     this.barDockControlBottom = new DevExpress.XtraBars.BarDockControl();
     this.barDockControlLeft = new DevExpress.XtraBars.BarDockControl();
     this.barDockControlRight = new DevExpress.XtraBars.BarDockControl();
     this.dockManager1 = new DevExpress.XtraBars.Docking.DockManager(this.components);
     this.dpLogPanel = new DevExpress.XtraBars.Docking.DockPanel();
     this.dockPanel1_Container = new DevExpress.XtraBars.Docking.ControlContainer();
     this.logMessagesControl = new CryptoMarketClient.LogMessagesControl();
     this.gridControl1 = new DevExpress.XtraGrid.GridControl();
     this.strategyBaseBindingSource = new System.Windows.Forms.BindingSource(this.components);
     this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
     this.colEnabled = new DevExpress.XtraGrid.Columns.GridColumn();
     this.repositoryItemCheckEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
     this.colDemoMode = new DevExpress.XtraGrid.Columns.GridColumn();
     this.repositoryItemCheckEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
     this.colDescription = new DevExpress.XtraGrid.Columns.GridColumn();
     this.repositoryItemTextEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
     this.colName = new DevExpress.XtraGrid.Columns.GridColumn();
     this.colStateText = new DevExpress.XtraGrid.Columns.GridColumn();
     this.riTextEditState = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
     this.colEarned = new DevExpress.XtraGrid.Columns.GridColumn();
     this.colEnableNotifications = new DevExpress.XtraGrid.Columns.GridColumn();
     this.repositoryItemCheckEdit3 = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
     this.behaviorManager1 = new DevExpress.Utils.Behaviors.BehaviorManager(this.components);
     this.toastNotificationsManager1 = new DevExpress.XtraBars.ToastNotifications.ToastNotificationsManager(this.components);
     ((System.ComponentModel.ISupportInitialize)(this.barManager1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemProgressBar1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dockManager1)).BeginInit();
     this.dpLogPanel.SuspendLayout();
     this.dockPanel1_Container.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.gridControl1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.strategyBaseBindingSource)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemCheckEdit1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemCheckEdit2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.riTextEditState)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemCheckEdit3)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.behaviorManager1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.toastNotificationsManager1)).BeginInit();
     this.SuspendLayout();
     //
     // barManager1
     //
     this.barManager1.AllowHtmlText = true;
     this.barManager1.Bars.AddRange(new DevExpress.XtraBars.Bar[] {
     this.bar1,
     this.bar3});
     this.barManager1.DockControls.Add(this.barDockControlTop);
     this.barManager1.DockControls.Add(this.barDockControlBottom);
     this.barManager1.DockControls.Add(this.barDockControlLeft);
     this.barManager1.DockControls.Add(this.barDockControlRight);
     this.barManager1.DockManager = this.dockManager1;
     this.barManager1.Form = this;
     this.barManager1.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
     this.siAdd,
     this.biRemove,
     this.biEdit,
     this.siStatus,
     this.biStart,
     this.biStop,
     this.btShowData,
     this.biSimulation,
     this.bcShowLog,
     this.biOptimizeParams,
     this.beSimulationProgress,
     this.biSettings});
     this.barManager1.MaxItemId = 15;
     this.barManager1.OptionsStubGlyphs.AllowStubGlyphs = DevExpress.Utils.DefaultBoolean.True;
     this.barManager1.OptionsStubGlyphs.CaseMode = DevExpress.Utils.Drawing.GlyphTextCaseMode.UpperCase;
     this.barManager1.OptionsStubGlyphs.CornerRadius = 3;
     this.barManager1.OptionsStubGlyphs.Font = new System.Drawing.Font("Segoe UI", 12F);
     this.barManager1.OptionsStubGlyphs.LetterCount = DevExpress.Utils.Drawing.GlyphTextSymbolCount.Two;
     this.barManager1.OptionsStubGlyphs.UseFont = true;
     this.barManager1.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
     this.repositoryItemProgressBar1});
     //
     // bar1
     //
     this.bar1.BarAppearance.Hovered.FontStyleDelta = System.Drawing.FontStyle.Bold;
     this.bar1.BarAppearance.Hovered.Options.UseFont = true;
     this.bar1.BarAppearance.Normal.FontStyleDelta = System.Drawing.FontStyle.Bold;
     this.bar1.BarAppearance.Normal.Options.UseFont = true;
     this.bar1.BarAppearance.Pressed.FontStyleDelta = System.Drawing.FontStyle.Bold;
     this.bar1.BarAppearance.Pressed.Options.UseFont = true;
     this.bar1.BarName = "Tools";
     this.bar1.DockCol = 0;
     this.bar1.DockRow = 0;
     this.bar1.DockStyle = DevExpress.XtraBars.BarDockStyle.Top;
     this.bar1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
     new DevExpress.XtraBars.LinkPersistInfo(this.siAdd),
     new DevExpress.XtraBars.LinkPersistInfo(this.biRemove),
     new DevExpress.XtraBars.LinkPersistInfo(this.biEdit),
     new DevExpress.XtraBars.LinkPersistInfo(this.biStart, true),
     new DevExpress.XtraBars.LinkPersistInfo(this.biStop),
     new DevExpress.XtraBars.LinkPersistInfo(this.biSimulation),
     new DevExpress.XtraBars.LinkPersistInfo(this.biOptimizeParams),
     new DevExpress.XtraBars.LinkPersistInfo(this.btShowData, true),
     new DevExpress.XtraBars.LinkPersistInfo(this.bcShowLog),
     new DevExpress.XtraBars.LinkPersistInfo(this.biSettings)});
     this.bar1.OptionsBar.DrawBorder = false;
     this.bar1.OptionsBar.UseWholeRow = true;
     this.bar1.Text = "Tools";
     //
     // siAdd
     //
     this.siAdd.Caption = "New";
     this.siAdd.Id = 0;
     this.siAdd.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("siAdd.ImageOptions.SvgImage")));
     this.siAdd.Name = "siAdd";
     this.siAdd.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph;
     //
     // biRemove
     //
     this.biRemove.Caption = "Remove Selected";
     this.biRemove.Id = 1;
     this.biRemove.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("biRemove.ImageOptions.SvgImage")));
     this.biRemove.Name = "biRemove";
     this.biRemove.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph;
     this.biRemove.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.biRemove_ItemClick);
     //
     // biEdit
     //
     this.biEdit.Caption = "Edit";
     this.biEdit.Id = 2;
     this.biEdit.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("biEdit.ImageOptions.SvgImage")));
     this.biEdit.Name = "biEdit";
     this.biEdit.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph;
     this.biEdit.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.biEdit_ItemClick);
     //
     // biStart
     //
     this.biStart.AllowHtmlText = DevExpress.Utils.DefaultBoolean.True;
     this.biStart.Caption = "<b>Run!</b>";
     this.biStart.Id = 4;
     this.biStart.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("biStart.ImageOptions.SvgImage")));
     this.biStart.ItemAppearance.Normal.ForeColor = DevExpress.LookAndFeel.DXSkinColors.ForeColors.Information;
     this.biStart.ItemAppearance.Normal.Options.UseForeColor = true;
     this.biStart.Name = "biStart";
     this.biStart.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph;
     this.biStart.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.biStart_ItemClick);
     //
     // biStop
     //
     this.biStop.AllowHtmlText = DevExpress.Utils.DefaultBoolean.True;
     this.biStop.Caption = "<b>Stop</b>";
     this.biStop.Id = 5;
     this.biStop.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("biStop.ImageOptions.SvgImage")));
     this.biStop.ItemAppearance.Normal.ForeColor = DevExpress.LookAndFeel.DXSkinColors.ForeColors.Critical;
     this.biStop.ItemAppearance.Normal.Options.UseForeColor = true;
     this.biStop.Name = "biStop";
     this.biStop.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph;
     this.biStop.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.biStop_ItemClick);
     //
     // biSimulation
     //
     this.biSimulation.AllowHtmlText = DevExpress.Utils.DefaultBoolean.True;
     this.biSimulation.Caption = "<b>Simulation</b>";
     this.biSimulation.Id = 8;
     this.biSimulation.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("biSimulation.ImageOptions.SvgImage")));
     this.biSimulation.ItemAppearance.Hovered.ForeColor = DevExpress.LookAndFeel.DXSkinColors.ForeColors.Question;
     this.biSimulation.ItemAppearance.Hovered.Options.UseForeColor = true;
     this.biSimulation.ItemAppearance.Normal.ForeColor = DevExpress.LookAndFeel.DXSkinColors.ForeColors.Question;
     this.biSimulation.ItemAppearance.Normal.Options.UseForeColor = true;
     this.biSimulation.ItemAppearance.Pressed.ForeColor = DevExpress.LookAndFeel.DXSkinColors.ForeColors.Question;
     this.biSimulation.ItemAppearance.Pressed.Options.UseForeColor = true;
     this.biSimulation.Name = "biSimulation";
     this.biSimulation.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph;
     this.biSimulation.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.biSimulation_ItemClick);
     //
     // biOptimizeParams
     //
     this.biOptimizeParams.Caption = "Optimize Params";
     this.biOptimizeParams.Id = 11;
     this.biOptimizeParams.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("biOptimizeParams.ImageOptions.SvgImage")));
     this.biOptimizeParams.ItemAppearance.Normal.ForeColor = DevExpress.LookAndFeel.DXSkinColors.ForeColors.Question;
     this.biOptimizeParams.ItemAppearance.Normal.Options.UseForeColor = true;
     this.biOptimizeParams.Name = "biOptimizeParams";
     this.biOptimizeParams.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph;
     this.biOptimizeParams.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.biOptimizeParams_ItemClick);
     //
     // btShowData
     //
     this.btShowData.Caption = "<b>Show Data</b>";
     this.btShowData.Id = 6;
     this.btShowData.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btShowData.ImageOptions.SvgImage")));
     this.btShowData.Name = "btShowData";
     this.btShowData.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph;
     this.btShowData.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btShowData_ItemClick);
     //
     // bcShowLog
     //
     this.bcShowLog.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right;
     this.bcShowLog.Caption = "<b>Show Log</b>";
     this.bcShowLog.Id = 10;
     this.bcShowLog.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("bcShowLog.ImageOptions.SvgImage")));
     this.bcShowLog.Name = "bcShowLog";
     this.bcShowLog.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph;
     this.bcShowLog.CheckedChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.bcShowLog_CheckedChanged);
     //
     // biSettings
     //
     this.biSettings.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right;
     this.biSettings.Caption = "Settings";
     this.biSettings.Id = 14;
     this.biSettings.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("biSettings.ImageOptions.SvgImage")));
     this.biSettings.Name = "biSettings";
     this.biSettings.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph;
     this.biSettings.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.biSettings_ItemClick);
     //
     // bar3
     //
     this.bar3.BarName = "Status bar";
     this.bar3.CanDockStyle = DevExpress.XtraBars.BarCanDockStyle.Bottom;
     this.bar3.DockCol = 0;
     this.bar3.DockRow = 0;
     this.bar3.DockStyle = DevExpress.XtraBars.BarDockStyle.Bottom;
     this.bar3.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
     new DevExpress.XtraBars.LinkPersistInfo(this.siStatus),
     new DevExpress.XtraBars.LinkPersistInfo(DevExpress.XtraBars.BarLinkUserDefines.Width, this.beSimulationProgress, "", false, true, true, 210)});
     this.bar3.OptionsBar.AllowQuickCustomization = false;
     this.bar3.OptionsBar.DrawDragBorder = false;
     this.bar3.OptionsBar.UseWholeRow = true;
     this.bar3.Text = "Status bar";
     //
     // siStatus
     //
     this.siStatus.AllowHtmlText = DevExpress.Utils.DefaultBoolean.True;
     this.siStatus.Border = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
     this.siStatus.Caption = "    ";
     this.siStatus.Id = 3;
     this.siStatus.ItemAppearance.Normal.ForeColor = DevExpress.LookAndFeel.DXSkinColors.ForeColors.Information;
     this.siStatus.ItemAppearance.Normal.Options.UseForeColor = true;
     this.siStatus.Name = "siStatus";
     //
     // beSimulationProgress
     //
     this.beSimulationProgress.AutoFillWidth = true;
     this.beSimulationProgress.Caption = "barEditItem1";
     this.beSimulationProgress.Edit = this.repositoryItemProgressBar1;
     this.beSimulationProgress.Id = 13;
     this.beSimulationProgress.Name = "beSimulationProgress";
     this.beSimulationProgress.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
     //
     // repositoryItemProgressBar1
     //
     this.repositoryItemProgressBar1.Maximum = 100000;
     this.repositoryItemProgressBar1.Name = "repositoryItemProgressBar1";
     this.repositoryItemProgressBar1.ShowTitle = true;
     //
     // barDockControlTop
     //
     this.barDockControlTop.CausesValidation = false;
     this.barDockControlTop.Dock = System.Windows.Forms.DockStyle.Top;
     this.barDockControlTop.Location = new System.Drawing.Point(0, 0);
     this.barDockControlTop.Manager = this.barManager1;
     this.barDockControlTop.Size = new System.Drawing.Size(1667, 60);
     //
     // barDockControlBottom
     //
     this.barDockControlBottom.CausesValidation = false;
     this.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
     this.barDockControlBottom.Location = new System.Drawing.Point(0, 974);
     this.barDockControlBottom.Manager = this.barManager1;
     this.barDockControlBottom.Size = new System.Drawing.Size(1667, 52);
     //
     // barDockControlLeft
     //
     this.barDockControlLeft.CausesValidation = false;
     this.barDockControlLeft.Dock = System.Windows.Forms.DockStyle.Left;
     this.barDockControlLeft.Location = new System.Drawing.Point(0, 60);
     this.barDockControlLeft.Manager = this.barManager1;
     this.barDockControlLeft.Size = new System.Drawing.Size(0, 914);
     //
     // barDockControlRight
     //
     this.barDockControlRight.CausesValidation = false;
     this.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right;
     this.barDockControlRight.Location = new System.Drawing.Point(1667, 60);
     this.barDockControlRight.Manager = this.barManager1;
     this.barDockControlRight.Size = new System.Drawing.Size(0, 914);
     //
     // dockManager1
     //
     this.dockManager1.Form = this;
     this.dockManager1.HiddenPanels.AddRange(new DevExpress.XtraBars.Docking.DockPanel[] {
     this.dpLogPanel});
     this.dockManager1.MenuManager = this.barManager1;
     this.dockManager1.TopZIndexControls.AddRange(new string[] {
     "DevExpress.XtraBars.BarDockControl",
     "DevExpress.XtraBars.StandaloneBarDockControl",
     "System.Windows.Forms.StatusBar",
     "System.Windows.Forms.MenuStrip",
     "System.Windows.Forms.StatusStrip",
     "DevExpress.XtraBars.Ribbon.RibbonStatusBar",
     "DevExpress.XtraBars.Ribbon.RibbonControl",
     "DevExpress.XtraBars.Navigation.OfficeNavigationBar",
     "DevExpress.XtraBars.Navigation.TileNavPane",
     "DevExpress.XtraBars.TabFormControl",
     "DevExpress.XtraBars.FluentDesignSystem.FluentDesignFormControl",
     "DevExpress.XtraBars.ToolbarForm.ToolbarFormControl"});
     //
     // dpLogPanel
     //
     this.dpLogPanel.Controls.Add(this.dockPanel1_Container);
     this.dpLogPanel.Dock = DevExpress.XtraBars.Docking.DockingStyle.Bottom;
     this.dpLogPanel.ID = new System.Guid("10bbb36d-c4c6-4135-83c3-42595d23e751");
     this.dpLogPanel.Location = new System.Drawing.Point(0, 526);
     this.dpLogPanel.Name = "dpLogPanel";
     this.dpLogPanel.OriginalSize = new System.Drawing.Size(200, 441);
     this.dpLogPanel.SavedDock = DevExpress.XtraBars.Docking.DockingStyle.Bottom;
     this.dpLogPanel.SavedIndex = 0;
     this.dpLogPanel.Size = new System.Drawing.Size(1667, 441);
     this.dpLogPanel.Text = "Log";
     this.dpLogPanel.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden;
     //
     // dockPanel1_Container
     //
     this.dockPanel1_Container.Controls.Add(this.logMessagesControl);
     this.dockPanel1_Container.Location = new System.Drawing.Point(8, 51);
     this.dockPanel1_Container.Name = "dockPanel1_Container";
     this.dockPanel1_Container.Size = new System.Drawing.Size(1651, 382);
     this.dockPanel1_Container.TabIndex = 0;
     //
     // logMessagesControl
     //
     this.logMessagesControl.Dock = System.Windows.Forms.DockStyle.Fill;
     this.logMessagesControl.Location = new System.Drawing.Point(0, 0);
     this.logMessagesControl.Name = "logMessagesControl";
     this.logMessagesControl.Size = new System.Drawing.Size(1651, 382);
     this.logMessagesControl.TabIndex = 0;
     //
     // gridControl1
     //
     this.gridControl1.DataSource = this.strategyBaseBindingSource;
     this.gridControl1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.gridControl1.Location = new System.Drawing.Point(0, 60);
     this.gridControl1.MainView = this.gridView1;
     this.gridControl1.MenuManager = this.barManager1;
     this.gridControl1.Name = "gridControl1";
     this.gridControl1.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
     this.repositoryItemTextEdit1,
     this.repositoryItemCheckEdit1,
     this.repositoryItemCheckEdit2,
     this.repositoryItemCheckEdit3,
     this.riTextEditState});
     this.gridControl1.Size = new System.Drawing.Size(1667, 914);
     this.gridControl1.TabIndex = 4;
     this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
     this.gridView1});
     this.gridControl1.Click += new System.EventHandler(this.gridControl1_Click);
     //
     // strategyBaseBindingSource
     //
     this.strategyBaseBindingSource.DataSource = typeof(Crypto.Core.Strategies.StrategyBase);
     //
     // gridView1
     //
     this.gridView1.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
     this.colEnabled,
     this.colDemoMode,
     this.colDescription,
     this.colName,
     this.colStateText,
     this.colEarned,
     this.colEnableNotifications});
     this.gridView1.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFullFocus;
     this.gridView1.GridControl = this.gridControl1;
     this.gridView1.Name = "gridView1";
     this.gridView1.OptionsDetail.EnableMasterViewMode = false;
     this.gridView1.OptionsSelection.EnableAppearanceFocusedCell = false;
     this.gridView1.OptionsView.BestFitMode = DevExpress.XtraGrid.Views.Grid.GridBestFitMode.Full;
     this.gridView1.OptionsView.ShowHorizontalLines = DevExpress.Utils.DefaultBoolean.False;
     this.gridView1.OptionsView.ShowVerticalLines = DevExpress.Utils.DefaultBoolean.False;
     this.gridView1.RowStyle += new DevExpress.XtraGrid.Views.Grid.RowStyleEventHandler(this.gridView1_RowStyle);
     //
     // colEnabled
     //
     this.colEnabled.ColumnEdit = this.repositoryItemCheckEdit1;
     this.colEnabled.FieldName = "Enabled";
     this.colEnabled.MinWidth = 40;
     this.colEnabled.Name = "colEnabled";
     this.colEnabled.Visible = true;
     this.colEnabled.VisibleIndex = 0;
     this.colEnabled.Width = 160;
     //
     // repositoryItemCheckEdit1
     //
     this.repositoryItemCheckEdit1.AutoHeight = false;
     this.repositoryItemCheckEdit1.CheckBoxOptions.Style = DevExpress.XtraEditors.Controls.CheckBoxStyle.SvgToggle1;
     this.repositoryItemCheckEdit1.Name = "repositoryItemCheckEdit1";
     this.repositoryItemCheckEdit1.EditValueChanged += new System.EventHandler(this.repositoryItemCheckEdit1_EditValueChanged);
     //
     // colDemoMode
     //
     this.colDemoMode.ColumnEdit = this.repositoryItemCheckEdit2;
     this.colDemoMode.FieldName = "DemoMode";
     this.colDemoMode.MinWidth = 40;
     this.colDemoMode.Name = "colDemoMode";
     this.colDemoMode.Visible = true;
     this.colDemoMode.VisibleIndex = 1;
     this.colDemoMode.Width = 195;
     //
     // repositoryItemCheckEdit2
     //
     this.repositoryItemCheckEdit2.AutoHeight = false;
     this.repositoryItemCheckEdit2.CheckBoxOptions.Style = DevExpress.XtraEditors.Controls.CheckBoxStyle.SvgToggle1;
     this.repositoryItemCheckEdit2.Name = "repositoryItemCheckEdit2";
     this.repositoryItemCheckEdit2.EditValueChanged += new System.EventHandler(this.repositoryItemCheckEdit2_EditValueChanged);
     //
     // colDescription
     //
     this.colDescription.ColumnEdit = this.repositoryItemTextEdit1;
     this.colDescription.FieldName = "Description";
     this.colDescription.MinWidth = 40;
     this.colDescription.Name = "colDescription";
     this.colDescription.OptionsColumn.AllowEdit = false;
     this.colDescription.Width = 554;
     //
     // repositoryItemTextEdit1
     //
     this.repositoryItemTextEdit1.AutoHeight = false;
     this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1";
     this.repositoryItemTextEdit1.Padding = new System.Windows.Forms.Padding(0, 3, 0, 3);
     //
     // colName
     //
     this.colName.FieldName = "Name";
     this.colName.MinWidth = 40;
     this.colName.Name = "colName";
     this.colName.OptionsColumn.AllowEdit = false;
     this.colName.OptionsColumn.ReadOnly = true;
     this.colName.Visible = true;
     this.colName.VisibleIndex = 3;
     this.colName.Width = 361;
     //
     // colStateText
     //
     this.colStateText.ColumnEdit = this.riTextEditState;
     this.colStateText.FieldName = "StateText";
     this.colStateText.MinWidth = 40;
     this.colStateText.Name = "colStateText";
     this.colStateText.OptionsColumn.AllowEdit = false;
     this.colStateText.Visible = true;
     this.colStateText.VisibleIndex = 4;
     this.colStateText.Width = 366;
     //
     // riTextEditState
     //
     this.riTextEditState.AllowHtmlDraw = DevExpress.Utils.DefaultBoolean.True;
     this.riTextEditState.AutoHeight = false;
     this.riTextEditState.Name = "riTextEditState";
     //
     // colEarned
     //
     this.colEarned.DisplayFormat.FormatString = "0.0000000";
     this.colEarned.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.colEarned.FieldName = "Earned";
     this.colEarned.MinWidth = 40;
     this.colEarned.Name = "colEarned";
     this.colEarned.OptionsColumn.AllowEdit = false;
     this.colEarned.Visible = true;
     this.colEarned.VisibleIndex = 5;
     this.colEarned.Width = 412;
     //
     // colEnableNotifications
     //
     this.colEnableNotifications.Caption = "Notifications";
     this.colEnableNotifications.ColumnEdit = this.repositoryItemCheckEdit3;
     this.colEnableNotifications.FieldName = "EnableNotifications";
     this.colEnableNotifications.MinWidth = 40;
     this.colEnableNotifications.Name = "colEnableNotifications";
     this.colEnableNotifications.Visible = true;
     this.colEnableNotifications.VisibleIndex = 2;
     this.colEnableNotifications.Width = 137;
     //
     // repositoryItemCheckEdit3
     //
     this.repositoryItemCheckEdit3.AutoHeight = false;
     this.repositoryItemCheckEdit3.CheckBoxOptions.Style = DevExpress.XtraEditors.Controls.CheckBoxStyle.SvgToggle1;
     this.repositoryItemCheckEdit3.Name = "repositoryItemCheckEdit3";
     this.repositoryItemCheckEdit3.EditValueChanged += new System.EventHandler(this.repositoryItemCheckEdit3_EditValueChanged);
     //
     // toastNotificationsManager1
     //
     this.toastNotificationsManager1.ApplicationId = "ab6decea-81d2-4ad9-b8b7-45653fe59087";
     this.toastNotificationsManager1.Notifications.AddRange(new DevExpress.XtraBars.ToastNotifications.IToastNotificationProperties[] {
     new DevExpress.XtraBars.ToastNotifications.ToastNotification("404ef86f-183c-4fea-960b-86f54e52ea76", global::Crypto.UI.Properties.Resources.notification_image2, "Strategies Simulator", "Strategy simulation finished!", "", DevExpress.XtraBars.ToastNotifications.ToastNotificationSound.Default, DevExpress.XtraBars.ToastNotifications.ToastNotificationDuration.Long, DevExpress.XtraBars.ToastNotifications.ToastNotificationTemplate.ImageAndText01)});
     //
     // StrategiesCollectionForm
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(1667, 1026);
     this.Controls.Add(this.gridControl1);
     this.Controls.Add(this.barDockControlLeft);
     this.Controls.Add(this.barDockControlRight);
     this.Controls.Add(this.barDockControlBottom);
     this.Controls.Add(this.barDockControlTop);
     this.Name = "StrategiesCollectionForm";
     this.Text = "Active Strategies";
     ((System.ComponentModel.ISupportInitialize)(this.barManager1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemProgressBar1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dockManager1)).EndInit();
     this.dpLogPanel.ResumeLayout(false);
     this.dockPanel1_Container.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.gridControl1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.strategyBaseBindingSource)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemCheckEdit1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemCheckEdit2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.riTextEditState)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemCheckEdit3)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.behaviorManager1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.toastNotificationsManager1)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Beispiel #43
0
        void SetActiveBarItem(BarItem sharedBarItem, BarItem activeBarItem)
        {
            sharedBarItem.Tag = activeBarItem;
            BarCheckItem sharedBarCheckItem = sharedBarItem as BarCheckItem;
            BarEditItem  sharedBarEditItem  = sharedBarItem as BarEditItem;

            if (activeBarItem == null)
            {
                sharedBarItem.IsEnabled      = false;
                sharedBarItem.Content        = sharedBarItem.Content;
                sharedBarItem.Glyph          = sharedBarItem.Glyph;
                sharedBarItem.LargeGlyph     = sharedBarItem.LargeGlyph;
                sharedBarItem.Hint           = sharedBarItem.Hint;
                sharedBarItem.GlyphAlignment = sharedBarItem.GlyphAlignment;
                if (sharedBarEditItem != null)
                {
                    object editValue = sharedBarEditItem.EditValue;
                    BindingOperations.ClearBinding(sharedBarEditItem, BarEditItem.EditValueProperty);
                    sharedBarEditItem.EditValue = editValue;
                }
                if (sharedBarCheckItem != null)
                {
                    DepPropertyHelper.UnbindHard(sharedBarCheckItem, BarCheckItem.IsCheckedProperty);
                }
            }
            else
            {
                sharedBarItem.SetBinding(BarItem.IsEnabledProperty, new Binding("IsEnabled")
                {
                    Source = activeBarItem, Mode = BindingMode.OneWay
                });
                sharedBarItem.SetBinding(BarItem.ContentProperty, new Binding("Content")
                {
                    Source = activeBarItem, Mode = BindingMode.OneWay
                });
                sharedBarItem.SetBinding(BarItem.GlyphProperty, new Binding("Glyph")
                {
                    Source = activeBarItem, Mode = BindingMode.OneWay
                });
                sharedBarItem.SetBinding(BarItem.LargeGlyphProperty, new Binding("LargeGlyph")
                {
                    Source = activeBarItem, Mode = BindingMode.OneWay
                });
                sharedBarItem.SetBinding(BarItem.HintProperty, new Binding("Hint")
                {
                    Source = activeBarItem, Mode = BindingMode.OneWay
                });
                sharedBarItem.SetBinding(BarItem.GlyphAlignmentProperty, new Binding("GlyphAlignment")
                {
                    Source = activeBarItem, Mode = BindingMode.OneWay
                });
                if (sharedBarItem is BarEditItem)
                {
                    sharedBarItem.SetBinding(BarEditItem.EditValueProperty, new Binding("EditValue")
                    {
                        Source = activeBarItem, Mode = BindingMode.TwoWay, UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
                    });
                }
                if (sharedBarCheckItem != null)
                {
                    DepPropertyHelper.BindHard(sharedBarCheckItem, BarCheckItem.IsCheckedProperty, activeBarItem, BarCheckItem.IsCheckedProperty);
                }
            }
        }
        private void bsEvents_GetItemData(object sender, EventArgs e)
        {
            if (this.bsEvents.ItemLinks.Count > 0 || Visual == null)
            {
                return;
            }
            List <StrategyDataItemInfo> aItems = Visual.DataItemInfos.Where(i => i.ChartType == ChartType.Annotation).ToList();

            foreach (StrategyDataItemInfo info in aItems)
            {
                PropertyInfo            pInfo        = Visual.Items[0].GetType().GetProperty(info.FieldName, BindingFlags.Instance | BindingFlags.Public);
                List <AnnotationFilter> filterValues = new List <AnnotationFilter>();
                FilterValues = filterValues;
                for (int i = 0; i < Visual.Items.Count; i++)
                {
                    object value = pInfo.GetValue(Visual.Items[i]);
                    if (value == null)
                    {
                        continue;
                    }

                    if (info.Type == DataType.ListInString && value is string)
                    {
                        string   list  = (string)value;
                        string[] items = list.Split(',');
                        foreach (string item in items)
                        {
                            string timmed = item.Trim();
                            if (filterValues.FirstOrDefault(f => object.Equals(f.Value, timmed)) == null)
                            {
                                filterValues.Add(new AnnotationFilter()
                                {
                                    Value = timmed, Property = pInfo, StringListItem = true, Checked = true
                                });
                            }
                        }
                    }
                    else
                    {
                        if (filterValues.FirstOrDefault(f => object.Equals(f.Value, value)) == null)
                        {
                            filterValues.Add(new AnnotationFilter()
                            {
                                Value = value, Property = pInfo, Checked = true
                            });
                        }
                    }
                }
                if (filterValues.Count == 0)
                {
                    continue;
                }

                BarHeaderItem subMenu = new BarHeaderItem();
                this.barManager1.Items.Add(subMenu);
                subMenu.Caption = info.FieldName;
                this.bsEvents.ItemLinks.Add(subMenu);

                foreach (AnnotationFilter value in filterValues)
                {
                    BarCheckItem ch = new BarCheckItem(this.barManager1)
                    {
                        Caption = Convert.ToString(value.Value), Checked = true
                    };
                    ch.AllowStubGlyph      = DefaultBoolean.False;
                    ch.CloseSubMenuOnClick = false;
                    ch.Tag             = value;
                    ch.CheckedChanged += AnnotationFilterItemChecked;
                    this.bsEvents.ItemLinks.Add(ch);
                }
            }
        }
        //Improve, cant accept negative in new sales and shouldnt pay more than already payed when editing
        public void SaveDailySalesRecord(LookUpEdit customer, string customerID, string car, LookUpEdit regNum, LookUpEdit servType, TextEdit amount, TextEdit allPayments, DateEdit dateCreated, MemoEdit remarks, string carServTable, string cusPurchaseTable, bool canWrite, BarCheckItem editing, int currentRow, GridView gv, DashboardViewer dbv)
        {
            // gv.CloseEditor();
            // gv.UpdateCurrentRow();
            //  gv.UpdateTotalSummary();
            if (!editing.Checked && !canWrite)
            {
                XtraMessageBox.Show("You dont Have Write Access, Contact Admin", "You cant write", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (customer.EditValue == null)
            {
                XtraMessageBox.Show("Select a Customer from the Customer Drop down list ", "Specify a Car", MessageBoxButtons.OK, MessageBoxIcon.Information);
                customer.Focus();
                return;
            }
            if (regNum.EditValue == null)
            {
                XtraMessageBox.Show("Select a Car from the Car Drop down list ", "Specify a Car", MessageBoxButtons.OK, MessageBoxIcon.Information);
                regNum.Focus();
                return;
            }
            if (servType.EditValue == null)
            {
                XtraMessageBox.Show("Select a Service Type from the Service Type Drop down list ", "Specify a Service Type", MessageBoxButtons.OK, MessageBoxIcon.Information);
                servType.Focus();
                return;
            }


            //if (decimal.Parse(prevAmount.EditValue.ToString()) < 0)
            //{
            //    XtraMessageBox.Show("You cant make negative payments ", "No negative payments allowed", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //    prevAmount.Focus();
            //    return;
            //}
            int count = 0;

            foreach (Tuple <bool, int, double, double> values in CustomerPurchaseData.Values)
            {
                if (values.Item1)
                {
                    count++;
                }
            }
            if (count == 0)
            {
                XtraMessageBox.Show("No Product Or service Was selected for this customer,You Want ot go ahead and still Save ?", "No Product selected For Customer", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                return;
            }
            Setup.comm = new SqlCommand();
            Setup.comm.Parameters.Add(new SqlParameter("@CusID", customer.EditValue));
            Setup.comm.Parameters.Add(new SqlParameter("@CarID", regNum.EditValue));
            Setup.comm.Parameters.Add(new SqlParameter("@ServTypeID", servType.EditValue));
            Setup.comm.Parameters.Add(new SqlParameter("@Amount", amount.EditValue));
            Setup.comm.Parameters.Add(new SqlParameter("@Quantity", 1));
            Setup.comm.Parameters.Add(new SqlParameter("@ProductID", 1));

            Setup.comm.Parameters.Add(new SqlParameter("@Discount", 1));
            Setup.comm.Parameters.Add(new SqlParameter("@Remarks", remarks.Text));
            Setup.comm.Parameters.Add(new SqlParameter("@DateCreated", dateCreated.DateTime));

            try
            {
                using (Setup.connx = new SqlConnection(Setup.connString))
                {
                    Setup.connx.Open();
                    if (!Setup.mode[6])
                    {
                        decimal amnt = (decimal)amount.EditValue;
                        if (amnt < 0)
                        {
                            XtraMessageBox.Show("You cant make negative payments ", "No negative payments allowed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            amount.Focus();
                            return;
                        }
                        if (amnt > Setup.sumOfSelectedItems)
                        {
                            amnt = Setup.sumOfSelectedItems;
                            Setup.comm.Parameters["@Amount"].Value = amnt;
                            //XtraMessageBox.Show("Amount entered is greater than amount due for payment ", "Customer Payment greater than Amount Due", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            //amount.Focus();
                            //return;
                        }


                        Setup.comm.CommandText = "select csCusID from etblCarService where csCusID=@CusID and CAST(csDateCreated as DATE)=CAST(@DateCreated as Date)";
                        Setup.comm.Connection  = Setup.connx;
                        Setup.reader           = Setup.comm.ExecuteReader();
                        while (Setup.reader.Read())
                        {
                            if (XtraMessageBox.Show(customer.Text + " Car has already been serviced today, you sure u wanna add another transaction!", "This Customer has been already been today", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No)
                            {
                                return;
                            }
                        }
                        Setup.reader.Close();
                        Setup.comm.Parameters.Add(new SqlParameter("@CreatorID", Setup.userID));
                        Setup.comm.Parameters.Add(new SqlParameter("@CreatedDate", DateTime.Now));

                        //Save customer Details
                        Setup.comm.CommandText = "Insert into etblCarService (csCusID,csStID,csCcID,csremarks,csDateCreated,csCreatorID,csCreatedDate) values(@CusID,@CarID,@ServTypeID,@remarks,@DateCreated,@creatorID,@createdDate);select scope_identity()";
                        Setup.primaryKey       = Convert.ToInt32(Setup.comm.ExecuteScalar());
                        Setup.dataSet.Tables[carServTable].Rows.Add(Setup.primaryKey, customer.EditValue, customer.Text, customerID, car, regNum.Text, servType.Text, remarks.Text, dateCreated.DateTime, Setup.sumOfSelectedItems, amnt, Setup.sumOfSelectedItems - amnt, Setup.UserName);
                        bool added = false;

                        Setup.comm.Parameters.Add(new SqlParameter("@csID", Setup.primaryKey));
                        //Save Customer Purchases
                        Setup.reader.Close();
                        Setup.comm.CommandText = "Insert into etblCustomerPurchase(cpCsID,cpPpID,cpQuantity,cpDiscount) values(@CsID,@ProductID,@Quantity,@Discount)";
                        foreach (int row in CustomerPurchaseData.Keys)
                        {
                            added = CustomerPurchaseData[row].Item1;
                            if (added)
                            {
                                Setup.comm.Parameters["@ProductID"].Value = Setup.dataSet.Tables[cusPurchaseTable].Rows[row].ItemArray[0];
                                Setup.comm.Parameters["@Quantity"].Value  = CustomerPurchaseData[row].Item2;

                                Setup.comm.Parameters["@Discount"].Value = CustomerPurchaseData[row].Item3;
                                Setup.comm.ExecuteNonQuery();
                            }
                        }

                        //Save customer Payments
                        Setup.comm.CommandText = "Insert into etblCustomerPayments(cuspaycsID,cuspayAmount,cusPayDateCreated,cusPayCreatorID,cusPayCreatedDate) values(@csID,@Amount,@DateCreated,@CreatorID,@CreatedDate)";
                        Setup.comm.ExecuteNonQuery();

                        XtraMessageBox.Show(customer.Text + " Saved Sussusfully", "Transaction Saved", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        decimal totalPaid   = Convert.ToDecimal(Setup.dataSet.Tables[carServTable].Rows[currentRow].ItemArray[10]);
                        decimal prevAmntDue = Convert.ToDecimal(Setup.dataSet.Tables[carServTable].Rows[currentRow].ItemArray[9]);
                        decimal amnt        = (decimal)amount.EditValue;
                        decimal payments    = totalPaid + amnt;
                        decimal change      = payments - Setup.sumOfSelectedItems;


                        if ((amnt < 0) && Setup.sumOfSelectedItems < payments)
                        {
                            XtraMessageBox.Show("Negative amount only means refund of money to customers and as such, it is expected that Change after refund be zero", "Change after a refund Incorrect", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            amount.Focus();
                            return;
                        }

                        if (payments < 0)
                        {
                            XtraMessageBox.Show("You cant refund below amount customer has already paid", "Refund is Ambigious", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            amount.Focus();
                            return;
                        }

                        if (payments > Setup.sumOfSelectedItems)
                        {
                            if ((amnt - change) >= 0)
                            {
                                amnt -= change;
                                Setup.comm.Parameters["@Amount"].Value = amnt;
                            }
                            else
                            {
                                XtraMessageBox.Show("Change to give Customer is greater than amount customer paid, Enter negative values in case of a refund", "Customer Change is Ambigious", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                amount.Focus();
                                return;
                            }
                        }
                        Setup.comm.Parameters.Add(new SqlParameter("@EditorID", Setup.userID));
                        Setup.comm.Parameters.Add(new SqlParameter("@EditedDate", DateTime.Now));
                        Setup.comm.Parameters.Add(new SqlParameter("@ID", Setup.dataSet.Tables[carServTable].Rows[currentRow].ItemArray[0]));

                        Setup.comm.Parameters.Add(new SqlParameter("@UserName", Setup.dataSet.Tables[carServTable].Rows[currentRow].ItemArray[12]));
                        Setup.comm.CommandText = "select csCusID from etblCarService where csCusID=@CusID and CAST(csDateCreated as DATE)=CAST(@DateCreated as Date) and csID!=@ID";
                        Setup.comm.Connection  = Setup.connx;
                        Setup.reader           = Setup.comm.ExecuteReader();
                        while (Setup.reader.Read())
                        {
                            if (XtraMessageBox.Show(customer.Text + " Car has already been serviced today, you sure u wanna add another transaction!", "This Customer has been already been today", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.No)
                            {
                                return;
                            }
                        }
                        Setup.reader.Close();
                        Setup.comm.CommandText = "Update etblCarService set csCusID=@CusID,csStID=@ServTypeID,csCcID=@CarID,csremarks=@remarks,csEditorID=@EditorID,csEditedDate=@EditedDate where csID=@ID";
                        Setup.comm.ExecuteNonQuery();
                        allPayments.EditValue = totalPaid + amnt;
                        Setup.dataSet.Tables[carServTable].Rows[currentRow].ItemArray = new object[] { Setup.comm.Parameters["@ID"].Value, customer.EditValue, customer.Text, customerID, car, regNum.Text, servType.Text, remarks.Text, dateCreated.DateTime, Setup.sumOfSelectedItems, totalPaid + amnt, (Setup.sumOfSelectedItems - (totalPaid + amnt)), Setup.comm.Parameters["@Username"].Value };

                        //Delete previous purchases
                        Setup.comm.CommandText = "Delete from etblCustomerPurchase where cpCsID=@ID";
                        Setup.comm.ExecuteNonQuery();
                        bool added = false;

                        //Save Customer Purchases

                        Setup.comm.CommandText = "Insert into etblCustomerPurchase(cpCsID,cpPpID,cpQuantity,cpDiscount) values(@ID,@ProductID,@Quantity,@Discount)";
                        foreach (int row in CustomerPurchaseData.Keys)
                        {
                            added = CustomerPurchaseData[row].Item1;
                            if (added)
                            {
                                Setup.comm.Parameters["@ProductID"].Value = Setup.dataSet.Tables[cusPurchaseTable].Rows[row].ItemArray[0];
                                Setup.comm.Parameters["@Quantity"].Value  = CustomerPurchaseData[row].Item2;

                                Setup.comm.Parameters["@Discount"].Value = CustomerPurchaseData[row].Item3;
                                Setup.comm.ExecuteNonQuery();
                            }
                        }

                        //Add new Customer Payments if any
                        if (amnt != 0)
                        {
                            Setup.comm.CommandText = "Insert into etblCustomerPayments(cuspaycsID,cuspayAmount,cusPayDateCreated,cusPayCreatorID,cusPayCreatedDate) values(@ID,@Amount,@DateCreated,@EditorID,@EditedDate);select scope_identity()";
                            Setup.comm.ExecuteNonQuery();
                        }
                        amount.EditValue = default(decimal);
                        XtraMessageBox.Show(customer.Text + " Updated Sussusfully", "Car Servicing Saved", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        //Report a refund
                        if (amnt < 0 || Setup.sumOfSelectedItems < prevAmntDue)
                        {
                            Setup.comm.Parameters.Add(new SqlParameter("@Type", amnt < 0 ? "MONEY" : "PRODUCT OR SERVICE"));
                            Setup.comm.Parameters.Add(new SqlParameter("@rfdAmount", amnt < 0 ? Math.Abs(amnt) :prevAmntDue - Setup.sumOfSelectedItems));
                            Setup.comm.CommandText = "Insert into etblRefunds(rfdAmount,rfdCusID,rfdType,rfdDateCreated,rfdCreatorID) values(@rfdAmount,@CusID,@Type,@EditedDate,@EditorID)";
                            Setup.comm.ExecuteNonQuery();
                        }
                    }
                    //amountRecieved.EditValue = default(decimal);


                    //Load Invoice

                    Cursor.Current = Cursors.AppStarting;
                    if (dbv.Dashboard != null)
                    {
                        dbv.ReloadData();
                    }
                    PrintSingle = true;
                    report      = new UmitechXtraReport();
                    report.Parameters[0].Visible = false;
                    report.Parameters[0].Value   = customer.EditValue;
                    printTool = new ReportPrintTool(report);
                    printTool.ShowRibbonPreviewDialog();
                    PrintSingle    = false;
                    Cursor.Current = Cursors.Default;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("OOPs! cud not connect to server now Contact HR\r\n" + ex.Message, "Notification", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Beispiel #46
0
        /// <summary>
        /// 初始化速查字段
        /// </summary>
        /// <param name="queryConfig"></param>
        private void InitQuickQueryFields(QueryConfig queryConfig)
        {
            foreach (var item in queryConfig.QuickQuery.QueryFields)
            {
                var bbi = new BarCheckItem(bmQueryControl, item.IsDefault);
                bbi.GroupIndex = 1;
                bbi.Name = "bbiFields_" + Guid.NewGuid().ToString("N");
                bbi.Caption = item.Caption;
                bbi.Tag = item.FieldName;
                string nullText = "按 \"{0}\" 进行查询".FormatWith(item.Caption);
                if (item.IsDefault)
                {
                    this.txtSearchText.Properties.NullText = nullText;
                    this.txtSearchText.ToolTip = nullText;
                    this.btnQuery.ToolTip = nullText;
                    this.txtSearchText.Tag = item.FieldName;
                }

                bbi.ItemClick += (sender, args) =>
                {
                    this.txtSearchText.Properties.NullText = nullText;
                    this.txtSearchText.ToolTip = nullText;
                    this.btnQuery.ToolTip = nullText;
                    this.txtSearchText.Tag = args.Item.Tag;
                };
                this.popQucikFields.AddItem(bbi);
            }
        }
        public void SaveEmployeeRecord(TextEdit fname, TextEdit lname, TextEdit oname, DateEdit DOB, PictureEdit image, LookUpEdit gender, LookUpEdit title, LookUpEdit mStatus, LookUpEdit country, LookUpEdit region, LookUpEdit town,
                                       TextEdit phone, TextEdit address, TextEdit email, TextEdit staffID, LookUpEdit qualification, LookUpEdit empType, LookUpEdit jobType, DateEdit startDate, DateEdit endDate, MemoEdit remarks, DateEdit dateCreated, CheckEdit status, string tableName, bool canWrite, BarCheckItem editing, int currentRow, GridControl users)
        {
            if (!editing.Checked && !canWrite)
            {
                XtraMessageBox.Show("You dont Have Write Access, Contact Admin", "You cant write", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (string.IsNullOrWhiteSpace(fname.Text))
            {
                XtraMessageBox.Show("First Name Required", "Specify Staff First Name", MessageBoxButtons.OK, MessageBoxIcon.Information);
                fname.Focus();
                return;
            }
            if (string.IsNullOrWhiteSpace(lname.Text))
            {
                XtraMessageBox.Show("Last Name Required", "Specify Staff Last Name", MessageBoxButtons.OK, MessageBoxIcon.Information);
                lname.Focus();
                return;
            }
            if (image.Image == null)
            {
                XtraMessageBox.Show("Right Click the image Box to load an image", "Specify Staff image", MessageBoxButtons.OK, MessageBoxIcon.Information);
                image.Focus();
                return;
            }

            byte[] imgByte = (byte[])Setup.imgConverter.ConvertTo(image.Image, typeof(byte[]));
            if (gender.EditValue == null)
            {
                XtraMessageBox.Show("Select a Gender ", "Specify Staff Gender", MessageBoxButtons.OK, MessageBoxIcon.Information);
                gender.Focus();
                return;
            }
            if (title.EditValue == null)
            {
                XtraMessageBox.Show("Select a Title ", "Specify Staff Title", MessageBoxButtons.OK, MessageBoxIcon.Information);
                title.Focus();
                return;
            }
            if (mStatus.EditValue == null)
            {
                XtraMessageBox.Show("Select a Marital Status ", "Specify Staff Marital Status", MessageBoxButtons.OK, MessageBoxIcon.Information);
                mStatus.Focus();
                return;
            }
            if (town.EditValue == null)
            {
                XtraMessageBox.Show("Select a Town from the Town drop down list ", "Specify Staff Town", MessageBoxButtons.OK, MessageBoxIcon.Information);
                town.Focus();
                return;
            }
            if (string.IsNullOrWhiteSpace(phone.Text))
            {
                XtraMessageBox.Show("Enter Staff's Phone number ", "Phone Number Required", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            string[] numbers  = phone.Text.Split(',');
            int      phoneNum = 0;

            foreach (string num in numbers)
            {
                if (!int.TryParse(num, out phoneNum))
                {
                    XtraMessageBox.Show("Separate each phone number with a comma if more than 1", "Phone number not in right format", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    phone.Focus();
                    return;
                }
            }
            if (string.IsNullOrWhiteSpace(email.Text))
            {
                XtraMessageBox.Show("Email Required", "Specify Staff Email", MessageBoxButtons.OK, MessageBoxIcon.Information);
                email.Focus();
                return;
            }
            if (qualification.EditValue == null)
            {
                XtraMessageBox.Show("Select a qualification from the qualification Drop down ", "Specify Staff Qualification", MessageBoxButtons.OK, MessageBoxIcon.Information);
                qualification.Focus();
                return;
            }
            if (empType.EditValue == null)
            {
                XtraMessageBox.Show("Select an Employee Type from the employee type drop down ", "Specify Staff Employee Type", MessageBoxButtons.OK, MessageBoxIcon.Information);
                empType.Focus();
                return;
            }
            if (jobType.EditValue == null)
            {
                XtraMessageBox.Show("Select a Job Type from the job type drop down ", "Specify Staff Job Type", MessageBoxButtons.OK, MessageBoxIcon.Information);
                jobType.Focus();
                return;
            }


            Setup.comm = new SqlCommand();
            Setup.comm.Parameters.Add(new SqlParameter("@FName", fname.Text));
            Setup.comm.Parameters.Add(new SqlParameter("@LName", lname.Text));
            Setup.comm.Parameters.Add(new SqlParameter("@OName", oname.Text));
            Setup.comm.Parameters.Add(new SqlParameter("@DOB", DOB.DateTime));
            Setup.comm.Parameters.Add(new SqlParameter("@Image", imgByte));
            Setup.comm.Parameters.Add(new SqlParameter("@Gender", gender.EditValue));
            Setup.comm.Parameters.Add(new SqlParameter("@Title", title.EditValue));
            Setup.comm.Parameters.Add(new SqlParameter("@MStatus", mStatus.EditValue));
            Setup.comm.Parameters.Add(new SqlParameter("@Town", town.EditValue));
            Setup.comm.Parameters.Add(new SqlParameter("@Phone", phone.Text));
            Setup.comm.Parameters.Add(new SqlParameter("@Address", address.Text));
            Setup.comm.Parameters.Add(new SqlParameter("@Email", email.Text));
            Setup.comm.Parameters.Add(new SqlParameter("@StaffID", staffID.Text));
            Setup.comm.Parameters.Add(new SqlParameter("@QID", qualification.EditValue));
            Setup.comm.Parameters.Add(new SqlParameter("@EmpType", empType.EditValue));
            Setup.comm.Parameters.Add(new SqlParameter("@JobType", jobType.EditValue));
            Setup.comm.Parameters.Add(new SqlParameter("@StartDate", startDate.DateTime));
            Setup.comm.Parameters.Add(new SqlParameter("@EndDate", endDate.DateTime));
            Setup.comm.Parameters.Add(new SqlParameter("@Password", staffID.Text));
            Setup.comm.Parameters.Add(new SqlParameter("@Remarks", remarks.Text));
            Setup.comm.Parameters.Add(new SqlParameter("@DateCreated", dateCreated.DateTime));
            Setup.comm.Parameters.Add(new SqlParameter("@Status", status.Checked));

            try
            {
                using (Setup.connx = new SqlConnection(Setup.connString))
                {
                    Setup.connx.Open();
                    if (!Setup.mode[9])
                    {
                        staffID.Text = char.ToUpperInvariant(lname.Text[0]).ToString() + char.ToUpperInvariant(fname.Text[0]).ToString() + numbers[0];
                        Setup.comm.Parameters["@StaffID"].Value = staffID.Text;
                        Setup.comm.CommandText = "select sfID from etblEmployee where sfStaffID=@StaffID";
                        Setup.comm.Connection  = Setup.connx;
                        Setup.reader           = Setup.comm.ExecuteReader();
                        while (Setup.reader.Read())
                        {
                            XtraMessageBox.Show(fname.Text + " exist!", "This Staff Exist", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            return;
                        }
                        Setup.reader.Close();
                        Setup.comm.Parameters.Add(new SqlParameter("@CreatorID", 1));
                        Setup.comm.Parameters.Add(new SqlParameter("@CreatedDate", DateTime.Now));
                        Setup.comm.CommandText = "Insert into etblEmployee (sffname,sflname,sfoname,sfDOB,sfImage,sfGID,sfTID,sfMSID,sfTwnID,sfPhone,sfAddress,sfEmail,sfStaffID,sfPassword,sfQID,sfETID,sfJTID,sfStartDate,sfEndDate,sfremarks,sfDateCreated,sfstatus,sfCreatorID,sfCreatedDate) values(@fname,@lname,@oname,@DOB,@image,@Gender,@Title,@MStatus,@Town,@Phone,@Address,@Email,@StaffID,@Password,@QID,@EmpType,@JobType,@startDate,@EndDate,@remarks,@DateCreated,@status,@creatorID,@createdDate);select scope_identity()";
                        Setup.primaryKey       = Convert.ToInt32(Setup.comm.ExecuteScalar());
                        Setup.dataSet.Tables[tableName].Rows.Add(Setup.primaryKey, fname.Text, lname.Text, oname.Text, DOB.DateTime, imgByte, gender.Text, title.Text, mStatus.Text, country.Text, region.Text, town.Text, phone.Text, address.Text, email.Text, staffID.Text, staffID.Text, qualification.Text, empType.Text, jobType.Text, startDate.DateTime, endDate.DateTime, remarks.Text, dateCreated.DateTime, status.Checked, Setup.UserName, Setup.UserName);
                        XtraMessageBox.Show(fname.Text + " Saved Sussusfully", "Staff Saved", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        Setup.comm.Parameters.Add(new SqlParameter("@EditorID", 1));
                        Setup.comm.Parameters.Add(new SqlParameter("@EditedDate", DateTime.Now));
                        Setup.comm.Parameters.Add(new SqlParameter("@ID", Setup.dataSet.Tables[tableName].Rows[currentRow].ItemArray[0]));

                        Setup.comm.Parameters.Add(new SqlParameter("@UserName", Setup.dataSet.Tables[tableName].Rows[currentRow].ItemArray[26]));
                        Setup.comm.CommandText = "select sfID from etblEmployee where sfStaffID=@StaffID and sfID !=@ID";
                        Setup.comm.Connection  = Setup.connx;
                        Setup.reader           = Setup.comm.ExecuteReader();
                        while (Setup.reader.Read())
                        {
                            XtraMessageBox.Show(fname.Text + " exist!", "This Staff Exist", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            return;
                        }
                        Setup.reader.Close();
                        Setup.comm.CommandText = "Update etblEmployee set sffname=@fname, sflname=@lname,sfoname=@oname,sfDOB=@DOB,sfImage=@Image,sfGID=@Gender,sfTID=@Title,sfMSID=@MStatus,sfTwnID=@Town,sfPhone=@Phone,sfAddress=@Address,sfEmail=@Email,sfQID=@QID,sfETID=@EmpType,sfJTID=@JobType,sfStartDate=@StartDate,sfEndDate=@EndDate,sfremarks=@remarks,sfStatus=@status,sfEditorID=@EditorID,sfEditedDate=@EditedDate where sfID=@ID";
                        Setup.comm.ExecuteNonQuery();
                        Setup.dataSet.Tables[tableName].Rows[currentRow].ItemArray = new object[] { Setup.comm.Parameters["@ID"].Value, fname.Text, lname.Text, oname.Text, DOB.DateTime, imgByte, gender.Text, title.Text, mStatus.Text, country.Text, region.Text, town.Text, phone.Text, address.Text, email.Text, staffID.Text, Setup.comm.Parameters[16].Value, qualification.Text, empType.Text, jobType.Text, startDate.DateTime, endDate.DateTime, remarks.Text, dateCreated.DateTime, status.Checked, Setup.comm.Parameters["@Username"].Value, Setup.comm.Parameters["@Username"].Value };

                        XtraMessageBox.Show(fname.Text + " Updated Sussusfully", "Staff Updated", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    users.DataSource = null;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("OOPs! cud not connect to server now Contact HR\r\n" + ex.Message, "Notification", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Beispiel #48
0
 void CreateAppearancesMenu()
 {
     miAppearances = new BarSubItem(this.manager, "&Appearances");
     ChartControl chart = new ChartControl();
     string[] appearanceNames = chart.GetAppearanceNames();
     int naturalColorIndex = 0;
     for (int i = 0; i < appearanceNames.Length; i++)
     {
         BarItem miAppearanceName = new BarCheckItem(this.manager);
         miAppearanceName.Caption = appearanceNames[i];
         if (appearanceNames[i] == "Nature Colors")
             naturalColorIndex = i;
         //miAppearanceName.ItemClick += new ItemClickEventHandler(this.miAppearanceName_Click);
         miAppearances.ItemLinks.Add(miAppearanceName);
     }
     chart.Dispose();
     if (appearanceNames.Length > 0)
     {
         BarCheckItem item = miAppearances.ItemLinks[naturalColorIndex].Item as BarCheckItem;
         if (miAppearances != null)
         {
             //miAppearanceName_Click(this.manager, new ItemClickEventArgs(item, null));
             item.Checked = true;
         }
     }
 }