コード例 #1
0
 static public List <ArhiviraniPosao> GetArhiviraniPoslovi()
 {
     using (DataBaseEntities cnt = new DataBaseEntities())
     {
         return(cnt.ArhiviraniPosaos.ToList());
     }
 }
コード例 #2
0
 static public MoguciPosao GetMoguciPosao(int ID)
 {
     using (DataBaseEntities cnt = new DataBaseEntities())
     {
         return(cnt.MoguciPosaos.Where(x => x.IDUlice == ID).FirstOrDefault());
     }
 }
コード例 #3
0
 static public List <Nalog> GetNalozi()
 {
     using (DataBaseEntities cnt = new DataBaseEntities())
     {
         return(cnt.Nalogs.ToList());
     }
 }
コード例 #4
0
 static public Nalog GetNalog(string nalog)
 {
     using (DataBaseEntities cnt = new DataBaseEntities())
     {
         return(cnt.Nalogs.Where(x => x.username == nalog).FirstOrDefault());
     }
 }
コード例 #5
0
 static public List <Poruka> GetPoruke()
 {
     using (DataBaseEntities cnt = new DataBaseEntities())
     {
         return(cnt.Porukas.ToList());
     }
 }
コード例 #6
0
 static public Poruka GetPoruka(int idpor)
 {
     using (DataBaseEntities cnt = new DataBaseEntities())
     {
         return(cnt.Porukas.Where(x => x.idPoruke == idpor).FirstOrDefault());
     }
 }
コード例 #7
0
 static public int IzmeniNalog(Nalog nalog)
 {
     using (DataBaseEntities cnt = new DataBaseEntities())
     {
         bool provera = false;
         foreach (Nalog n in cnt.Nalogs)
         {
             if (n.username == nalog.username)
             {
                 if (n.IDNaloga != nalog.IDNaloga)
                 {
                     provera = true;
                 }
             }
         }
         if (!provera)
         {
             Nalog tmp = cnt.Nalogs.Where(x => x.IDNaloga == nalog.IDNaloga).FirstOrDefault();
             tmp.password   = nalog.password;
             tmp.imePrezime = nalog.imePrezime;
             tmp.username   = nalog.username;
             return(cnt.SaveChanges());
         }
         else
         {
             return(0);
         }
     }
 }
コード例 #8
0
 static public List <MoguciPosao> GetMoguciPoslovi()
 {
     using (DataBaseEntities cnt = new DataBaseEntities())
     {
         return(cnt.MoguciPosaos.Where(x => x.Stiklirano == false).ToList());
     }
 }
コード例 #9
0
 static public ArhiviraniPosao GetArhiviraniPosao(int id)
 {
     using (DataBaseEntities cnt = new DataBaseEntities())
     {
         return(cnt.ArhiviraniPosaos.Where(x => x.idPosla == id).FirstOrDefault());
     }
 }
コード例 #10
0
 static public void DodajNalog(Nalog nalog)
 {
     using (DataBaseEntities cnt = new DataBaseEntities())
     {
         cnt.Nalogs.Add(nalog);
         cnt.SaveChanges();
     }
 }
コード例 #11
0
 static public void IzbrisiNalog(Nalog nalog)
 {
     using (DataBaseEntities cnt = new DataBaseEntities())
     {
         cnt.Nalogs.Remove(nalog);
         cnt.SaveChanges();
     }
 }
コード例 #12
0
 static public int IzbrisiMoguciPosao(MoguciPosao ulica)
 {
     using (DataBaseEntities cnt = new DataBaseEntities())
     {
         cnt.MoguciPosaos.Remove(ulica);
         return(cnt.SaveChanges());
     }
 }
コード例 #13
0
 static public void DodajMoguciPosao(MoguciPosao ulica)
 {
     using (DataBaseEntities cnt = new DataBaseEntities())
     {
         cnt.MoguciPosaos.Add(ulica);
         cnt.SaveChanges();
     }
 }
コード例 #14
0
 static public void DodajArhiviraniPosao(ArhiviraniPosao posao)
 {
     using (DataBaseEntities cnt = new DataBaseEntities())
     {
         cnt.ArhiviraniPosaos.Add(posao);
         cnt.SaveChanges();
     }
 }
コード例 #15
0
 static public int IzbrisiPoruku(Poruka poruka)
 {
     using (DataBaseEntities cnt = new DataBaseEntities())
     {
         cnt.Porukas.Remove(poruka);
         return(cnt.SaveChanges());
     }
 }
コード例 #16
0
 static public int IzbrisiArhiviraniPosao(ArhiviraniPosao posao)
 {
     using (DataBaseEntities cnt = new DataBaseEntities())
     {
         cnt.ArhiviraniPosaos.Remove(posao);
         return(cnt.SaveChanges());
     }
 }
コード例 #17
0
 static public void DodajPoruku(Poruka poruka)
 {
     using (DataBaseEntities cnt = new DataBaseEntities())
     {
         cnt.Porukas.Add(poruka);
         cnt.SaveChanges();
     }
 }
コード例 #18
0
        static public int IzmeniPoruku(Poruka poruka)
        {
            using (DataBaseEntities cnt = new DataBaseEntities())
            {
                Poruka tmp = cnt.Porukas.Where(x => x.idPoruke == poruka.idPoruke).FirstOrDefault();
                tmp.poruka1     = poruka.poruka1;
                tmp.datumObjave = poruka.datumObjave;

                return(cnt.SaveChanges());
            }
        }
コード例 #19
0
        static public int IzmeniArhiviraniPosao(ArhiviraniPosao posao)
        {
            using (DataBaseEntities cnt = new DataBaseEntities())
            {
                ArhiviraniPosao tmp = cnt.ArhiviraniPosaos.Where(x => x.idPosla == posao.idPosla).FirstOrDefault();
                tmp.tip      = posao.tip;
                tmp.vreme    = posao.vreme;
                tmp.ulicaIme = posao.ulicaIme;

                return(cnt.SaveChanges());
            }
        }
コード例 #20
0
 static public void IzmeniMoguciPosao(MoguciPosao ulica)
 {
     using (DataBaseEntities cnt = new DataBaseEntities())
     {
         MoguciPosao tmp = cnt.MoguciPosaos.Where(x => x.IDUlice == ulica.IDUlice).FirstOrDefault();
         tmp.povrsina   = ulica.povrsina;
         tmp.planp      = ulica.planp;
         tmp.ulica      = ulica.ulica;
         tmp.Stiklirano = ulica.Stiklirano;
         cnt.SaveChanges();
     }
 }
コード例 #21
0
        static public void RefreshujPoslove()
        {
            using (DataBaseEntities cnt = new DataBaseEntities())
            {
                string danas  = DateTime.Now.DayOfWeek.ToString();
                string dplan  = "";
                string ddplan = "";
                switch (danas)
                {
                case "Monday":
                    dplan  = "A";
                    ddplan = "E";
                    break;

                case "Tuesday":
                    dplan = "B";
                    break;

                case "Wednesday":
                    dplan  = "A";
                    ddplan = "F";
                    break;

                case "Thursday":
                    dplan = "C";
                    break;

                case "Friday":
                    dplan = "D";
                    break;
                }
                foreach (MoguciPosao p in cnt.MoguciPosaos)
                {
                    if (p.planp != dplan && p.planp != ddplan)
                    {
                        p.Stiklirano = false;
                    }
                }
                cnt.SaveChanges();
            }
        }