Ejemplo n.º 1
1
        public bool Delete(User user, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_UserDelete");

            db.AddInParameter(command, "UpdatedBy", DbType.Guid, user.UpdatedBy);
            db.AddInParameter(command, "UserId", DbType.Guid, user.UserId);

            db.ExecuteNonQuery(command, transaction);

            user.UpdatedDate = Convert.ToDateTime(db.GetParameterValue(command, "UpdatedDate").ToString());

            return true;
        }
        public void loaddata()
        {
            User user = new User();
            if (Membership.GetUser() == null)
            {
                CreateCurrentHouseButton.Visible =
                    ViewCurrentHouseButton.Visible =
                    UpdateCurrentHouseButton.Visible =
                    LeaveCurrentHouseButton.Visible = false;
                return;
            }

            user = RHP.UserManagement.User.Select(Guid.Parse(Membership.GetUser().ProviderUserKey.ToString()));
            if (user.HouseId != null || user.BaseHouseRoomId != null)
            {
                CreateCurrentHouseButton.Visible = false;
                ViewCurrentHouseButton.Visible = true;
                UpdateCurrentHouseButton.Visible = true;
                LeaveCurrentHouseButton.Visible = true;

                if (user.BaseHouseRoomId != null)
                {
                    UpdateCurrentHouseButton.Visible = false;
                    ViewCurrentHouseButton.Visible = false;
                }

            }
            else
            {
                CreateCurrentHouseButton.Visible = true;
                ViewCurrentHouseButton.Visible = false;
                UpdateCurrentHouseButton.Visible = false;
                LeaveCurrentHouseButton.Visible = false;
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            LeftMenuBar.Items.Clear();
            LeftMenuBar.Items.Add(new MenuItem("Profile", "ProfileinfoID", "", "~/Student/Student_Profile.aspx"));

            _user = User.Select(Guid.Parse(Membership.GetUser().ProviderUserKey.ToString()));
            if (_user.HouseId != null)
            {
                LeftMenuBar.Items.Add(new MenuItem("Current Residence", "CurrentHouseID", "", "~/Student/Current_House.aspx"));
            }
            else
            {
                LeftMenuBar.Items.Add(new MenuItem("Current Residence", "CurrentHouseID", "", "~/Student/Current_House.aspx"));
            }

            LeftMenuBar.Items.Add(new MenuItem("Profile Info", "ProfileID", "", "~/Student/Student_Profile_Edit.aspx"));
            LeftMenuBar.Items.Add(new MenuItem("School Info", "SchoolinfoID", "", "~/Student/Student_School_info.aspx"));
            LeftMenuBar.Items.Add(new MenuItem("Spotlight", "SpotlightID", "", "~/Student/Student_Spotlight.aspx"));

            if (user.IsFBUser == true)
            {

            }
            else
            {
                LeftMenuBar.Items.Add(new MenuItem("Password", "ChangePasswordID", "", "~/Student/Change_Password.aspx"));
                LeftMenuBar.Items.Add(new MenuItem("Secret Question", "ChangeSecretQuestionID", "", "~/Student/Change_Secret_Question.aspx"));
            }

            LeftMenuBar.Items.Add(new MenuItem("Contact Us", "ContactUsID", "", "~/Student/Contact_Us.aspx"));
        }
Ejemplo n.º 4
0
        public void LoadLeaveCurrentHouseRequest(Guid HouseId)
        {
            StudentHouseLeave studentHouseLeave = new StudentHouseLeave();

            studentHouseLeave = StudentHouseLeave.SelectByHouseId(HouseId, Guid.Parse(Membership.GetUser().ProviderUserKey.ToString()));

            if ((studentHouseLeave.RequestBy != null && studentHouseLeave.RequestBy != Guid.Empty) && studentHouseLeave.status == 0)
            {
                RHP.UserManagement.User _RequestedUser = RHP.UserManagement.User.Select(studentHouseLeave.RequestBy);

                // Photo photo = new Photo();
                // RequestedUser.ImageUrl = photo.LoadImage(studentHouseLeave.RequestBy, Enums.PhotoCategory.Profile_Picture);

                RequestedUser.Text     = _RequestedUser.FirstName + " " + _RequestedUser.LastName;
                RequestedUserName.Text = _RequestedUser.FirstName + " " + _RequestedUser.LastName;

                RequestedUser.NavigateUrl = "~/Student/Student_Public_Profile.aspx?AccessCode=" + studentHouseLeave.RequestBy;

                RespondeToLeaveHouseTrue.Visible = true;
            }
            else
            {
                RespondeToLeaveHouseFalse.Visible = true;
            }
        }
Ejemplo n.º 5
0
        protected void RequestLeaveCurrentHouse_Command(object sender, CommandEventArgs args)
        {
            string userid = (string)args.CommandArgument;

            RHP.UserManagement.User _user = new RHP.UserManagement.User();

            _user = RHP.UserManagement.User.Select(Guid.Parse(userid));

            StudentHouseLeave studentHouseLeave = new StudentHouseLeave();

            studentHouseLeave.RequestBy = Guid.Parse(Membership.GetUser().ProviderUserKey.ToString());
            studentHouseLeave.RequestTo = Guid.Parse(userid);
            studentHouseLeave.HouseId   = _user.HouseId.Value;
            studentHouseLeave.status    = 0;

            studentHouseLeave.Save();

            string strMsgContent = message(_user);

            string strMsgTitle = "www.ratemystudenthome.com is Requesting you to Leave Current Residence.";

            int rtn = SendEmail(_user.PersonalEmail, strMsgTitle, strMsgContent);

            Page.ClientScript.RegisterStartupScript(this.GetType(), "Redirect", "window.onload = function(){ alert('" + Messages.LeaveCurrentHouseRequestSuccess + "'); window.location = '/Student/Student_Profile_Leave_Current_House.aspx';}", true);
        }
        // Edit house
        public void LoadHouseData(User user_)
        {
            if (user_.HouseId != null)
            {
                House house = House.Select(user_.HouseId.Value);

                if (house != null)
                {
                    if (house.IsPartialHouse == true)
                    {
                        HouseInfoEditLink.Visible = true;
                    }
                    else
                    {
                        HouseInfoEditLink.Visible = true;
                    }

                    if (house.StateId.HasValue)
                    {
                        State state;
                        state = Generic.Get<State>(house.StateId.Value);
                        if (state != null)
                        {
                            State.Text = state.StateName;
                        }
                    }
                    //State.Text = house.StateId.ToString().ToLower();
                    Address.Text = house.StreetAddress;
                    City.Text = house.City;
                    Zip.Text = house.Zip;
                }
            }
        }
        public void LoadHouseData(User user_)
        {
            House house = null;
            if (user_.HouseId != null)
            {
                house = House.Select(user_.HouseId.Value);
            }
            else if (user_.BaseHouseRoomId != null)
            {
                house = House.SelectByRoomId(user_.BaseHouseRoomId.Value);
            }

            if (house != null)
            {
                if (house.StateId.HasValue)
                {
                    State state;
                    state = Generic.Get<State>(house.StateId.Value);
                    if (state != null)
                    {
                        State.Text = state.StateName;
                    }
                }
                //State.Text = house.StateId.ToString().ToLower();
                Address.Text = house.StreetAddress;
                City.Text = house.City;
                Zip.Text = house.Zip;
            }
        }
Ejemplo n.º 8
0
        public string getUserData()
        {
            // user data
            user = User.Select(Guid.Parse(Membership.GetUser().ProviderUserKey.ToString()));

            string name = (string.IsNullOrEmpty(user.FirstName) ? string.Empty : user.FirstName + " ") + (string.IsNullOrEmpty(user.MiddleName) ? string.Empty : user.MiddleName + " ") + (string.IsNullOrEmpty(user.LastName) ? string.Empty : user.LastName);
            return name;
        }
        public void LoadUserData()
        {
            // user data
            user = User.Select(Guid.Parse(Membership.GetUser().ProviderUserKey.ToString()));

               // user.UserId = Guid.Parse(Membership.GetUser().ProviderUserKey.ToString());
               // user.AspnetUserId = Guid.Parse(Membership.GetUser().ProviderUserKey.ToString());
            FirstName.Text = string.IsNullOrEmpty(user.FirstName) ? string.Empty : user.FirstName;
            MiddleName.Text = string.IsNullOrEmpty(user.MiddleName) ? string.Empty : user.MiddleName;
            LastName.Text = string.IsNullOrEmpty(user.LastName) ? string.Empty : user.LastName;
            Email.Text = string.IsNullOrEmpty(Membership.GetUser().Email.ToString()) ? string.Empty : Membership.GetUser().Email.ToString();
            Address.Text = string.IsNullOrEmpty(user.StreetAddress) ? string.Empty : user.StreetAddress;
            City.Text = string.IsNullOrEmpty(user.City) ? string.Empty : user.City;
            Zip.Text = string.IsNullOrEmpty(user.Zip) ? string.Empty : user.Zip;

            //if (user.DateOfBirth.HasValue)
            //{
            //    DateTime DOB_ = user.DateOfBirth.Value;

            //}
            DOB.Text = string.IsNullOrEmpty(user.DateOfBirth.ToString()) ? string.Empty : user.DateOfBirth.Value.ToShortDateString();

            MobileArea.Text = string.IsNullOrEmpty(user.BestContactNumber) ? string.Empty : user.BestContactNumber.Substring(0, 3);
            Mobile1.Text = string.IsNullOrEmpty(user.BestContactNumber) ? string.Empty : user.BestContactNumber.Substring(3, 3);
            Mobile2.Text = string.IsNullOrEmpty(user.BestContactNumber) ? string.Empty : user.BestContactNumber.Substring(6, 4);

               // Mobile.Text = string.IsNullOrEmpty(user.BestContactNumber) ? string.Empty : user.BestContactNumber;

               // DriversLicense.Text = string.IsNullOrEmpty(user.DriversLicenseNumber) ? string.Empty : user.DriversLicenseNumber;

            if (user.StateId.HasValue)
            {
                for (int i = 0; i < Drpstate.Items.Count; i++)
                {
                    if (Drpstate.Items[i].Value.ToString().ToLower() == user.StateId.ToString().ToLower())
                    {
                        Drpstate.ClearSelection();
                        Drpstate.Items[i].Selected = true;
                    }
                }
            }

            if (!string.IsNullOrEmpty(user.Gender))
            {
                for (int i = 0; i < DrpGender.Items.Count; i++)
                {
                    if (DrpGender.Items[i].Value.ToString().ToLower() == user.Gender.ToLower())
                    {
                        DrpGender.ClearSelection();
                        DrpGender.Items[i].Selected = true;
                    }
                }

            }
        }
        public bool checkPartialEmail()
        {
            bool isEmailEsixt = false;
            User user_check = new User();

            if (user_check.IsUserEmailExist(txtEmail.Text.Trim().ToLower()))
            {
                isEmailEsixt = true;
            }

            return isEmailEsixt;
        }
        public void loadUser()
        {
            User user = new User();

             user = User.Select(Guid.Parse(Membership.GetUser().ProviderUserKey.ToString()));
             if (user != null)
            {
                 if (user.UserId.HasValue)
                 {
                     ProfileUserName.Text = user.FirstName + " " + user.LastName;
                     ProfileUserName.NavigateUrl = "~/Student/Student_Profile.aspx";
                 }
            }
        }
 public void LoadStudent(Guid AccessCode)
 {
     user = User.Select(AccessCode);
     if (user != null)
     {
         if (user.UserId.HasValue && user.IsPartialUser == true)
         {
             Email.Text = user.PersonalEmail;
             FirstName.Text = string.IsNullOrEmpty(user.FirstName) ? string.Empty : user.FirstName;
             MiddleName.Text = string.IsNullOrEmpty(user.MiddleName) ? string.Empty : user.MiddleName;
             LastName.Text = string.IsNullOrEmpty(user.LastName) ? string.Empty : user.LastName;
         }
     }
 }
        public void LoadStudent(Guid AccessCode)
        {
            user = User.Select(AccessCode);

            if (user != null)
            {
                if (user.UserId.HasValue && user.IsPartialUser == true)
                {
                    hdnUserId.Value = user.UserId.ToString();
                    txtDateofBirth.Text = Convert.ToDateTime(user.DateOfBirth.ToString()).ToShortDateString();
                    txtEmail.Text = user.PersonalEmail;
                    txtFirstName.Text = string.IsNullOrEmpty(user.FirstName) ? string.Empty : user.FirstName;
                    txtLastName.Text = string.IsNullOrEmpty(user.LastName) ? string.Empty : user.LastName;
                }
            }
        }
Ejemplo n.º 14
0
        public void LoadStudent()
        {
            user = User.Select(Guid.Parse(Membership.GetUser().ProviderUserKey.ToString()));

            if (user.HouseId.HasValue)
            {

                //user.HouseId = Guid.Parse("8313D02D-FA75-474A-A93B-0EFD3B817A83");
                List<User> userList = User.SelectUserByHouseId("HouseId", user.HouseId.Value, "RoleName", "student");

                DataListCurrentHomeStudent.DataSource = userList;
                DataListCurrentHomeStudent.DataBind();

                if (userList.Count > 0)
                { currentHomeStudentData.Visible = true; }
            }
        }
Ejemplo n.º 15
0
        protected void EditPartialUser_Command(object sender, CommandEventArgs args)
        {
            string userid = (string)args.CommandArgument;

            hdroommatestatus.Value  = "Edit";
            CurrentDetails.Visible  = true;
            RoomMateInfoHeader.Text = "Room-Mate Info - Edit";
            RHP.UserManagement.User _user = new RHP.UserManagement.User();
            hdUserID.Value = userid;

            SaveNewStudent.Visible  = false;
            SaveEditStudent.Visible = true;

            _user = RHP.UserManagement.User.Select(Guid.Parse(userid));

            if (_user.IsPartialUser == true && (_user.AspnetUserId == null || _user.AspnetUserId == Guid.Empty))
            {
                EditPartialUserName.Text    = (string.IsNullOrEmpty(_user.FirstName) ? string.Empty : _user.FirstName) + " " + (string.IsNullOrEmpty(_user.LastName) ? string.Empty : _user.LastName);
                hdEditPartialUserName.Value = EditPartialUserName.Text;

                EditPartialUserEmail.Text    = string.IsNullOrEmpty(_user.PersonalEmail) ? string.Empty : _user.PersonalEmail;
                hdEditPartialUserEmail.Value = EditPartialUserEmail.Text;

                EditPartialUserCurrent.Text    = string.IsNullOrEmpty(_user.BestContactNumber) ? string.Empty : _user.BestContactNumber;
                hdEditPartialUserCurrent.Value = EditPartialUserCurrent.Text;

                RoommateAdd.Visible = true;

                Email.Text      = string.IsNullOrEmpty(_user.PersonalEmail) ? string.Empty : _user.PersonalEmail;
                FirstName.Text  = string.IsNullOrEmpty(_user.FirstName) ? string.Empty : _user.FirstName;
                MiddleName.Text = string.IsNullOrEmpty(_user.MiddleName) ? string.Empty : _user.MiddleName;
                LastName.Text   = string.IsNullOrEmpty(_user.LastName) ? string.Empty : _user.LastName;

                MobileArea.Text = string.IsNullOrEmpty(_user.BestContactNumber) ? string.Empty : _user.BestContactNumber.Substring(0, 3);
                Mobile1.Text    = string.IsNullOrEmpty(_user.BestContactNumber) ? string.Empty : _user.BestContactNumber.Substring(3, 3);
                Mobile2.Text    = string.IsNullOrEmpty(_user.BestContactNumber) ? string.Empty : _user.BestContactNumber.Substring(6, 4);

                FirstName.Enabled  = true;
                MiddleName.Enabled = true;
                LastName.Enabled   = true;
                MobileArea.Enabled = true;
                Mobile1.Enabled    = true;
                Mobile2.Enabled    = true;
            }
        }
        public void LoadStudent(Guid AccessCode)
        {
            user = User.Select(AccessCode);

                if (user != null)
                {
                    if (user.HouseId.HasValue)
                    {
                        List<User> userList = User.SelectUserByHouseId("HouseId", user.HouseId.Value, "RoleName", "student");

                        DataListStudentList.DataSource = userList;
                        DataListStudentList.DataBind();

                        if (userList.Count > 0)
                        { currentHomeStudentData.Visible = true; }
                    }
                }
        }
Ejemplo n.º 17
0
        public void LoadLeaveCurrentRoomRequest(Guid roomId)
        {
            StudentHouseLeave studentHouseLeave = new StudentHouseLeave();

            studentHouseLeave = StudentHouseLeave.SelectByRoomId(roomId, Guid.Parse(Membership.GetUser().ProviderUserKey.ToString()));

            if ((studentHouseLeave.RequestBy != null && studentHouseLeave.RequestBy != Guid.Empty) && studentHouseLeave.status == 0)
            {
                RHP.UserManagement.User _RequestedUser = RHP.UserManagement.User.Select(studentHouseLeave.RequestBy);
                RequestedUser.Text               = _RequestedUser.FirstName + " " + _RequestedUser.LastName;
                RequestedUserName.Text           = _RequestedUser.FirstName + " " + _RequestedUser.LastName;
                RequestedUser.NavigateUrl        = "~/Student/Student_Public_Profile.aspx?AccessCode=" + studentHouseLeave.RequestBy + "&AccessCode2=" + roomId.ToString();
                RespondeToLeaveHouseTrue.Visible = true;
            }
            else
            {
                RespondeToLeaveHouseFalse.Visible = true;
            }
        }
        protected void BtnResentRequest_Click(object sender, EventArgs e)
        {
            User _user = new User();
            string type = "";
            _user = User.SelectUserByEmail("RoleName", "landlord", "Email", Email.Text.Trim().ToLower());

            if (_user != null)
            {
                type = "l";
            }
            else
            {
                _user = User.SelectUserByEmail("RoleName", "student", "Email", Email.Text.Trim().ToLower());
                if (_user != null)
                {
                    type = "s";
                }
            }

            if (_user != null)
            {
                if (_user.UserId.HasValue)
                {
                    string strMsgContent = PartialUserRequest(_user, type);

                    string strMsgTitle = SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + " is Requesting you to join with Us.";

                    int rtn = SendEmail(user.PersonalEmail, strMsgTitle, strMsgContent);

                    if (rtn == 1)
                    {
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "Redirect", "window.onload = function(){ alert('" + Messages.Request_Email_success + "'); window.location = '/Login.aspx?type=s'; }", true);

                    }
                    else
                    {
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "Redirect", "window.onload = function(){ alert('" + Messages.Sending_Email_Error + "'); window.location = '/Login.aspx?type=s'; }", true);

                    }
                }
            }
        }
