Exemple #1
0
    /// <summary>
    /// Function : ancLogin_click
    /// Description :This is the User Defined Function for Checking Login User
    /// Inputs : sender, eventArgs
    /// <return>
    /// output : N/A
    /// </return>
    /// </summary>
    protected void lnkLogin_click(object sender, EventArgs e)
    {
        User objUser = new UserFacade().CheckLogin(txtEmailOrPhone.Value.Trim(), txtLoginPassword.Value.Trim());
        if (objUser != null)
        {
            SessionManager.LoggedInUser = objUser;

            Session["LoginId"] = objUser.LoginId;
            Session["UserId"] = objUser.UserId;
            Session["UserImage"] = objUser.UserImage;
            Session["Name"] = objUser.FirstName + " " + objUser.LastName;
            if (chkRememberMe.Checked == true)
                SaveLoginCookie();
            else
                DeleteLoginCookie();

            //if (ChatControl.CurrentChatSession != null)
            //{
            //    ChatControl.StopSession();
            //}

            //ChatControl.StartSession(SessionManager.LoggedInUser.LoginId, SessionManager.LoggedInUser.FirstName + " " + SessionManager.LoggedInUser.LastName, SessionManager.LoggedInUser.UserImage);

            Response.Redirect("NewsFeed.aspx");
        }
        else
        {
            lblErrMsg.Text = "Invalid User.";
        }
    }
Exemple #2
0
 public static User[] GetAllFriendRequests(string timestamp)
 {
     IList<User> objUsers = null;
     try
     {
         objUsers = new List<User>();
         objUsers = new UserFacade().GetAllFriendRequests(new Guid(HttpContext.Current.Session["UserId"].ToString()));
     }
     catch
     { }
     return objUsers != null ? objUsers.ToArray() : null;
 }
Exemple #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     BasePage objBasePage = (BasePage)this.Page;
     if (objBasePage != null)
     {
         string PageModule = objBasePage.CurrentModule.ToString();
         if (PageModule.ToLower() == "wall")
         {
             if (Request["UserId"] != null && CommonFunctions.GetStringValue(Request["UserId"]) != null)
             {
                 string UserId = CommonFunctions.GetStringValue(Request["UserId"]);
                 User objUser = new UserFacade().GetProfileByUserId(new Guid(UserId));
                 if (objUser != null)
                 {
                     imgProgile.Src = "../getImage.aspx?image=Data/ProfileImages/" + objUser.UserImage + "&height=80&width=80&Aspect=true&type=1&bgc=FFFFFF";
                     lblName.Text = objUser.FirstName + " " + objUser.LastName;
                     lblGender.Text = objUser.Gender == "1" ? "Male" : "Female";
                     lblCity.Text = objUser.City;
                 }
             }
             else
             {
                 if (SessionManager.LoggedInUser != null)
                 {
                     imgProgile.Src = "../getImage.aspx?image=Data/ProfileImages/" + SessionManager.LoggedInUser.UserImage + "&height=80&width=80&Aspect=true&type=1&bgc=FFFFFF";
                     lblName.Text = SessionManager.LoggedInUser.FirstName + " " + SessionManager.LoggedInUser.LastName;
                     lblGender.Text = SessionManager.LoggedInUser.Gender == "1" ? "Male" : "Female";
                     lblCity.Text = SessionManager.LoggedInUser.City;
                     //lblState.Text = objUser.State;
                 }
             }
         }
         else
         {
             if (SessionManager.LoggedInUser != null)
             {
                 imgProgile.Src = "../getImage.aspx?image=Data/ProfileImages/" + SessionManager.LoggedInUser.UserImage + "&height=80&width=80&Aspect=true&type=1&bgc=FFFFFF";
                 lblName.Text = SessionManager.LoggedInUser.FirstName + " " + SessionManager.LoggedInUser.LastName;
                 lblGender.Text = SessionManager.LoggedInUser.Gender == "1" ? "Male" : "Female";
                 lblCity.Text = SessionManager.LoggedInUser.City;
                 //lblState.Text = objUser.State;
             }
         }
     }
 }
