Exemple #1
0
    public void DeleteAmit()
    {
        User        user        = new User().GetUserByEmail("*****@*****.**");
        ScholarUser scholarUser = sdbs.GetUserByName("amit rechavi");

        if (scholarUser != null)
        {
            sdbs.RemoveScholarUser(scholarUser.Id);
        }
        db.RemoveEntity(user);
        //Remove from Scholar
    }
Exemple #2
0
    //--------------------------------------------------------------------------
    //--------------------------------------------------------------------------
    public string FindUserAutomatically(string name, string email)
    {
        try
        {
            //User user = js.Deserialize<User>(userString);
            User user = new global::User().GetUserByEmail(email);
            //user.FixNulls();
            //user.InsertUserToDatabase();
            //user = user.GetUserByEmail(user.Email);
            // user.GetFullInfo();
            //div_res.InnerText =  py.GetPath();
            //div_res.InnerHtml = py.Run_cmd("InsertUser.py", "Noga alon");

            ScholarDBServices sdbs  = new ScholarDBServices();
            ScholarUser       sUser = sdbs.GetUserByName(user.Name);
            if (sUser == null)
            {
                PythonServices py = new PythonServices();
                py.Run_cmd("InsertUser.py", user.Name);
                sUser = sdbs.GetUserByName(user.Name);
            }
            sdbs.IntegrateIntoUser(sUser.Id, user.Id);
            user = user.GetUserById(user.Id);
            //string res = user.InsertUserToDatabase().ToString();
            user = user.Relog();
            JavaScriptSerializer js = new JavaScriptSerializer();
            return(js.Serialize(user));

            // PythonServices py = new PythonServices();
            //  User user = new global::User("amit", " ", "rechavi", null);
        }
        catch (Exception ex)
        {
            LogManager.Report(ex);
            return(ex.ToString());
        }
    }