Ejemplo n.º 19
0
        public bool Insert(User users, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_UserInsert");

            db.AddInParameter(command, "UserId", DbType.Guid, users.UserId);
            db.AddInParameter(command, "IsFBUser", DbType.Boolean, users.IsFBUser);
            db.AddInParameter(command, "AspnetUserId", DbType.Guid, users.AspnetUserId);
            db.AddInParameter(command, "IsPartialUser", DbType.Boolean, users.IsPartialUser);
            db.AddInParameter(command, "FBAccessToken", DbType.String, users.FBAccessToken);
            db.AddInParameter(command, "FBUrl", DbType.String, users.FBUrl);
            db.AddInParameter(command, "FBProfilePictureURL", DbType.String, users.FBProfilePictureURL);
            db.AddInParameter(command, "FirstName", DbType.String, users.FirstName);
            db.AddInParameter(command, "MiddleName", DbType.String, users.MiddleName);
            db.AddInParameter(command, "LastName", DbType.String, users.LastName);
            db.AddInParameter(command, "StreetAddress", DbType.String, users.StreetAddress);
            db.AddInParameter(command, "City", DbType.String, users.City);
            db.AddInParameter(command, "StateId", DbType.Int32, users.StateId);
            db.AddInParameter(command, "Zip", DbType.String, users.Zip);
            db.AddInParameter(command, "DateOfBirth", DbType.Date, users.DateOfBirth);
            db.AddInParameter(command, "BestContactNumber", DbType.String, users.BestContactNumber);
            db.AddInParameter(command, "DriversLicenseNumber", DbType.String, users.DriversLicenseNumber);

            db.AddInParameter(command, "Status", DbType.String, users.Status);//To be changed
            db.AddInParameter(command, "PersonalEmail", DbType.String, users.PersonalEmail);
            db.AddInParameter(command, "CreatedBy", DbType.Guid, users.CreatedBy);
            db.AddInParameter(command, "RatingValue", DbType.Decimal, users.RatingValue);
            db.AddInParameter(command, "FBid", DbType.String, users.FBid);
            db.AddInParameter(command, "Gender", DbType.String, users.Gender);
            db.AddInParameter(command, "HouseId", DbType.Guid, users.HouseId);
            db.AddInParameter(command, "RoleId", DbType.Guid, users.RoleId);
            db.AddInParameter(command, "ReferralCode", DbType.String, users.ReferralCode);

            db.AddOutParameter(command, "CreatedDate", DbType.DateTime, 30);

            db.ExecuteNonQuery(command, transaction);

            users.CreatedDate = Convert.ToDateTime(db.GetParameterValue(command, "CreatedDate").ToString());
            users.UpdatedDate = users.CreatedDate;

            return true;
        }
        public void LoadUserData()
        {
            // user data

            UserDAO userDAO = new UserDAO();

            user = User.Select(Guid.Parse(Membership.GetUser().ProviderUserKey.ToString()));

            if (user.HouseId != null)
            {

                Labelmessage.Text = "";//Current landload Details";
                DataSet LandlordData = userDAO.SelectLandlordByHouseId(user.HouseId.Value);

                if(LandlordData != null && LandlordData.Tables[0].Rows.Count > 0)
                {
                    PassID(Guid.Parse(LandlordData.Tables[0].Rows[0]["UserId"].ToString().Trim()));

                    ButtonVerify.Visible = false;
                    Email.Enabled = false;
                    FirstName.Text = string.IsNullOrEmpty(LandlordData.Tables[0].Rows[0]["FirstName"].ToString().Trim()) ? string.Empty : LandlordData.Tables[0].Rows[0]["FirstName"].ToString().Trim();
                    MiddleName.Text = string.IsNullOrEmpty(LandlordData.Tables[0].Rows[0]["MiddleName"].ToString().Trim()) ? string.Empty : LandlordData.Tables[0].Rows[0]["MiddleName"].ToString().Trim();
                    LastName.Text = string.IsNullOrEmpty(LandlordData.Tables[0].Rows[0]["LastName"].ToString().Trim()) ? string.Empty : LandlordData.Tables[0].Rows[0]["LastName"].ToString().Trim();
                    Email.Text = string.IsNullOrEmpty(LandlordData.Tables[0].Rows[0]["PersonalEmail"].ToString().Trim()) ? string.Empty : LandlordData.Tables[0].Rows[0]["PersonalEmail"].ToString().Trim();
                   // Mobile.Text = string.IsNullOrEmpty(LandlordData.Tables[0].Rows[0]["BestContactNumber"].ToString().Trim()) ? string.Empty : LandlordData.Tables[0].Rows[0]["BestContactNumber"].ToString().Trim();

                    MobileArea.Text = string.IsNullOrEmpty(LandlordData.Tables[0].Rows[0]["BestContactNumber"].ToString().Trim()) ? string.Empty : LandlordData.Tables[0].Rows[0]["BestContactNumber"].ToString().Substring(0, 3);
                    Mobile1.Text = string.IsNullOrEmpty(LandlordData.Tables[0].Rows[0]["BestContactNumber"].ToString().Trim()) ? string.Empty : LandlordData.Tables[0].Rows[0]["BestContactNumber"].ToString().Substring(3, 3);
                    Mobile2.Text = string.IsNullOrEmpty(LandlordData.Tables[0].Rows[0]["BestContactNumber"].ToString().Trim()) ? string.Empty : LandlordData.Tables[0].Rows[0]["BestContactNumber"].ToString().Substring(6, 4);

                }

            }
        }
        public void LoadLandlordData(User user_)
        {
            UserDAO userDAO = new UserDAO();

            if (user_.HouseId != null)
            {
                DataSet LandlordData = userDAO.SelectLandlordByHouseId(user.HouseId.Value);

                if (LandlordData != null && LandlordData.Tables[0].Rows.Count > 0)
                {
                    string FirstName = string.IsNullOrEmpty(LandlordData.Tables[0].Rows[0]["FirstName"].ToString().Trim()) ? string.Empty : LandlordData.Tables[0].Rows[0]["FirstName"].ToString().Trim();
                    string MiddleName = string.IsNullOrEmpty(LandlordData.Tables[0].Rows[0]["MiddleName"].ToString().Trim()) ? string.Empty : LandlordData.Tables[0].Rows[0]["MiddleName"].ToString().Trim();
                    string LastName = string.IsNullOrEmpty(LandlordData.Tables[0].Rows[0]["LastName"].ToString().Trim()) ? string.Empty : LandlordData.Tables[0].Rows[0]["LastName"].ToString().Trim();

                    Name.Text = FirstName + " " + MiddleName + " " + LastName;

                    Email.Text = string.IsNullOrEmpty(LandlordData.Tables[0].Rows[0]["PersonalEmail"].ToString().Trim()) ? string.Empty : LandlordData.Tables[0].Rows[0]["PersonalEmail"].ToString().Trim();
                    Mobile.Text = string.IsNullOrEmpty(LandlordData.Tables[0].Rows[0]["BestContactNumber"].ToString().Trim()) ? string.Empty : LandlordData.Tables[0].Rows[0]["BestContactNumber"].ToString().Trim();

                }

            }
            else if (user_.BaseHouseRoomId != null)
            {
                DataSet LandlordData = userDAO.SelectLandlordByBaseHouseRoomId(user.BaseHouseRoomId.Value);

                if (LandlordData != null && LandlordData.Tables[0].Rows.Count > 0)
                {
                    string FirstName = string.IsNullOrEmpty(LandlordData.Tables[0].Rows[0]["FirstName"].ToString().Trim()) ? string.Empty : LandlordData.Tables[0].Rows[0]["FirstName"].ToString().Trim();
                    string MiddleName = string.IsNullOrEmpty(LandlordData.Tables[0].Rows[0]["MiddleName"].ToString().Trim()) ? string.Empty : LandlordData.Tables[0].Rows[0]["MiddleName"].ToString().Trim();
                    string LastName = string.IsNullOrEmpty(LandlordData.Tables[0].Rows[0]["LastName"].ToString().Trim()) ? string.Empty : LandlordData.Tables[0].Rows[0]["LastName"].ToString().Trim();

                    Name.Text = FirstName + " " + MiddleName + " " + LastName;
                    Email.Text = string.IsNullOrEmpty(LandlordData.Tables[0].Rows[0]["PersonalEmail"].ToString().Trim()) ? string.Empty : LandlordData.Tables[0].Rows[0]["PersonalEmail"].ToString().Trim();
                    Mobile.Text = string.IsNullOrEmpty(LandlordData.Tables[0].Rows[0]["BestContactNumber"].ToString().Trim()) ? string.Empty : LandlordData.Tables[0].Rows[0]["BestContactNumber"].ToString().Trim();

                }
            }
        }
        public void LoadUserData()
        {
            UserDAO userDAO = new UserDAO();
            if (Membership.GetUser() == null)
            {
                return;
            }
            user = RHP.UserManagement.User.Select(Guid.Parse(Membership.GetUser().ProviderUserKey.ToString()));

            if (user.HouseId != null || user.BaseHouseRoomId != null)
            {
                LoadLandlordData(user);
                LoadHouseData(user);
                LoadStudentData(user);
            }
            else
            {
                if (!IsFromWizard)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "Redirect", "window.onload = function(){ alert('" + Messages.CurrentHouseNoRecords + "'); window.location = '/Student/Student_Profile_Current_House.aspx';}", true);
                }
            }
        }
        protected void btnStep4_Click(object sender, EventArgs e)
        {
            //Save rest of the user details and save.
            Guid userId = Guid.Parse(hdnUserId.Value.Trim());
            user = User.Select(userId);//Load user details to the object, else other user details will get empty
            user.FirstName = txtFirstName.Text.Trim();
            user.LastName = txtLastName.Text.Trim();
            DateTime dob;
            if (DateTime.TryParse(txtDateofBirth.Text.Trim(), out dob))
            {
                user.DateOfBirth = dob;
            }
            user.ReferralCode = ReferralCode.Text.Trim();
            user.Save();
            FormsAuthentication.SetAuthCookie(user.PersonalEmail, false);

            //Page redirect to student profile.
            registrationWizard.ActiveStepIndex = (int)EnumWizardStepIndexes.Step5;
        }
        private string message(Guid ActivationKey, User _user)
        {
            string strMsgContent = string.Empty;

            try
            {
                string name = _user.FirstName + " " + _user.MiddleName + " " + _user.LastName;

                string RegisterUrl = SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + "Student/Student_Profile_Add.aspx?ActivationKey=" + ActivationKey;
                strMsgContent = "<div style=\"border:solid 1px #efefef;\"><div style=\"width:800;border:solid " +
                                    "1px #efefef;font-weight:bold; font-family:Verdana;font-size:12px; text-align:left;" +
                                    " background-color:#efefef;\"   <span >" + name + ", " + "</span></div>" +
                                    "<br />";

                string loginpath = SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + "Login.aspx?type=s";

                strMsgContent = strMsgContent + "Your current roommates created a “Full Profile” with " + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + " ,and in the process created/updated “My Current Residence” feature of the platform. ,<br/><br/>";

                strMsgContent = strMsgContent + "In doing so they have created a “Partial Profile” for you and have begun to rate you and comment on their and your housing situation. Create a “Full Profile” to see what they have said and to access/complete “My Current Residence”;so that you can also begin to rate and comment on your current roommates and/or landlord. Click link below to create a “Full Profile”.";

                strMsgContent = strMsgContent + "<a href=" + RegisterUrl + "> Create Your " + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + " Account </a>  <br/><br/>";

                strMsgContent = strMsgContent + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + " is a platform, where students and landlords can rate, review, and comment on each other. As well as find and connect with other student renters and landlords using our search engine. <br/><br/>";

                strMsgContent = strMsgContent + "'<b>Student housing made simple, reliable, most of all accountable...</b>' <br/><br/>";

                strMsgContent = strMsgContent + "If you have any issues with Leaving Current House, please email " + "<a href=\"mailto:" + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SMTP_FROM_EMAIL) + "?subject=I have issue with creating my account\"> " + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SMTP_FROM_EMAIL) + " </a><br/>";

                strMsgContent = strMsgContent + "If you have already responded to the request, please ignore this email.  <br/>";

                strMsgContent = strMsgContent + "If you have already created a “Full Profile” (registered), " + "<a href=" + loginpath + "> click here </a> to login to " + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + ". <br/>";

                strMsgContent = strMsgContent + "<br /> <strong>This is an automated response to activate your account. Please do not reply to this email.<br /><br />";

                strMsgContent = strMsgContent + "From the Founder and CEO/President of<br /> <a href=\"" + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + "\">" + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + "</a></strong><br /><br /></div>";

                strMsgContent = strMsgContent + "</br><span style=\"color:#818181; font-style:italic; font-size:12px;\">This email is confidential and is intended only for the individual named. Although reasonable precautions have been taken to ensure no viruses are present in this email, " + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + " do not warrant that this e-mail is free from viruses or other corruptions and is not liable to the recipient or any other party should any virus or other corruption be present in this e-mail. If you have received this email in error please notify the sender.</span>";

            }
            catch (Exception ex)
            {
                strMsgContent = string.Empty;

            }
            return strMsgContent;
        }
        private void SetUserBasedRestrictions()
        {
            string AccessCode = Utility.GetQueryStringValueByKey(Request, "AccessCode2");
            //User currentProfileUser = User.Select(Guid.Parse(AccessCode));

            User currentProfileUser = new User();
            if (AccessCode != string.Empty && AccessCode != null)
            {
                try
                {
                    currentProfileUser = User.Select(Guid.Parse(AccessCode));
                }
                catch (Exception ex)
                { user = null; }

                //Check if the user is the same as the logged users id
                //One cannot rate himself
                if (user == null)
                {
                    LbFeedback.Visible = false;
                    FeedbackButton.Visible = false;
                }
                else
                {
                    if (currentProfileUser.UserId == user.UserId)
                    {
                        LbFeedback.Visible = false;
                        FeedbackButton.Visible = false;
                    }

                    if (user.RoleId == Constants.USER_ROLE_LANDLORD)
                    {

                    }
                    else if (user.RoleId == Constants.USER_ROLE_STUDENT)
                    {

                    }
                    else
                    {

                    }
                }
            }
        }