Exemple #4
0
 void GetUserDetailsById(string UserId)
 {
     User objUser = new UserFacade().GetProfileByUserId(new Guid(UserId));
     if (objUser != null)
     {
         lblName.Text = objUser.FirstName + " " + objUser.LastName;
         lblEmail.Text = objUser.EmailId == "" ? "-N/A-" : objUser.EmailId;
         lblGender.Text = (objUser.Gender == "1") ? "Male" : "Female";
         lblDescription.Text = objUser.Description == "" ? "-N/A-" : objUser.Description;
         lblStudiedAt.Text = objUser.CollegeAt == "" ? "-N/A-" : objUser.CollegeAt;
         lblDesignation.Text = objUser.Designation == "" ? "-N/A-" : objUser.Designation;
         lblUserCode.Text = String.IsNullOrWhiteSpace(objUser.UserCode) ? "-N/A-" : objUser.UserCode;
         lblWorksAt.Text = objUser.WorkAt == "" ? "-N/A-" : objUser.WorkAt;
         lblDOB.Text = objUser.DOB.ToString("MMM dd, yyyy");
         lblAddress.Text = objUser.Address == "" ? "-N/A-" : objUser.Address;
         lblCity.Text = objUser.City == "" ? "-N/A-" : objUser.City;
         lblState.Text = objUser.State == "" ? "-N/A-" : objUser.State;
         lblCountry.Text = objUser.Country == "" ? "-N/A-" : objUser.Country;
     }
 }
Exemple #5
0
    protected void lnkUpdate_Click(object sender, EventArgs e)
    {
        int retvalue = 0;
        User objUser = new User();
        objUser.UserId = SessionManager.LoggedInUser.UserId;
        objUser.FirstName = txtFirstName.Text.Trim();
        objUser.LastName = txtLastName.Text.Trim();
        objUser.EmailId = txtEmail.Text.Trim();
        objUser.Designation = txtDesignation.Text.Trim();
        objUser.DOB = Convert.ToDateTime(hdnDate.Value);
        objUser.WorkAt = txtWorkAt.Text.Trim();
        objUser.CollegeAt = txtCollegeAt.Text.Trim();
        objUser.SchoolAt = txtSchoolAt.Text.Trim();

        if (rbMale.Checked)
            objUser.Gender = "1";
        else if (rbFemale.Checked)
            objUser.Gender = "2";
        else
            objUser.Gender = "0";

        objUser.UserImage = hdnImage.Value;
        objUser.About = txtAbout.Text.Trim();
        objUser.Description = txtDescription.Text.Trim();
        objUser.Address = txtAddress.Text.Trim();
        objUser.City = txtCity.Text.Trim();
        objUser.State = txtState.Text.Trim();
        objUser.Country = txtCountry.Text.Trim();
        objUser.UserCode = txtUserCode.Text.Trim().ToUpper();

        retvalue = new UserFacade().UpdateUser(objUser);

        SaveWidgets();

        if (retvalue > 0)
        {
            SessionManager.LoggedInUser = objUser;
            Response.Redirect("UserInfo.aspx");
        }
    }
Exemple #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserId"] != null && Session["LoginId"] != null && Session["Name"] != null)
        {
            LoggedInUserId = SessionManager.LoggedInUser.UserId.ToString();

            if (Request["UserId"] != null)
            {
                SelectedUserId = Request["UserId"].ToString();
                User objUser = new UserFacade().GetProfileByUserId(new Guid(SelectedUserId));
                if (objUser != null)
                {
                    hdnUserImage.Value = objUser.UserImage;
                    hdnUserName.Value = objUser.FirstName + " " + objUser.LastName;
                }
            }
            else
            {
                SelectedUserId = Session["UserId"].ToString();
                hdnUserImage.Value = SessionManager.LoggedInUser.UserImage;
                hdnUserName.Value = Session["Name"].ToString();
            }
        }
        else
            Response.Redirect("../Default.aspx");
    }
Exemple #7
0
 public static User[] GetAllNonFriends(string timestamp, string SearchString)
 {
     IList<User> objUsers = null;
     try
     {
         if (SearchString != "1=1")
             SearchString = "FirstName like '%" + SearchString + "%' OR LastName like '%" + SearchString + "%'";
         objUsers = new UserFacade().GetAllUsersExcludingFriends(new Guid(HttpContext.Current.Session["UserId"].ToString()), 0, 20, SearchString, "FirstName ASC");
     }
     catch
     { }
     return objUsers != null ? objUsers.ToArray() : null;
 }