Exemplo n.º 1
0
    public static string H(PEIMS d)
    {
        if (Util.UserID == 0)
        {
            throw new Exception("SessionExpired");
        }
        JObject o = new JObject();

        o["view"] = Util.GetData(String.Format("select top 1 * from people where id = {0} and class>0", d.sid[0]), false);
        return(o.ToString());
    }
Exemplo n.º 2
0
    public static string H(PEIMS d)
    {
        JObject o = new JObject();

        #region test studnets
        if (d.sr == "*")
        {
        }

        if (d.sr == "profile")
        {
            o["gradDate"]  = JObject.Parse(Util.SelectJSON(String.Format(@"Select GraduationDate from Graduates where id= {0}", d.sid[0])));
            o["email"]     = JObject.Parse(Util.SelectJSON(String.Format(@"Select email from Graduates where id= {0}", d.sid[0])));
            o["homePhone"] = JObject.Parse(Util.SelectJSON(String.Format(@"Select HomePhone from Graduates where id= {0}", d.sid[0])));
            o["gradDate"]  = JObject.Parse(Util.SelectJSON(String.Format(@"Select GraduationDate from Graduates where id= {0}", d.sid[0])));
            o["birthDate"] = JObject.Parse(Util.SelectJSON(String.Format(@"Select BirthDate from Graduates where id= {0}", d.sid[0])));
            o["gender"]    = JObject.Parse(Util.SelectJSON(String.Format(@"Select Gender from Graduates where id= {0}", d.sid[0])));
            o["race"]      = JObject.Parse(Util.SelectJSON(String.Format(@"Select Race from Graduates where id= {0}", d.sid[0])));


            int    dec = Convert.ToInt32(d.sid[0]) % 100000;
            string url = Util.GetData(@"SELECT    
                    (SELECT concat('https://',Domain,'/database/photo.asp?pid=') FROM Campuses WHERE CampusID=People.Campus) DomainName 
                FROM People 
                WHERE People.ID=" + d.sid[0], "") + Util.EncPhoto(dec.ToString());
            o["url"] = url;
        }

        #endregion

        #region KS
        if (d.sr == "ks")
        {
            //o[d.sr] = "test";
            HttpContext.Current.Session.Abandon();
            HttpContext.Current.Session.Clear();
        }
        #endregion
        return(o.ToString());
    }