Beispiel #1
0
 private void LoadGrid(Enumeration.EnumViews.Main mainView)
 {
     this.SuspendLayout();
     bool noGrid = false;
     try
     {
         if (mainMDI != null)
         {
             this.Controls.Remove(mainMDI);
             mainMDI = null;
         }
         switch ((Enumeration.EnumViews.Main)mainView)
         {
             case Enumeration.EnumViews.Main.Task:
                 mainMDI = new Task.Tasks();
                 break;
             case Enumeration.EnumViews.Main.Customer:
                 mainMDI = new Customer.Customers();
                 break;
             case Enumeration.EnumViews.Main.Supplier:
                 mainMDI = new Supplier.Suppliers();
                 break;
             case Enumeration.EnumViews.Main.Costing:
                 mainMDI = new Costing.Costing();
                 break;
             case Enumeration.EnumViews.Main.Employee:
                 mainMDI = new Employee.Employees();
                 break;
             case Enumeration.EnumViews.Main.Vehicle:
                 mainMDI = new Vehicle.Vehicles();
                 break;
             case Enumeration.EnumViews.Main.Fuel:
                 mainMDI = new Fuel.Fuel();
                 break;
             case Enumeration.EnumViews.Main.Material:
                 mainMDI = new Material.Materials();
                 break;
             case Enumeration.EnumViews.Main.MaterialCategory:
                 mainMDI = new Material.MaterialCategories();
                 break;
             case Enumeration.EnumViews.Main.Popup:
                 mainMDI = new Popup.Popups();
                 break;
             case Enumeration.EnumViews.Main.Document:
                 mainMDI = new Document.Document();
                 break;
             case Enumeration.EnumViews.Main.BoardComputer:
                 mainMDI = new Vehicle.BoardComputers();
                 break;
             case Enumeration.EnumViews.Main.Planning:
                 mainMDI = new Planning.Planning();
                 break;
             default:
                 noGrid = true;
                 break;
         }
         if (noGrid == false)
         {
             mainMDI.Tag = (Enumeration.EnumViews.Application)mainView;
             mainMDI.Location = new System.Drawing.Point(2, 150);
             mainMDI.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                 | System.Windows.Forms.AnchorStyles.Left)
                 | System.Windows.Forms.AnchorStyles.Right)));
             mainMDI.Size = new System.Drawing.Size(this.Size.Width - 15, this.Size.Height - 175);
             this.Controls.Add(mainMDI);
         }
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         this.ResumeLayout();
     }
 }
Beispiel #2
0
        private void LoadGrid(Enumeration.EnumViews.Main mainView)
        {
            this.SuspendLayout();
            bool noGrid = false;

            try
            {
                if (mainMDI != null)
                {
                    this.Controls.Remove(mainMDI);
                    mainMDI = null;
                }
                switch ((Enumeration.EnumViews.Main)mainView)
                {
                case Enumeration.EnumViews.Main.Task:
                    mainMDI = new Task.Tasks();
                    break;

                case Enumeration.EnumViews.Main.Customer:
                    mainMDI = new Customer.Customers();
                    break;

                case Enumeration.EnumViews.Main.Supplier:
                    mainMDI = new Supplier.Suppliers();
                    break;

                case Enumeration.EnumViews.Main.Costing:
                    mainMDI = new Costing.Costing();
                    break;

                case Enumeration.EnumViews.Main.Employee:
                    mainMDI = new Employee.Employees();
                    break;

                case Enumeration.EnumViews.Main.Vehicle:
                    mainMDI = new Vehicle.Vehicles();
                    break;

                case Enumeration.EnumViews.Main.Fuel:
                    mainMDI = new Fuel.Fuel();
                    break;

                case Enumeration.EnumViews.Main.Material:
                    mainMDI = new Material.Materials();
                    break;

                case Enumeration.EnumViews.Main.MaterialCategory:
                    mainMDI = new Material.MaterialCategories();
                    break;

                case Enumeration.EnumViews.Main.Popup:
                    mainMDI = new Popup.Popups();
                    break;

                case Enumeration.EnumViews.Main.Document:
                    mainMDI = new Document.Document();
                    break;

                case Enumeration.EnumViews.Main.BoardComputer:
                    mainMDI = new Vehicle.BoardComputers();
                    break;

                case Enumeration.EnumViews.Main.Planning:
                    mainMDI = new Planning.Planning();
                    break;

                default:
                    noGrid = true;
                    break;
                }
                if (noGrid == false)
                {
                    mainMDI.Tag      = (Enumeration.EnumViews.Application)mainView;
                    mainMDI.Location = new System.Drawing.Point(2, 150);
                    mainMDI.Anchor   = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                              | System.Windows.Forms.AnchorStyles.Left)
                                                                             | System.Windows.Forms.AnchorStyles.Right)));
                    mainMDI.Size = new System.Drawing.Size(this.Size.Width - 15, this.Size.Height - 175);
                    this.Controls.Add(mainMDI);
                }
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            finally
            {
                this.ResumeLayout();
            }
        }