Exemplo n.º 1
0
 public static PersonAccount getInstance(String login, String type)
 {
     if (PersonAccount.instance != null)
     {
         return(PersonAccount.instance);
     }
     PersonAccount.instance = new PersonAccount(login, type);
     return(PersonAccount.instance);
 }
Exemplo n.º 2
0
 public static PersonAccount getInstance()
 {
     if (PersonAccount.instance != null)
     {
         return(PersonAccount.instance);
     }
     PersonAccount.instance = new PersonAccount();
     return(PersonAccount.instance);
 }
Exemplo n.º 3
0
        public static Employee GetEmployeeFromAccountId()
        {
            MojDziennikEntities db = new MojDziennikEntities();
            int accountid          = PersonAccount.getInstance().accountId;
            var account            = db.Account.Where(a => a.Account_Id == accountid).FirstOrDefault();

            //var temp = account
            return(account.Employee.ElementAt(0));
        }
Exemplo n.º 4
0
        public static Legal_Guardian GetLegal_GuardianFromAccountId()
        {
            MojDziennikEntities db = new MojDziennikEntities();
            int     accid          = PersonAccount.getInstance().accountId;
            Account account        = db.Account.Where(a => a.Account_Id == accid).FirstOrDefault();

            if (account == null)
            {
                return(new Legal_Guardian());
            }
            return(account.Legal_Guardian.ElementAt(0));
        }
Exemplo n.º 5
0
        public static Pupil GetPupilFromAccountId()
        {
            MojDziennikEntities db = new MojDziennikEntities();
            int     accid          = PersonAccount.getInstance().accountId;
            Account account        = db.Account.Where(a => a.Account_Id == accid).FirstOrDefault();

            if (account == null)
            {
                return(new Pupil());
            }
            return(account.Pupil.ElementAt(0));
        }
Exemplo n.º 6
0
 public bool IsInRole(string role)
 {
     return(PersonAccount.getInstance().AuthenticationType.Equals(role));
 }