public bool upisuBazu(string xml) { BazaPodataka.Baza b = BazaPodataka.Baza.Instance; int i = xml.Length - 19; string s = xml.Substring(i); if (provera(s)) { List <Stavka> stavke = ucitajXML(s); if (stavke == null) { return(false); } if (prongozirana(s)) { b.UpisiPrognozirano(stavke, s); } else { b.UpisiOstvareno(stavke, s); } return(true); } return(false); }
public byte[] returnStatistic(string ime, string zem, int od, int to) { if (ime == null || zem == null) { throw new ArgumentNullException(); } if (od <= 0 || to >= 25) { throw new ArgumentOutOfRangeException(); } ListDataStatistic temp = new ListDataStatistic(); List <DataStatistic> ret = new List <DataStatistic>(); BazaPodataka.Baza b = BazaPodataka.Baza.Instance; ret = b.VratiFiltriranoPodatke(ime, zem, od, to); if (ret == null) { return(null); } var binFormatter = new BinaryFormatter(); var mStream = new MemoryStream(); binFormatter.Serialize(mStream, ret); return(mStream.ToArray()); }
public bool provera(string xml) //proveravamo da li se xml vec nalazi u bazi. ako ne onda vracamo true i ubacujemo ga u listu { BazaPodataka.Baza b = BazaPodataka.Baza.Instance; foreach (string s in b.ucitano) { if (s.Equals(xml)) { return(false); } } // b.upisiuCSV(xml); return(true); }