Esempio n. 1
0
    protected void Gridview7_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView theGrid      = sender as GridView; // refer to the GridView
        int      newPageIndex = 0;

        if (-2 == e.NewPageIndex)
        {
            TextBox     txtNewPageIndex = null;
            GridViewRow pagerRow        = Gridview7.BottomPagerRow;


            if (null != pagerRow)
            {
                txtNewPageIndex = (TextBox)pagerRow.FindControl("textbox");   // refer to the TextBox with the NewPageIndex value
            }

            if (null != txtNewPageIndex && txtNewPageIndex.Text != "")
            {
                newPageIndex = int.Parse(txtNewPageIndex.Text) - 1; // get the NewPageIndex
            }
        }
        else
        {
            newPageIndex = e.NewPageIndex;
        }

        BindGridview7("");
        Gridview7.DataBind();
        newPageIndex        = newPageIndex < 0 ? 0 : newPageIndex;
        newPageIndex        = newPageIndex >= Gridview7.PageCount ? Gridview7.PageCount - 1 : newPageIndex;
        Gridview7.PageIndex = newPageIndex;
        Gridview7.DataBind();
    }
        protected void odswiez()
        {
            string idDzialu = (string)Session["id_dzialu"];
            string txt      = string.Empty;

            DataTable tabelkaGW1 = new DataTable();
            DataTable tabelkaGW2 = new DataTable();
            DataTable tabelkaGW3 = new DataTable();
            DataTable tabelkaGW4 = new DataTable();
            DataTable tabelkaGW5 = new DataTable();
            DataTable tabelkaGW6 = new DataTable();
            DataTable tabelkaGW7 = new DataTable();
            DataTable tabelkaGW8 = new DataTable();

            try
            {
                //cm.log.Info("OGLR2: wczytywanie danych do tabeli 1");
                tabelkaGW1            = dr.generuj_dane_do_tabeli_sedziowskiej_2019(int.Parse((string)Session["id_dzialu"]), 1, Date1.Date, Date2.Date, 30, tenPlik);
                Session["tabelka001"] = tabelkaGW1;
                Tabela1.DataSource    = null;
                Tabela1.DataSourceID  = null;
                Tabela1.DataSource    = tabelkaGW1;
                Tabela1.DataBind();

                //cm.log.Info("OGLR2: wczytywanie danych do tabeli 2");
                tabelkaGW2             = dr.generuj_dane_do_tabeli_sedziowskiej_2019(int.Parse((string)Session["id_dzialu"]), 2, Date1.Date, Date2.Date, 30, tenPlik);
                Session["tabelka002"]  = tabelkaGW2;
                Gridview2.DataSource   = null;
                Gridview2.DataSourceID = null;
                Gridview2.DataSource   = tabelkaGW2;
                Gridview2.DataBind();

                //cm.log.Info("OGLR2: wczytywanie danych do tabeli 3");
                tabelkaGW3             = dr.generuj_dane_do_tabeli_sedziowskiej_2019(int.Parse((string)Session["id_dzialu"]), 3, Date1.Date, Date2.Date, 30, tenPlik);
                Session["tabelka003"]  = tabelkaGW3;
                Gridview3.DataSource   = null;
                Gridview3.DataSourceID = null;
                Gridview3.DataSource   = tabelkaGW3;
                Gridview3.DataBind();
                try
                {
                    //cm.log.Info("OGLR2: wczytywanie danych do tabeli 4");
                    tabelkaGW4            = dr.generuj_dane_do_tabeli_wierszy2018(Date1.Date, Date2.Date, (string)Session["id_dzialu"], 4, 1, 8, tenPlik);
                    Session["tabelka004"] = tabelkaGW4;
                    //pisz("tab_05_", 10, 9, tabela02);
                    tab_05_w01_c1.Text = tabelkaGW4.Rows[0][1].ToString().Trim();
                    tab_05_w01_c2.Text = tabelkaGW4.Rows[0][2].ToString().Trim();
                    tab_05_w01_c3.Text = tabelkaGW4.Rows[0][3].ToString().Trim();
                    tab_05_w01_c4.Text = tabelkaGW4.Rows[0][4].ToString().Trim();
                    tab_05_w01_c5.Text = tabelkaGW4.Rows[0][5].ToString().Trim();
                    tab_05_w01_c6.Text = tabelkaGW4.Rows[0][6].ToString().Trim();
                    tab_05_w01_c7.Text = tabelkaGW4.Rows[0][7].ToString().Trim();
                }
                catch (Exception ex)
                {
                    cm.log.Error(tenPlik + " tabela 4 " + ex.Message);
                }
                try
                {
                    //cm.log.Info("OGLR2: wczytywanie danych do tabeli 5");
                    tabelkaGW5 = dr.generuj_dane_do_tabeli_wierszy2018(Date1.Date, Date2.Date, (string)Session["id_dzialu"], 5, 8, 2, tenPlik);

                    Session["tabelka005"] = tabelkaGW5;
                    tab_06_w01_c01.Text   = tabelkaGW5.Rows[0][1].ToString().Trim();
                    tab_06_w02_c01.Text   = tabelkaGW5.Rows[1][1].ToString().Trim();
                    tab_06_w03_c01.Text   = tabelkaGW5.Rows[2][1].ToString().Trim();
                    tab_06_w04_c01.Text   = tabelkaGW5.Rows[3][1].ToString().Trim();
                    tab_06_w05_c01.Text   = tabelkaGW5.Rows[4][1].ToString().Trim();
                    tab_06_w06_c01.Text   = tabelkaGW5.Rows[5][1].ToString().Trim();
                    tab_06_w07_c01.Text   = tabelkaGW5.Rows[6][1].ToString().Trim();
                }
                catch (Exception ex)
                {
                    cm.log.Error("OGLR2: " + ex.Message);
                }

                try
                {
                    Session["tabelka006"] = dr.tworzTabele(int.Parse((string)Session["id_dzialu"]), 6, Date1.Date, Date2.Date, 30, Gridview6, tenPlik);
                    Gridview6.DataBind();
                }
                catch (Exception ex)
                {
                    cm.log.Error("OGLR2: " + ex.Message);
                }

                //cm.log.Info("OGLR2: wczytywanie danych do tabeli 7");
                Session["tabelka007"] = dr.tworzTabele(int.Parse((string)Session["id_dzialu"]), 7, Date1.Date, Date2.Date, 9, Gridview7, tenPlik);

                Gridview7.DataBind();
            }
            catch (Exception ex)
            {
                cm.log.Error("OGLR2: " + ex.Message);
            }

            // dopasowanie opisów
            makeLabels();

            try
            {
                Label11.Visible    = cl.debug(int.Parse(idDzialu));
                infoLabel2.Visible = cl.debug(int.Parse(idDzialu));

                infoLabel3.Visible = cl.debug(int.Parse(idDzialu));
                infoLabel4.Visible = cl.debug(int.Parse(idDzialu));
                infoLabel5.Visible = cl.debug(int.Parse(idDzialu));
                infoLabel5.Visible = cl.debug(int.Parse(idDzialu));
                infoLabel7.Visible = cl.debug(int.Parse(idDzialu));
                infoLabel8.Visible = cl.debug(int.Parse(idDzialu));
            }
            catch
            {
                Label11.Visible    = false;
                infoLabel2.Visible = false;
                infoLabel3.Visible = false;
                infoLabel4.Visible = false;
                infoLabel5.Visible = false;

                infoLabel6.Visible = false;
                infoLabel7.Visible = false;
                infoLabel8.Visible = false;
            }

            Label11.Text = txt;
            Label3.Text  = cl.nazwaSadu((string)Session["id_dzialu"]);
        }
Esempio n. 3
0
 //采购订单表
 private void BindGridview7(string condition)
 {
     Gridview7.DataSource = ppb.SelectPMPurchaseOrder(condition);
     Gridview7.DataBind();
 }