Beispiel #1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        BasicInfoBO objBasicInfo = new BasicInfoBO();

        objBasicInfo.UserId = Userid;
        objBasicInfo.CityTown = txtTownCity.Text;
        objBasicInfo.Address = txtAddress.Text;
        objBasicInfo.ZipCode = txtZipCode.Text;
        objBasicInfo.Neighbourhood = txtNeighbourhood.Text;

        BasicInfoBLL.updateContactInfoPage(objBasicInfo);
        UpdateEmail();
        LoadContactInfo();

        PostProperties postProp = new PostProperties();
        postProp.PostText = Global.POST_CHANGED_CONTACT_INFO;
        postProp.WallOwnerUserId = Userid;
        postProp.PostedByUserId = Userid;
        postProp.PostType = Global.PROFILE_CHANGE;
        postProp.EmbedPost = null;
        PostOnWall.post(postProp);

        imgSave.Visible = true;
        lblSave.Visible = true;
    }
Beispiel #2
0
        public static void insertBasicInfo(BasicInfoBO objClass)
        {
            MongoCollection<BsonDocument> objCollection = db.GetCollection<BsonDocument>("c_BasicInfo");

            BsonDocument doc = new BsonDocument {
                      { "UserId" , ObjectId.Parse(objClass.UserId)},
                       { "CurrentCity" , objClass.CurrentCity },
                       { "HomeTown", objClass.HomeTown },
                        { "Address", objClass.Address },
                        { "CityTown", objClass.CityTown },
                        { "ZipCode", objClass.ZipCode },
                        { "Neighbourhood", objClass.Neighbourhood },
                        { "RelationshipStatus" , objClass.RelationshipStatus }

                        };

            var rt = objCollection.Insert(doc);
        }
Beispiel #3
0
        public static BasicInfoBO getBasicInfoByUserId(string UserId)
        {
            MongoCollection<BasicInfo> objCollection = db.GetCollection<BasicInfo>("c_BasicInfo");

            BasicInfoBO objClass = new BasicInfoBO();
            foreach (BasicInfo item in objCollection.Find(Query.EQ("UserId", ObjectId.Parse(UserId))).SetLimit(1))
            {
                objClass.Id = item._id.ToString();
                objClass.UserId = item.UserId.ToString();
                objClass.CurrentCity = item.CurrentCity;
                objClass.HomeTown = item.HomeTown;
                objClass.Address = item.Address;
                objClass.CityTown = item.CityTown;
                objClass.ZipCode = item.ZipCode;
                objClass.Neighbourhood = item.Neighbourhood;
                objClass.RelationshipStatus = item.RelationshipStatus;
                break;
            }
            return objClass;
        }
Beispiel #4
0
        public static void updateBasicInfo(BasicInfoBO objClass)
        {
            MongoCollection<BasicInfo> objCollection = db.GetCollection<BasicInfo>("c_BasicInfo");

            var query = Query.EQ("_id", ObjectId.Parse(objClass.Id));
            var sortBy = SortBy.Descending("_id");
            var update = Update.Set("UserId", ObjectId.Parse(objClass.UserId))
                                .Set("CurrentCity", objClass.CurrentCity)
                                 .Set("HomeTown", objClass.HomeTown)
                                 .Set("Address", objClass.Address)
                                .Set("CityTown", objClass.CityTown)
                                .Set("ZipCode", objClass.ZipCode)
                                 .Set("RelationshipStatus", objClass.RelationshipStatus)
                                .Set("Neighbourhood", objClass.Neighbourhood)

                                ;
            var result = objCollection.FindAndModify(query, sortBy, update, true);
        }
Beispiel #5
0
        public static void updateFamilyPage(BasicInfoBO objClass)
        {
            MongoCollection<BsonDocument> objDocCollection = db.GetCollection<BsonDocument>("c_BasicInfo");

            var query = Query.EQ("UserId", ObjectId.Parse(objClass.UserId));
            var result = objDocCollection.Find(query);
            if (result.Any())
            {

                MongoCollection<BasicInfo> objCollection = db.GetCollection<BasicInfo>("c_BasicInfo");

                var equery = Query.EQ("UserId", ObjectId.Parse(objClass.UserId));
                var sortBy = SortBy.Descending("UserId");
                var update = Update.Set("UserId", ObjectId.Parse(objClass.UserId))
                                    .Set("RelationshipStatus", objClass.RelationshipStatus);
                var eresult = objCollection.FindAndModify(equery, sortBy, update, true);

            }
            else
            {

                BsonDocument doc = new BsonDocument {
                      { "UserId" ,ObjectId.Parse(objClass.UserId) },
                       { "CurrentCity" ,"" },
                       { "HomeTown", "" },
                        { "Address", "" },
                        { "CityTown", "" },
                        { "ZipCode", "" },
                        { "Neighbourhood","" },
                        { "RelationshipStatus" ,objClass.RelationshipStatus }

                        };

                var rt = objDocCollection.Insert(doc);

            }
        }
Beispiel #6
0
 protected void LoadUser()
 {
     BasicInfoBO objBasicInfo = new BasicInfoBO();
     objBasicInfo = BasicInfoBLL.getBasicInfoByUserId(userid);
     lblHomeTown.Text = objBasicInfo.HomeTown;
     lblCurrentCity.Text = objBasicInfo.CurrentCity;
 }
