private static void RefrechBtnPage(object sender, MouseEventArgs e)
        {
            string TableName = (Application.OpenForms[0].Controls["PagesPanel"] as TabControl).SelectedTab.Text;

            (Application.OpenForms[0].Controls["PagesPanel"] as TabControl).TabPages.RemoveByKey(TableName);
            LoadTable.LoadPage(TableName);
        }
示例#2
0
 private void DeleteUserBtnClick(object sender, EventArgs e)
 {
     if (Scripts.DeleteScript(NameTable, Table.Columns[0].HeaderText, Table.Rows[0].Cells[0].Value.ToString()))
     {
         this.Close();
         (Application.OpenForms[0].Controls["PagesPanel"] as TabControl).TabPages.RemoveByKey(NameTable);
         LoadTable.LoadPage(NameTable);
     }
 }
 private void ViewsClick(object sender, EventArgs e)
 {
     if (PagesPanel.TabPages.ContainsKey((sender as ToolStripMenuItem).Text) && !(sender as ToolStripMenuItem).Checked)
     {
         PagesPanel.TabPages.RemoveByKey((sender as ToolStripMenuItem).Text);
     }
     else
     {
         LoadTable.LoadPage((sender as ToolStripMenuItem).Text);
     }
 }
        private void NoPaidMenuItemClick(object sender, EventArgs e)
        {
            Form show = new Form()
            {
                Width  = 900,
                Height = 500,
                Text   = "Не проплачено"
            };

            if (!PagesPanel.TabPages.ContainsKey("Студент"))
            {
                LoadTable.LoadPage("Студент");
            }
            (Views.DropDownItems["roomToolStripMenuItem"] as ToolStripMenuItem).Checked = true;
            DataGridView  url       = (PagesPanel.TabPages["Студент"].Controls["Table"] as DataGridView);
            List <string> TitleName = new List <string>();

            for (int i = 0; i < url.Columns.Count; ++i)
            {
                TitleName.Add(url.Columns[i].HeaderText);
            }
            DataGridView table = ControlPanel.Table(TitleName, false);

            for (int i = 0; i < url.Rows.Count; ++i)
            {
                if (url.Rows[i].Cells[6].Value.ToString() == "False")
                {
                    List <string> data = new List <string>();
                    for (int j = 0; j < url.Columns.Count; ++j)
                    {
                        data.Add(url.Rows[i].Cells[j].Value.ToString());
                    }
                    table.Rows.Add(data.ToArray());
                }
            }
            show.Controls.Add(table);
            show.Show();
        }
        private void FreePlacesShow(object sender, EventArgs e)
        {
            Form show = new Form()
            {
                Width  = 900,
                Height = 500,
                Text   = "Вільні Місця"
            };

            if (!PagesPanel.TabPages.ContainsKey("Кімната"))
            {
                LoadTable.LoadPage("Кімната");
            }
            (Views.DropDownItems["roomToolStripMenuItem"] as ToolStripMenuItem).Checked = true;
            DataGridView  url       = (PagesPanel.TabPages["Кімната"].Controls["Table"] as DataGridView);
            List <string> TitleName = new List <string>();

            for (int i = 0; i < url.Columns.Count; ++i)
            {
                TitleName.Add(url.Columns[i].HeaderText);
            }
            DataGridView table = ControlPanel.Table(TitleName, false);

            for (int i = 0; i < url.Rows.Count; ++i)
            {
                if (Convert.ToInt32(url.Rows[i].Cells[2].Value) > Convert.ToInt32(url.Rows[i].Cells[3].Value))
                {
                    List <string> data = new List <string>();
                    for (int j = 0; j < url.Columns.Count; ++j)
                    {
                        data.Add(url.Rows[i].Cells[j].Value.ToString());
                    }
                    table.Rows.Add(data.ToArray());
                }
            }
            show.Controls.Add(table);
            show.Show();
        }