Ejemplo n.º 1
0
        public ActionResult Register(UserModal um)
        {
            var mongoClient = new MongoClient("Server=localhost:27017");
            var mongoServer = mongoClient.GetServer();
            var db          = mongoServer.GetDatabase("hntsprt");
            MongoCollection <BsonDocument> userDetails    = db.GetCollection <BsonDocument>("users");
            MongoCollection <BsonDocument> ProfileDetails = db.GetCollection <BsonDocument>("profiledets");
            MongoCollection <BsonDocument> memdets        = db.GetCollection <BsonDocument>("memdets");
            profileModal pr = new profileModal();
            memModal     tm = new memModal();

            pr.userName = um.userName;
            pr.email    = um.email;
            tm.userName = um.userName;
            tm.email    = um.email;
            userDetails.Insert(um);
            ProfileDetails.Insert(pr);
            memdets.Insert(tm);
            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult membership()
        {
            var          mongoClient = new MongoClient("Server=localhost:27017");
            var          mongoServer = mongoClient.GetServer();
            var          db          = mongoServer.GetDatabase("hntsprt");
            var          collection2 = db.GetCollection <BsonDocument>("memdets");
            String       name        = Session["user"].ToString();
            var          query1      = new QueryDocument("userName", name);
            BsonDocument prod        = collection2.FindOne(query1);
            memModal     tm          = new memModal();

            tm.userName    = prod.GetElement("userName").Value.ToString();
            tm.email       = prod.GetElement("email").Value.ToString();
            tm.teamtype    = prod.GetElement("teamtype").Value.ToString();
            tm.sporttype   = prod.GetElement("sporttype").Value.ToString();
            tm.teamname    = prod.GetElement("teamname").Value.ToString();
            tm.teamsite    = prod.GetElement("teamsite").Value.ToString();
            tm.teamsocial  = prod.GetElement("teamsocial").Value.ToString();
            tm.teamcountry = prod.GetElement("teamcountry").Value.ToString();
            tm.p_name      = prod.GetElement("p_name").Value.ToString();
            tm.p_email     = prod.GetElement("p_email").Value.ToString();
            tm.p_mobile    = prod.GetElement("p_mobile").Value.ToString();
            return(View(tm));
        }