Beispiel #7
0
    public string GetDynamicContent(string contextKey)
    {
        MongoCollection<User> objCollection = BaseClass.db.GetCollection<User>("c_User");

        UserBO objClass = new UserBO();
        foreach (User item in objCollection.Find(Query.EQ("_id", ObjectId.Parse(contextKey))))
        {
            objClass.Id = item._id.ToString();
            objClass.Email = item.Email.ToString();
            objClass.UserName = item.UserName;
            objClass.Password = item.Password;
            objClass.FirstName = item.FirstName;
            objClass.DateOfBirth = item.DateOfBirth;
            objClass.LastName = item.LastName;
            objClass.PhoneNumber = item.PhoneNumber;
            objClass.PasswordResetCode = item.PasswordResetCode;
            objClass.IsMobileAlert = item.IsMobileAlert;
            objClass.PhoneNumber = item.PhoneNumber;
            objClass.Gender = item.Gender;
            objClass.UserStatus = item.UserStatus;
            break;
        }
        MongoCollection<BasicInfo> objCollection2 = BaseClass.db.GetCollection<BasicInfo>("c_BasicInfo");

        BasicInfoBO objClassBasicInfo = new BasicInfoBO();
        foreach (BasicInfo item in objCollection2.Find(Query.EQ("UserId", ObjectId.Parse(contextKey))).SetLimit(1))
        {
            objClassBasicInfo.Id = item._id.ToString();
            objClassBasicInfo.UserId = item.UserId.ToString();
            objClassBasicInfo.CurrentCity = item.CurrentCity;
            objClassBasicInfo.HomeTown = item.HomeTown;
            objClassBasicInfo.Address = item.Address;
            objClassBasicInfo.CityTown = item.CityTown;
            objClassBasicInfo.ZipCode = item.ZipCode;
            objClassBasicInfo.Neighbourhood = item.Neighbourhood;
            objClassBasicInfo.RelationshipStatus = item.RelationshipStatus;
            break;
        }
        StringBuilder b = new StringBuilder();
        b.Append("<table ");
        b.Append("width:200px; font-size:10pt; font-family:Verdana;' cellspacing='0' cellpadding='3'>");

          //  b.Append("<tr><td colspan='3' style='background-color:#336699; color:white;'></td>View Post</tr>");
        b.Append("<tr><td><img src='../../Resources/ProfilePictures/" +contextKey+".jpg' width='50px'/> </td></tr>");
        b.Append("<tr><td><b>" + objClass.FirstName + " " + objClass.LastName + "</b> </td></tr>");
        b.Append("<tr><td>" + objClass.DateOfBirth.ToLongDateString() + " </td></tr>");
        b.Append("<tr><td>" + objClass.Gender + " </td></tr>");
        b.Append("<tr><td>" + objClassBasicInfo.CurrentCity + " </td></tr>");
        // b.Append("<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl='../../Resources/CompressedVideo/play.png' Visible='<%# (((int)Eval("Type")) == Global.VIDEO)||(((int)Eval("Type")) == Global.TAG_VIDEOLINK)||(((int)Eval("Type")) == Global.TAG_VIDEO)||(((int)Eval("Type")) == Global.POST_VIDEOLINK)?true:false %>' CommandName="show" style='<%# "background:url(" +Eval("EmbedPost") + ")" %>'  />

        b.Append("</table>");

        return b.ToString();
    }
Beispiel #8
0
    protected void LoadContactInfo()
    {
        BasicInfoBO objBasicInfo = new BasicInfoBO();
        objBasicInfo = BasicInfoBLL.getBasicInfoByUserId(Userid);

        txtTownCity.Text = objBasicInfo.CityTown;
        txtAddress.Text = objBasicInfo.Address;
        txtZipCode.Text = objBasicInfo.ZipCode;
        txtNeighbourhood.Text = objBasicInfo.Neighbourhood;
        UserBO userObj= new UserBO();
        userObj = UserBLL.getUserByUserId(Userid);
        txtPrimaryEmail.Text = userObj.Email;
    }
Beispiel #9
0
    protected void LoadContactInfo()
    {
        BasicInfoBO objBasicInfo = new BasicInfoBO();
        objBasicInfo = BasicInfoBLL.getBasicInfoByUserId(Userid);

        lblTownCity.Text = objBasicInfo.CityTown;
        if (lblTownCity.Text == "")
        {
            lblTownCity.Visible = false;
            lblTownCiylabel.Visible = false;
        }
        lblAddress.Text = objBasicInfo.Address;
        if (lblAddress.Text == "")
        {
            lblAddress.Visible = false;
            lblAddressLabel.Visible = false;
        }
        lblZipCode.Text = objBasicInfo.ZipCode;
        if (lblZipCode.Text == "")
        {
            lblZipCode.Visible = false;
            lblZipCodeLabel.Visible = false;
        }
        lblNeighbourhood.Text = objBasicInfo.Neighbourhood;
        if (lblNeighbourhood.Text == "")
        {
            lblNeighbourhood.Visible = false;
            lblNeighbourhoodLabel.Visible = false;
        }
        lblRelationshipStatus.Text = objBasicInfo.RelationshipStatus;
        //UserBO userObj= new UserBO();
        // userObj = UserBLL.getUserByUserId(userid);
        // txtPrimaryEmail.Text = userObj.Email;
    }