Beispiel #1
0
 public Wezel(int idOjca, typ rodzaj, string wartosc)
 {
     this.id      = System.Threading.Interlocked.Increment(ref licznikID);
     this.idOjca  = idOjca;
     this.rodzaj  = rodzaj;
     this.wartosc = wartosc;
 }
Beispiel #2
0
 public void setTyp(string Typ)
 {
     if (Typ == typ.land.ToString())
     {
         _Typ = typ.land;
     }
     if (Typ == typ.naval.ToString())
     {
         _Typ = typ.naval;
     }
     if (Typ == typ.air.ToString())
     {
         _Typ = typ.air;
     }
 }
        public override bool IsUserInRole(string username, string roleName)
        {
            Baza2Context panel = new Baza2Context();
            typ upr = new typ();
            try
            {
                 upr = (from u in panel.typ where u.nazwa == roleName select u).First();
            }
            catch
            {
                return false;
            }
            uzytkownik u1 = null;

            try
            {
                u1 = (from u in panel.uzytkownik where u.login == username && u.typ_id_typ == upr.id_typ select u).First();
            }
            catch
            {
                u1 = null;
            }

            if (u1 != null ) return true;
            else return false;
        }