Exemplo n.º 1
0
 public static int VratiStatusLicence(int id)
 {
     using (InformacioniSistemBanakaEntities db = new InformacioniSistemBanakaEntities())
         try
         {
             Banka banka = (from a in db.Banka
                            where a.BankaID == id
                            select a).Single();
             if (banka != null)
             {
                 if (banka.Licenca.StatusLicence == 0)
                 {
                     return(0);
                 }
                 if (banka.Licenca.StatusLicence == 1)
                 {
                     return(1);
                 }
             }
             return(1);
         }
         catch (Exception)
         {
             return(0);
         }
 }
Exemplo n.º 2
0
 public static bool BrisiBanku(int id)
 {
     using (InformacioniSistemBanakaEntities db = new InformacioniSistemBanakaEntities())
         try
         {
             Banka banka = (from a in db.Banka
                            where a.BankaID == id
                            select a).Single();
             if (banka != null)
             {
                 var a = banka.Licenca.StatusLicence;
                 if (a == 0)
                 {
                     banka.Licenca.StatusLicence = 1;
                 }
                 if (a == 1)
                 {
                     banka.Licenca.StatusLicence = 0;
                 }
                 db.SaveChanges();
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
         catch (Exception)
         {
             return(false);
         }
 }
Exemplo n.º 3
0
        public static Banka PrikaziBankupoId(int id)
        {
            using (InformacioniSistemBanakaEntities db = new InformacioniSistemBanakaEntities())
            {
                Banka banka = (from a in db.Banka
                               where a.BankaID == id
                               select a).Single();


                return(banka);
            }
        }
Exemplo n.º 4
0
 public static void DodajBanku(Banka banka)
 {
     using (InformacioniSistemBanakaEntities db = new InformacioniSistemBanakaEntities())
     {
         try
         {
             db.Banka.Add(banka);
             db.SaveChanges();
         }
         catch (Exception)
         {
         }
     }
 }
Exemplo n.º 5
0
 public static void IzmeniBanku(Banka banka)
 {
     using (InformacioniSistemBanakaEntities db = new InformacioniSistemBanakaEntities())
     {
         Banka izmena = (from a in db.Banka
                         where a.BankaID == banka.BankaID
                         select a).Single();
         izmena.Naziv                  = banka.Naziv;
         izmena.Sediste                = banka.Sediste;
         izmena.GodinaOsnivanja        = banka.GodinaOsnivanja;
         izmena.StatusID               = banka.StatusID;
         izmena.VrstaID                = banka.VrstaID;
         izmena.Vlasnistvo             = banka.Vlasnistvo;
         izmena.Godisnjiprofit         = banka.Godisnjiprofit;
         izmena.UkupnaAktivaiUkupniDug = banka.UkupnaAktivaiUkupniDug;
         try
         {
             db.SaveChanges();
         }
         catch
         {
         }
     }
 }