Пример #1
0
        public void Tab_Control_Add(DataTable Access, MainProgram mainProgram, Action action, SummaryDetails summaryDetails, Admin admin, Data_Import ImportData)
        {
            Person = Access.Rows[0];

            Users User = Users.Singleton();

            //
            // Tab_Action
            //
            if (User.ActionTab)
            {
                TabPage tab_Action = new TabPage();
                mainProgram.TabControl.Controls.Add(tab_Action);
                tab_Action.Location = new System.Drawing.Point(4, 22);
                tab_Action.Name     = "tab_Action";
                tab_Action.Padding  = new Padding(3);
                tab_Action.Size     = new System.Drawing.Size(1826, 877);
                tab_Action.TabIndex = 0;
                tab_Action.Text     = "Action";
                tab_Action.UseVisualStyleBackColor = true;

                //Tab_Action_Comp();
                _ = new ActionForm(action);
                action.Action_NoChangeInAction();
            }
            //
            // tab_SummaryDetail
            //
            if (User.SummaryTab)
            {
                TabPage tab_SummaryDetail = new TabPage
                {
                    Location = new System.Drawing.Point(4, 22),
                    Name     = "tab_Summary",
                    Size     = new System.Drawing.Size(1826, 877),
                    TabIndex = 1,
                    Text     = "Summary Detail",
                    UseVisualStyleBackColor = true
                };

                mainProgram.TabControl.Controls.Add(tab_SummaryDetail);

                TabPage tab_Summary = new TabPage
                {
                    Location = new System.Drawing.Point(4, 22),
                    Name     = "tab_SummaryS",
                    Size     = new System.Drawing.Size(1826, 877),
                    TabIndex = 2,
                    Text     = "Summary",
                    UseVisualStyleBackColor = true
                };

                mainProgram.TabControl.Controls.Add(tab_Summary);
                _ = new SummaryDetailsForm(Person, summaryDetails);
            }

            //
            // Tab Statistic- dane statystyczne
            //
            if (User.StatisticTab)
            {
                _ = new StatisticTabGenerator();
            }

            //
            // Tab Platform Savings - dane statystyczne
            //
            if (User.PlatformTab)
            {
                _ = new PlatformTabGenerator();
            }
            //
            // tab_STK
            //
            if (User.STKTab)
            {
                TabPage tab_STK = new TabPage
                {
                    Location = new System.Drawing.Point(4, 22),
                    Name     = "tab_STK",
                    Size     = new System.Drawing.Size(1826, 877),
                    TabIndex = 5,
                    Text     = "STK3",
                    UseVisualStyleBackColor = true
                };

                mainProgram.TabControl.Controls.Add(tab_STK);

                Tab_STK_Comp();
            }
            //
            // tab_Quantity
            //
            if (User.QuantityTab)
            {
                TabPage tab_Quantity = new TabPage
                {
                    Location = new System.Drawing.Point(4, 22),
                    Name     = "tab_Quantity",
                    Size     = new System.Drawing.Size(1826, 877),
                    TabIndex = 6,
                    Text     = "Quantity",
                    UseVisualStyleBackColor = true
                };

                mainProgram.TabControl.Controls.Add(tab_Quantity);

                Tab_Quantity_Comp();
            }
            //
            // tab_Admin
            //
            if (User.AdminTab)
            {
                TabPage tab_Admin = new TabPage
                {
                    Location = new System.Drawing.Point(4, 22),
                    Name     = "tab_Admin",
                    Size     = new System.Drawing.Size(1826, 877),
                    TabIndex = 7,
                    Text     = "Administration ",
                    UseVisualStyleBackColor = true
                };

                mainProgram.TabControl.Controls.Add(tab_Admin);

                _ = new AdminForm(mainProgram, action, admin, ImportData);

                TabPage tab_AdminAction = new TabPage
                {
                    Location = new System.Drawing.Point(4, 22),
                    Name     = "tab_AdminAction",
                    Size     = new System.Drawing.Size(1826, 877),
                    TabIndex = 8,
                    Text     = "Action Admin",
                    UseVisualStyleBackColor = true,
                };

                mainProgram.TabControl.Controls.Add(tab_AdminAction);

                _ = new ModifiActionForm(tab_AdminAction);
            }
        }
Пример #2
0
        public AdminForm(MainProgram mainProgram, Action action, Admin admin, Data_Import ImportData) : base(mainProgram, action, admin, ImportData)
        {
            tab_Admin = (TabPage)mainProgram.TabControl.Controls.Find("tab_Admin", false).First();

            Tab_Admin_Comp();
        }
Пример #3
0
 public Level1(MainProgram mainProgram, Data_Import data_Import)
 {
     this.mainProgram = mainProgram;
     this.data_Import = data_Import;
 }
Пример #4
0
 public PCRaports_Genereted(MainProgram mainProgram, Data_Import data_Import)
 {
     this.mainProgram = mainProgram;
     this.data_Import = data_Import;
 }
