Example #1
0
        private void FormEtrans835Edit_Load(object sender, EventArgs e)
        {
            if (_form835 != null && !_form835.IsDisposed)
            {
                if (!MsgBox.Show(this, true, "Opening another ERA will close the current ERA you already have open.  Continue?"))
                {
                    //Form already exists and user wants to keep current instance.
                    TranSetId835   = _form835.TranSetId835;
                    EtransCur      = _form835.EtransCur;
                    MessageText835 = _form835.MessageText835;
                }
                _form835.Close();     //Always close old form and open new form, so the new copy will come to front, since BringToFront() does not always work.
            }
            _form835 = this;          //Set the static variable to this form because we're always going to show this form even if they're viewing old information.
            List <Etrans835Attach> listAttached = Etrans835Attaches.GetForEtrans(EtransCur.EtransNum);

            _x835 = new X835(EtransCur, MessageText835, TranSetId835, listAttached);
            RefreshFromDb();
            FillAll();
            Menu.MenuItemCollection menuItemCollection = new Menu.MenuItemCollection(gridClaimDetailsMenu);
            List <MenuItem>         listMenuItems      = new List <MenuItem>();

            listMenuItems.Add(new MenuItem(Lan.g(this, "Go to Account"), new EventHandler(gridClaimDetails_RightClickHelper)));
            listMenuItems.Add(new MenuItem(Lan.g(this, "Add Tracking Status"), new EventHandler(gridClaimDetails_RightClickHelper)));          //Enabled by default
            menuItemCollection.AddRange(listMenuItems.ToArray());
            gridClaimDetails.ContextMenu          = gridClaimDetailsMenu;
            gridClaimDetails.AllowSortingByColumn = true;
        }