Beispiel #1
0
    private Przebieg Nowyprzebieg()
    {
        Przebieg przebieg = new Przebieg();

        przebieg.Roznica_czasu   = TimeSpan.Parse(tbgodzina.Text);
        przebieg.Id_miejscowosci = decimal.Parse(tbidmiej.Text);
        przebieg.Id_trasy        = decimal.Parse(tbidtrasy.Text);
        przebieg.Kolejnosc       = decimal.Parse(tbkolej.Text);
        return(przebieg);
    }
Beispiel #2
0
    private void FillPage(decimal Id_przebiegu)
    {
        Przebiegmodel przebiegmodel = new Przebiegmodel();
        Przebieg      przebieg      = przebiegmodel.GetPrzebieg(Id_przebiegu);

        tbgodzina.Text = przebieg.Roznica_czasu.ToString();
        tbidmiej.Text  = przebieg.Id_miejscowosci.ToString();
        tbidtrasy.Text = przebieg.Id_trasy.ToString();
        tbkolej.Text   = przebieg.Kolejnosc.ToString();
    }
Beispiel #3
0
        public override int GetHashCode()
        {
            int hashCode = -2122499966;

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Marka);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Model);

            hashCode = hashCode * -1521134295 + RokProdukcji.GetHashCode();
            hashCode = hashCode * -1521134295 + Przebieg.GetHashCode();
            hashCode = hashCode * -1521134295 + Cena.GetHashCode();
            return(hashCode);
        }
Beispiel #4
0
 public string InsertPrzebieg(Przebieg przebieg)
 {
     try
     {
         Baza_PKSEntities db = new Baza_PKSEntities();
         db.Przebieg.Add(przebieg);
         db.SaveChanges();
         return("Dodano");
     }
     catch (Exception e)
     {
         return("Error" + e);
     }
 }
Beispiel #5
0
    protected void btok_Click1(object sender, EventArgs e)
    {
        Przebiegmodel przebiegmodel = new Przebiegmodel();
        Przebieg      przebieg      = Nowyprzebieg();

        if (!String.IsNullOrWhiteSpace(Request.QueryString["id"]))
        {
            decimal Id_przebiegu = decimal.Parse(Request.QueryString["id"]);
            lbwynik.Text = przebiegmodel.UpdatePrzebieg(Id_przebiegu, przebieg);
        }
        else
        {
            lbwynik.Text = przebiegmodel.InsertPrzebieg(przebieg);
        }
    }
Beispiel #6
0
 public Przebieg GetPrzebieg(decimal Id_przebiegu)
 {
     try
     {
         using (Baza_PKSEntities db = new Baza_PKSEntities())
         {
             Przebieg przebieg = db.Przebieg.Find(Id_przebiegu);
             return(przebieg);
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
Beispiel #7
0
 public string UpdatePrzebieg(decimal Id_przebiegu, Przebieg przebieg)
 {
     try
     {
         Baza_PKSEntities db = new Baza_PKSEntities();
         Przebieg         p  = db.Przebieg.Find(Id_przebiegu);
         p.Id_miejscowosci = przebieg.Id_miejscowosci;
         p.Id_trasy        = przebieg.Id_trasy;
         p.Kolejnosc       = przebieg.Kolejnosc;
         p.Roznica_czasu   = przebieg.Roznica_czasu;
         db.SaveChanges();
         return("edycja powiodla sie");
     }
     catch (Exception e)
     {
         return("Error" + e);
     }
 }
 private void PokazKanaly()
 {
     Przebieg.Series.Clear();
     if (Onch1)
     {
         Przebieg.Series.Add(Ch1);
     }
     if (Onch2)
     {
         Przebieg.Series.Add(Ch2);
     }
     if (Onch3)
     {
         Przebieg.Series.Add(Ch3);
     }
     if (Onch4)
     {
         Przebieg.Series.Add(Ch4);
     }
     Przebieg.InvalidatePlot(true);
 }
        public void ParsujPunkty(List <string> ZbiorWartosci)
        {
            double val = 0;

            foreach (string s in ZbiorWartosci)
            {
                if (Probka >= Ilosc_probek - 1)
                {
                    Rejestruj = false;
                    Przebieg.InvalidatePlot(true);
                    ObliczWartoscSrednia(Wybranyanalizakanal);
                    ObliczSredniaCzestotliwoscProbkowania(Wybranyanalizakanal);
                    return;
                }
                try
                {
                    if (s.Substring(0, 1) == "1")
                    {
                        if (Double.TryParse(s.Substring(2), out val))
                        {
                            if (s.Substring(1, 1) == "t")
                            {
                                czas = val;
                            }
                            else if (s.Substring(1, 1) == "s")
                            {
                                DodajPunkt(czas, val * 3.3 / 4095, 1);
                                Probka++;
                            }
                        }
                    }

                    else if (s.Substring(0, 1) == "2")
                    {
                        if (Double.TryParse(s.Substring(2), out val))
                        {
                            if (s.Substring(1, 1) == "t")
                            {
                                czas = val;
                            }
                            else if (s.Substring(1, 1) == "s")
                            {
                                DodajPunkt(czas, val * 3.3 / 4095, 2);
                                Probka++;
                            }
                        }
                    }

                    else if (s.Substring(0, 1) == "3")
                    {
                        if (Double.TryParse(s.Substring(2), out val))
                        {
                            if (s.Substring(1, 1) == "t")
                            {
                                czas = val;
                            }
                            else if (s.Substring(1, 1) == "s")
                            {
                                DodajPunkt(czas, val * 3.3 / 4095, 3);
                                Probka++;
                            }
                        }
                    }
                    else if (s.Substring(0, 1) == "4")
                    {
                        if (Double.TryParse(s.Substring(2), out val))
                        {
                            if (s.Substring(1, 1) == "t")
                            {
                                czas = val;
                            }
                            else if (s.Substring(1, 1) == "s")
                            {
                                DodajPunkt(czas, val * 3.3 / 4095, 4);
                                Probka++;
                            }
                        }
                    }
                }
                catch { }
            }
        }