Пример #5
0
        private void BU_LoadFile(MainProgram form, string what)
        {
            //string linkBaza = @"I:\CAD\Work\bartkkon\EC_Akcelerator_Data\" + what + @"\" + what + ".txt";
            //string linkAdd = @"I:\CAD\Work\bartkkon\EC_Akcelerator_Data\zuzycie_" + what + ".txt";
            //string linkNew = @"I:\CAD\Work\bartkkon\EC_Akcelerator_Data\" + what + @"\" + what + DateTime.Now.ToString("yyyy") + DateTime.Now.ToString("MM") + DateTime.Now.ToString("dd") + DateTime.Now.ToString("HH") + DateTime.Now.ToString("mm") + ".txt";
            //string Rewizja = form.cb_BUKwartal.SelectedItem.ToString();
            //decimal Year = form.num_BUYear.Value;
            //string Columna;
            //int counter2 = 0;
            //int counter3;

            //DataTable Baza = new DataTable();
            //DataTable Data = new DataTable();

            ////ładowanie bazy do datatable
            //Data_Import ImportData = new Data_Import();
            //ImportData.Load_TxtToDataTable(ref Baza, linkBaza);

            ////Sprwdzenie czy dane istnieją
            //Columna = Rewizja + "/12/" + Year.ToString();
            //if (Baza.Columns.Contains(Columna))
            //{
            //    DialogResult MessageBoxResult = MessageBox.Show("Dane już istnieją czy je zmienić?", "Uwaga !!!", MessageBoxButtons.YesNo);
            //    if (MessageBoxResult == DialogResult.Yes)
            //    {
            //        int counter = 0;
            //        switch (Rewizja)
            //        {
            //            case "BU":
            //                counter = 1;
            //                break;
            //            case "EA1":
            //                counter = 3;
            //                break;
            //            case "EA2":
            //                counter = 6;
            //                break;
            //            case "EA3":
            //                counter = 9;
            //                break;
            //        }
            //        for (; counter < 13; counter++)
            //        {
            //            Columna = Rewizja + "/" + counter + "/" + Year.ToString();
            //            Baza.Columns.Remove(Columna);
            //        }
            //    }
            //    else
            //    {
            //        return;
            //    }
            //}

            //switch (Rewizja)
            //{
            //    case "BU":
            //        counter2 = 13;
            //        break;
            //    case "EA1":
            //        counter2 = 11;
            //        break;
            //    case "EA2":
            //        counter2 = 8;
            //        break;
            //    case "EA3":
            //        counter2 = 5;
            //        break;
            //}
            ////Ładowanie nowych danych do datatable
            //ImportData.Load_TxtToDataTable(ref Data, linkAdd);
            ////Sprawdzenie czy dane są zgodne
            //if (Data.Columns.Count != counter2)
            //{
            //    MessageBox.Show("Dane się nie zgadzają - sprawdz je!");
            //    return;
            //}

            ////Dodanie wartości do bazy
            //switch (Rewizja)
            //{
            //    case "BU":
            //        counter2 = 1;
            //        break;
            //    case "EA1":
            //        counter2 = 3;
            //        break;
            //    case "EA2":
            //        counter2 = 6;
            //        break;
            //    case "EA3":
            //        counter2 = 9;
            //        break;
            //}
            //counter3 = counter2;
            ////Dodanie kolumn do bazy
            //for (; counter3 < 13; counter3++)
            //{
            //    Columna = Rewizja + "/" + counter3 + "/" + Year.ToString();
            //    Baza.Columns.Add(Columna);
            //}

            //string komp;
            //foreach (DataRow row in Data.Rows)
            //{
            //    DataRow FoundRow;
            //    counter3 = counter2;
            //    komp = row[what].ToString();
            //    if (what == "BUANC")
            //    {
            //        FoundRow = Baza.Select(string.Format("BUANC LIKE '%{0}%'", komp)).FirstOrDefault();
            //    }
            //    else
            //    {
            //        FoundRow = Baza.Select(string.Format("BUPNC LIKE '%{0}%'", komp)).FirstOrDefault();
            //    }

            //    if (FoundRow == null)
            //    {
            //        DataRow Row = Baza.NewRow();
            //        Row[what] = row[what];
            //        for (; counter3 < 13; counter3++)
            //        {
            //            Columna = Rewizja + "/" + counter3 + "/" + Year.ToString();
            //            Row[Columna] = row[counter3.ToString()];
            //        }
            //        Baza.Rows.Add(Row);
            //    }
            //    else
            //    {
            //        for (; counter3 < 13; counter3++)
            //        {
            //            Columna = Rewizja + "/" + counter3 + "/" + Year.ToString();
            //            FoundRow[Columna] = row[counter3.ToString()];
            //        }
            //    }

            //}
            ////Zapisanie danych plus wyświetlenie ich
            //ImportData.Save_DataTableToTXT(ref Baza, linkBaza);

            //form.dg_BU.DataSource = Baza;
            //form.dg_BU.Refresh();
        }
Пример #6
0
 public void BU_AddANC(MainProgram form)
 {
     BU_LoadFile(form, "BUANC");
 }