Ejemplo n.º 26
0
        public bool UpdateHouse(User users, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_UserUpdateHouse");

            db.AddInParameter(command, "UserId", DbType.Guid, users.UserId);
            db.AddInParameter(command, "HouseId", DbType.Guid, users.HouseId);
            db.AddInParameter(command, "BaseHouseRoomId", DbType.Guid, users.BaseHouseRoomId);
            db.AddOutParameter(command, "UpdatedDate", DbType.DateTime, 30);
            db.ExecuteNonQuery(command, transaction);

            users.UpdatedDate = Convert.ToDateTime(db.GetParameterValue(command, "UpdatedDate").ToString());

            return true;
        }
        public bool Save()
        {
            bool result = true;
            aspnet_Roles aspnet_Roles_ = new aspnet_Roles();

            aspnet_Roles_ = aspnet_Roles.Select("landlord");

            User Landlorduser = new User();
            if (LandlordId == null)
            {

                Landlorduser.UserId = Guid.NewGuid();
                Landlorduser.PersonalEmail = Email.Text.Trim();
                Landlorduser.FirstName = FirstName.Text.Trim();
                Landlorduser.MiddleName = MiddleName.Text.Trim();
                Landlorduser.LastName = LastName.Text.Trim();
                Landlorduser.BestContactNumber = MobileArea.Text.Trim() + Mobile1.Text.Trim() + Mobile2.Text.Trim();//Mobile.Text.Trim();
                Landlorduser.CreatedBy = Guid.Parse(Membership.GetUser().ProviderUserKey.ToString());
                Landlorduser.UpdatedBy = Guid.Parse(Membership.GetUser().ProviderUserKey.ToString());
                Landlorduser.IsPartialUser = true;
                Landlorduser.RoleId = aspnet_Roles_.RoleId;

                if (Landlorduser.Save())
                {
                    landload.user = Landlorduser;
                    landload.LandlordId = Landlorduser.UserId.HasValue ? Landlorduser.UserId.Value : Landlorduser.UserId.Value;
                    LandlordId = landload.LandlordId;//setting value of property
                    landload.LandlordName = Landlorduser.FirstName + " " + Landlorduser.MiddleName + " " + Landlorduser.LastName;

                    landload.CreatedBy = Guid.Parse(Membership.GetUser().ProviderUserKey.ToString());
                    landload.UpdatedBy = Guid.Parse(Membership.GetUser().ProviderUserKey.ToString());
                    result = landload.Save();

                    string strMsgContent = message(Landlorduser.UserId.Value,Landlorduser);

                    string strMsgTitle = RHP.Common.Enums.SystemConfig.SITEURL + " is Requesting you to join with Us.";

                     int rtn = SendEmail(Landlorduser.PersonalEmail, strMsgTitle, strMsgContent);

                    if (rtn == 1)
                    {
                    }
                }

                LandlordId = Landlorduser.UserId;
            }
            else
            {

                // Landload already registerd
            }
            return result;
        }
        protected void CreateUserButton_Click(object sender, EventArgs e)
        {
            if (Page.IsValid == true)
            {
            ShowPartialUserEmailRequest.Visible = false;
            try
            {

                string AccessCode = Utility.GetQueryStringValueByKey(Request, "ActivationKey");

               if (AccessCode != string.Empty && AccessCode != null)
               {
                    user = User.Select(Guid.Parse(AccessCode));
               }

               bool PartialEmail = false;

              if (user.IsPartialUser == false)
              {
                    PartialEmail = checkPartialEmail();
              }

              if (PartialEmail == false)
              {
                        // need to validate partial email address

                        bool boolMembershipUserCreated = false;

                        user.Email = Email.Text.Trim();
                        user.PersonalEmail = Email.Text.Trim();
                        user.Password = Password.Text.Trim();
                        user.UserName = UserName.Text.Trim();
                        user.Question = Question.Text.Trim();
                        user.Answer = Answer.Text.Trim();

                        aspnet_Roles aspnet_Roles_ = new aspnet_Roles();
                        aspnet_Roles_ = aspnet_Roles.Select("student");

                        user.FirstName = FirstName.Text.Trim();
                        user.MiddleName = MiddleName.Text.Trim();
                        user.LastName = LastName.Text.Trim();
                        user.RoleId = aspnet_Roles_.RoleId;
                        user.ReferralCode = ReferralCode.Text.Trim();

                        object objCreateMembershipUser = new object();

                        bool IsActivate = false;

                        if (SystemConfig.GetValue(Enums.SystemConfig.IsEmailActivation).ToLower() == "true")
                        {
                            IsActivate = false;
                        }
                        else
                        {
                            IsActivate = true;
                        }

                        if (user.IsPartialUser)
                        {
                            objCreateMembershipUser = user.AddMembershipPartialUser(user.UserName, user.Password, user.Email, user.Question, user.Answer, IsActivate, user.UserId.Value, "student");
                        }
                        else
                        {
                            objCreateMembershipUser = user.AddMembershipUser(user.UserName, user.Password, user.Email, user.Question, user.Answer, IsActivate, "student");
                        }

                        bool.TryParse(objCreateMembershipUser.ToString(), out boolMembershipUserCreated);

                        if (boolMembershipUserCreated)
                        {
                            Session[Constants.SESSION_LOGGED_USER] = user;

                            MembershipUser newUser = Membership.GetUser(user.UserName);
                            user.UserId = Guid.Parse(newUser.ProviderUserKey.ToString());
                            user.AspnetUserId = Guid.Parse(newUser.ProviderUserKey.ToString());
                            user.CreatedBy = Guid.Parse(newUser.ProviderUserKey.ToString());
                            user.UpdatedBy = Guid.Parse(newUser.ProviderUserKey.ToString());
                            user.Save();

                            if (SystemConfig.GetValue(Enums.SystemConfig.IsEmailActivation).ToLower() == "true")
                            {
                                string strMsgContent = message((Guid)newUser.ProviderUserKey);
                                string strMsgTitle = SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + " - Action required for account activation.";

                                int rtn = SendEmail(user.Email, strMsgTitle, strMsgContent);

                                if (rtn == 1)
                                {
                                    Page.ClientScript.RegisterStartupScript(this.GetType(), "Redirect", "window.onload = function(){ alert('" + Messages.Create_Account_Success + "'); window.location = '/Login.aspx?type=s'; }", true);
                                }
                                else
                                {
                                    Page.ClientScript.RegisterStartupScript(this.GetType(), "Redirect", "window.onload = function(){ alert('" + Messages.Sending_Email_Error + "'); window.location = '/Login.aspx?type=s'; }", true);
                                }
                            }
                            else
                            {
                                Page.ClientScript.RegisterStartupScript(this.GetType(), "Redirect", "window.onload = function(){ alert('" + Messages.Create_Account_Success + "'); window.location = '/Login.aspx?type=s'; }", true);
                            }

                        }
                        else
                        {
                            lblError.Text = objCreateMembershipUser.ToString();
                            Page.ClientScript.RegisterStartupScript(this.GetType(), "Redirect", "window.onload = function(){ alert('" + Messages.Profile_Create_Unsuccess + " - " + objCreateMembershipUser.ToString() + "'); }", true);
                        }
                }
                else
                {

                        User user_check = new User();

                        if (user_check.IsPartialUserEmailExist(Email.Text.Trim().ToLower()))
                        {
                            ShowfullRegistration.Visible = false;
                            ShowPartialUserEmailRequest.Visible = true;
                            lblpartialuserEmail.Text = Email.Text.Trim();
                            lblpartialuserEmail2.Text = Email.Text.Trim();
                        }
                        else
                        {
                            Page.ClientScript.RegisterStartupScript(this.GetType(), "Redirect", "window.onload = function(){ alert('" + Messages.Profile_Create_Unsuccess + " - " + Messages.EmailAddressExist + "'); }", true);
                            ShowPartialUserEmailRequest.Visible = false;
                            ShowfullRegistration.Visible = true;
                        }
                }

            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "Redirect", "window.onload = function(){ alert('" + Messages.Profile_Create_Unsuccess +  "'); }", true);

                throw ex;//new Exception("student Profile info : " + ex.ToString());
            }
            }
            else
            {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "Redirect", "window.onload = function(){ alert('" + Messages.Validation_Fail + "'); }", true);
            }
        }
        protected void ButtonVerify_Click(object sender, EventArgs e)
        {
            Labelmessage.Text = "";

            if (Email.Text.Trim() != "")
            {
                User user_ = User.SelectUserByEmail("Email", Email.Text.Trim().ToLower(), "RoleName", "landlord");
                if (user_ != null)
                {
                    Labelmessage.Text = "landload verified for email : " + Email.Text.Trim().ToLower();
                    LandlordId = user_.UserId;

                    //Pass the landlordId back to the main page
                    PassID(user_.UserId.Value);

                   // Email.Text = user_.PersonalEmail;
                    FirstName.Text = user_.FirstName;
                    MiddleName.Text = user_.MiddleName;
                    LastName.Text = user_.LastName;

                    MobileArea.Text = string.IsNullOrEmpty(user_.BestContactNumber) ? string.Empty : user_.BestContactNumber.Substring(0, 3);
                    Mobile1.Text = string.IsNullOrEmpty(user_.BestContactNumber) ? string.Empty : user_.BestContactNumber.Substring(3, 3);
                    Mobile2.Text = string.IsNullOrEmpty(user_.BestContactNumber) ? string.Empty : user_.BestContactNumber.Substring(6, 4);

                    //Mobile.Text = user_.BestContactNumber;
                }
                else
                {

                    FirstName.Text = "";
                    MiddleName.Text = "";
                    LastName.Text = "";
                    MobileArea.Text = "";
                    Mobile1.Text = "";
                    Mobile2.Text = "";

                    User user_check = new User();

                    if (user_check.IsUserEmailExist(Email.Text.Trim().ToLower()))
                    {
                        FirstName.Enabled = false;
                        MiddleName.Enabled = false;
                        LastName.Enabled = false;
                        MobileArea.Enabled = false;
                        Mobile1.Enabled = false;
                        Mobile2.Enabled = false;

                        if (user_check.IsPartialUserEmailExist(Email.Text.Trim().ToLower()))
                        {
                            Labelmessage.Text = "Email Address : " + Email.Text.Trim().ToLower() + ", is already Registed with Partial Account. Please enter another email.";

                            //usp_UserSelectByRoleName

                            user_check = User.SelectUserByEmail("RoleName", "landlord", "Email", Email.Text.Trim().ToLower());

                            if (user_check != null)
                            {
                                if (user_check.UserId.HasValue && user_check.IsPartialUser == true)
                                {
                                    Labelmessage.Text = "landload verified for email : " + Email.Text.Trim().ToLower();
                                    LandlordId = user_check.UserId;

                                    PassID(user_check.UserId.Value);
                                    Email.Text = user_check.PersonalEmail;
                                    FirstName.Text = string.IsNullOrEmpty(user_check.FirstName) ? string.Empty : user_check.FirstName;
                                    MiddleName.Text = string.IsNullOrEmpty(user_check.MiddleName) ? string.Empty : user_check.MiddleName;
                                    LastName.Text = string.IsNullOrEmpty(user_check.LastName) ? string.Empty : user_check.LastName;

                                    MobileArea.Text = string.IsNullOrEmpty(user_check.BestContactNumber) ? string.Empty : user_check.BestContactNumber.Substring(0, 3);
                                    Mobile1.Text = string.IsNullOrEmpty(user_check.BestContactNumber) ? string.Empty : user_check.BestContactNumber.Substring(3, 3);
                                    Mobile2.Text = string.IsNullOrEmpty(user_check.BestContactNumber) ? string.Empty : user_check.BestContactNumber.Substring(6, 4);
                                }
                                else
                                {
                                    Labelmessage.Text = "can not find registered landload for email : " + Email.Text.Trim().ToLower() + ". Please enter details to continue..";

                                    Email.Text = "";
                                    FirstName.Enabled = true;
                                    MiddleName.Enabled = true;
                                    LastName.Enabled = true;
                                    MobileArea.Enabled = true;
                                    Mobile1.Enabled = true;
                                    Mobile2.Enabled = true;
                                }
                            }

                            else
                            {
                                Labelmessage.Text = "Email Address : " + Email.Text.Trim().ToLower() + ", is already Registed with Student Account. Please enter another email.";
                            }
                        }
                        else
                        {
                            Labelmessage.Text = "Email Address : " + Email.Text.Trim().ToLower() + ", is already Registed with Student Account. Please enter another email.";
                        }
                    }
                    else
                    {
                        Labelmessage.Text = "can not find registered landload for email : " + Email.Text.Trim().ToLower() + ". Please enter details to continue..";

                        // Mobile.Text = "";
                        FirstName.Enabled = true;
                        MiddleName.Enabled = true;
                        LastName.Enabled = true;
                        MobileArea.Enabled = true;
                        Mobile1.Enabled = true;
                        Mobile2.Enabled = true;
                    }

                }
            }
            else
            {
                clear();

            }
        }
        private string PartialUserRequest(User _user, string type)
        {
            string strMsgContent = string.Empty;

            try
            {
            string name = _user.FirstName + " " + _user.MiddleName + " " + _user.LastName;

            string RegisterUrl = SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + "Land_load/Land_load_Profile_Add.aspx?ActivationKey=" + _user.UserId;
            strMsgContent = "<div style=\"border:solid 1px #efefef;\"><div style=\"width:800;border:solid " +
                                "1px #efefef;font-weight:bold; font-family:Verdana;font-size:12px; text-align:left;" +
                                " background-color:#efefef;\" >  <strong>Dear</strong>  <span >" + name + ", " + "</span></div>" +
                                "<br />";

            string loginpath = SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + "Login.aspx?type=" + type;

            strMsgContent = strMsgContent + "One of your house Room-mate created account with " + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + ", and Request you to join with " + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + ",<br/><br/>";

            strMsgContent = strMsgContent + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + " is a fast growing online house rating system that support for property owener's and students to connecting with each others.<br/><br/>";

            strMsgContent = strMsgContent + "'<b>Student housing made simple, reliable, most of all accountable..</b>' <br/><br/>";

            strMsgContent = strMsgContent + "if your are happy to join with us, Please click on the link below to create your account. it's 100% free.<br/><br/>";

            strMsgContent = strMsgContent + "<a href=" + RegisterUrl + "> Create Your " + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + " Account </a>  <br/><br/>";

            strMsgContent = strMsgContent + "If you have any issues with creating your account, please email " + "<a href=\"mailto:" + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SMTP_FROM_EMAIL) + "?subject=I have issue with creating my account\">  " + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SMTP_FROM_EMAIL) + " </a><br/>";

            strMsgContent = strMsgContent + "If you have already Registred, " + "<a href=" + loginpath + "> click here </a> to login to " + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + ". <br/>";

            strMsgContent = strMsgContent + "<br /> <strong>This is an automated response to activate your account. Please do not reply to this email.<br /><br />";

            strMsgContent = strMsgContent + "Sincerely yours,<br /> <a href=\"" + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + "\">" + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + "</a></strong><br /><br /></div>";

            strMsgContent = strMsgContent + "</br><span style=\"color:#818181; font-style:italic; font-size:12px;\">This email is confidential and is intended only for the individual named. Although reasonable precautions have been taken to ensure no viruses are present in this email, " + SystemConfig.GetValue(RHP.Common.Enums.SystemConfig.SITEURL) + " do not warrant that this e-mail is free from viruses or other corruptions and is not liable to the recipient or any other party should any virus or other corruption be present in this e-mail. If you have received this email in error please notify the sender.</span>";

            }
            catch (Exception ex)
            {
            strMsgContent = string.Empty;

            }
            return strMsgContent;
        }
        protected void btnStep1_Click(object sender, EventArgs e)
        {
            user = User.SelectUserByEmail("Email", txtEmail.Text.Trim().ToLower(), "RoleName", "student");

            if (user == null)
            {
                registrationWizard.ActiveStepIndex = (int)EnumWizardStepIndexes.Step2;
                hdnPassword.Value = txtPassword.Text;
            }
            else
            {
                lblError.Text = "User with this email address already exist.";
            }
        }
 public void LoadStudentData(User user_)
 {
     if (user_.HouseId.HasValue)
     {
         List<User> userList = RHP.UserManagement.User.SelectUserByHouseId("HouseId", user_.HouseId.Value, "RoleName", "student");
         DataListStudentList.DataSource = userList;
         DataListStudentList.DataBind();
     }
     else if (user_.BaseHouseRoomId.HasValue)
     {
         List<User> userList = RHP.UserManagement.User.SelectUserByBaseHouseRoomId("BaseHouseRoomId", user_.BaseHouseRoomId.Value, "RoleName", "student");
         DataListStudentList.DataSource = userList;
         DataListStudentList.DataBind();
     }
 }
        public void LoadUserData()
        {
            // user data
            user = User.Select(Guid.Parse(Membership.GetUser().ProviderUserKey.ToString()));

            Name.Text = string.IsNullOrEmpty(user.Name) ? string.Empty : user.Name;
            Email.Text = string.IsNullOrEmpty(Membership.GetUser().Email.ToString()) ? string.Empty : Membership.GetUser().Email.ToString();
            Address.Text = string.IsNullOrEmpty(user.StreetAddress) ? string.Empty : user.StreetAddress;
            City.Text = string.IsNullOrEmpty(user.City) ? string.Empty : user.City;
            Zip.Text = string.IsNullOrEmpty(user.Zip) ? string.Empty : user.Zip;
            Mobile.Text = string.IsNullOrEmpty(user.BestContactNumber) ? string.Empty : user.BestContactNumber;
            Question.Text = user.GetSeacretQuestion(Membership.GetUser().UserName.ToString());
            DriversLicense.Text = string.IsNullOrEmpty(user.DriversLicenseNumber) ? string.Empty : user.DriversLicenseNumber;

            if (!string.IsNullOrEmpty(user.Status))
            {
                for (int i = 0; i < Status.Items.Count; i++)
                {
                    if (Status.Items[i].Value.ToString().ToLower() == user.Status.ToLower())
                    {
                        Status.Items[i].Selected = true;
                    }
                }
            }
            if (!string.IsNullOrEmpty(user.State))
            {
                for (int i = 0; i < Drpstate.Items.Count; i++)
                {
                    if (Drpstate.Items[i].Value.ToString().ToLower() == user.State.ToLower())
                    {
                        Drpstate.Items[i].Selected = true;
                    }
                }
            }

            if (!string.IsNullOrEmpty(user.Gender))
            {
                for (int i = 0; i < DrpGender.Items.Count; i++)
                {
                    if (DrpGender.Items[i].Value.ToString().ToLower() == user.Gender.ToLower())
                    {
                        DrpGender.Items[i].Selected = true;
                    }
                }

            }

            // school data

            student = RHP.StudentManagement.Student.Select(Guid.Parse(Membership.GetUser().ProviderUserKey.ToString()));

            if (student != null)
            {
                if (!string.IsNullOrEmpty(student.School.SchoolId.ToString()))
                {
                    for (int i = 0; i < DrpSchoolName.Items.Count; i++)
                    {
                        if (DrpSchoolName.Items[i].Value.ToString().ToLower() == student.School.SchoolId.ToString())
                        {
                            DrpSchoolName.Items[i].Selected = true;
                        }
                    }
                }
                if (!string.IsNullOrEmpty(student.Year.ToString()))
                {
                    for (int i = 0; i < DRPYear.Items.Count; i++)
                    {
                        if (DRPYear.Items[i].Value.ToString().ToLower() == student.Year.ToString())
                        {
                            DRPYear.Items[i].Selected = true;
                        }
                    }
                }
                LandLoadName.Text = string.IsNullOrEmpty(student.LandloadName) ? string.Empty : student.LandloadName;
                LandLoadPlace.Text = string.IsNullOrEmpty(student.LandloadPlace) ? string.Empty : student.LandloadPlace;
            }
        }
Ejemplo n.º 34
0
        /// <summary>
        /// Checks if user record with UserId exist in User table of the database.
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        public bool IsUserExist(User user)
        {
            Database db = DatabaseFactory.CreateDatabase(Constants.CONNECTIONSTRING);
            DbCommand command = db.GetStoredProcCommand("usp_User_IsUserExist");

            db.AddInParameter(command, "UserId", DbType.Guid, user.UserId);
            db.AddOutParameter(command, "IsExist", DbType.Boolean, 1);

            db.ExecuteNonQuery(command);

            return Convert.ToBoolean(db.GetParameterValue(command, "IsExist").ToString());
        }