Beispiel #1
0
 public static string getToken()
 {
     try
     {
         if ((bool)SessionHandler.doesSessionExist())
         {
             return((string)HttpContext.Current.Session["token"]);
         }
         else
         {
             return(null);
         }
     }
     catch
     {
         return(null);
     }
 }
Beispiel #2
0
 public static String getLoggedInUserType()
 {
     try
     {
         if ((Boolean)SessionHandler.doesSessionExist())
         {
             return((String)HttpContext.Current.Session["type"]);
         }
         else
         {
             return("");
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Beispiel #3
0
 public static String getLoggedInUserID()
 {
     try
     {
         if ((Boolean)SessionHandler.doesSessionExist())
         {
             return((String)HttpContext.Current.Session["userID"]);
         }
         else
         {
             return(null);
         }
     }
     catch
     {
         return(null);
     }
 }
Beispiel #4
0
        public static String getLoggedInUserTypeAlias()
        {
            try
            {
                if ((Boolean)SessionHandler.doesSessionExist())
                {
                    String type = (String)HttpContext.Current.Session["type"];
                    switch (type.Trim())
                    {
                    case Constants.AIGROW_ADMIN:
                        return("System Administrator");

                    case Constants.CHG_NETWORK:
                        return("Network Owner");

                    case Constants.CHG_OWNER:
                        return("Point Owner");

                    case Constants.AIGROW_CUSTOMER:
                        return("Charge Customer");

                    case Constants.CHG_STAFF:
                        return("chargeNET Staff");

                    case Constants.CHG_ACCOUNTANT:
                        return("Accountant");

                    default:
                        return("Unknown User");
                    }
                }
                else
                {
                    return(string.Empty);
                }
            }
            catch (Exception ex)
            {
                return(string.Empty);
            }
        }