protected override void OnPreRenderComplete(EventArgs e)
        {
            RouteValueDictionary routeValues = new RouteValueDictionary(GridView1.GetDefaultValues());

            InsertHyperLink.NavigateUrl = table.GetActionPath(PageAction.Insert, routeValues);
            base.OnPreRenderComplete(e);
        }
示例#2
0
    protected override void OnPreRenderComplete(EventArgs e)
    {
        RouteValueDictionary routeValues = new RouteValueDictionary(GridView1.GetDefaultValues());

        base.OnPreRenderComplete(e);
    }
示例#3
0
    protected override void OnPreRenderComplete(EventArgs e)
    {
        RouteValueDictionary routeValues = new RouteValueDictionary(GridView1.GetDefaultValues());

        InsertHyperLink.NavigateUrl = table.GetActionPath(PageAction.Insert, routeValues);
        base.OnPreRenderComplete(e);



        //cena
        var cenagrid = GridView1.Rows.Cast <GridViewRow>()
                       .Select(r => new
        {
            id  = (int)GridView1.DataKeys[r.RowIndex][0],
            cb1 = (Label)r.Cells[0].FindControl("TPrice"),
        })
                       .Select(a => a.cb1.Text)
                       .ToList();
        double cena      = 0;
        int    cenailosc = 0;

        foreach (string sel in cenagrid)
        {
            double x = Convert.ToDouble(sel);
            cena      = cena + x;
            cenailosc = cenailosc + 1;
        }
        cena = Math.Round((cena / cenailosc), 2);

        //jakosc
        var jakoscgrid = GridView1.Rows.Cast <GridViewRow>()
                         .Select(r => new
        {
            id  = (int)GridView1.DataKeys[r.RowIndex][0],
            cb2 = (Label)r.Cells[0].FindControl("TQuality"),
        })
                         .Select(a => a.cb2.Text)
                         .ToList();
        double jakosc      = 0;
        int    jakoscilosc = 0;

        foreach (string sel in jakoscgrid)
        {
            double x = Convert.ToDouble(sel);
            jakosc      = jakosc + x;
            jakoscilosc = jakoscilosc + 1;
        }
        jakosc = Math.Round((jakosc / jakoscilosc), 2);

        //czas
        var czasgrid = GridView1.Rows.Cast <GridViewRow>()
                       .Select(r => new
        {
            id  = (int)GridView1.DataKeys[r.RowIndex][0],
            cb3 = (Label)r.Cells[0].FindControl("TDelivery_time"),
        })
                       .Select(a => a.cb3.Text)
                       .ToList();
        double czas      = 0;
        int    czasilosc = 0;

        foreach (string sel in czasgrid)
        {
            double x = Convert.ToDouble(sel);
            czas      = czas + x;
            czasilosc = czasilosc + 1;
        }
        czas = Math.Round((czas / czasilosc), 2);

        //kontakt
        var kontaktgrid = GridView1.Rows.Cast <GridViewRow>()
                          .Select(r => new
        {
            id  = (int)GridView1.DataKeys[r.RowIndex][0],
            cb4 = (Label)r.Cells[0].FindControl("TContact"),
        })
                          .Select(a => a.cb4.Text)
                          .ToList();
        double kontakt      = 0;
        int    kontaktilosc = 0;

        foreach (string sel in kontaktgrid)
        {
            double x = Convert.ToDouble(sel);
            kontakt      = kontakt + x;
            kontaktilosc = kontaktilosc + 1;
        }
        kontakt = Math.Round((kontakt / kontaktilosc), 2);



        Label1.Text = cena.ToString();
        Label2.Text = jakosc.ToString();
        Label3.Text = czas.ToString();
        Label4.Text = kontakt.ToString();
    }