Пример #1
0
 private void SaveUserProfileModel(UserProfileModel model)
 {
     Session["UserProfileModel"] = model;
 }
Пример #2
0
        private UserProfileModel GetUserProfileModel()
        {
            var userModel = Session["UserProfileModel"] as UserProfileModel;

            if (userModel == null)
            {
                userModel = new UserProfileModel()
                {
                    Basic = new UserProfileBasicModel
                    {
                        Department = "Web",
                        Organization = "BForms"
                    },
                    UserInfo = new UserProfileInfoModel
                    {
                        Firstname = "Stefan",
                        Lastname = "Prodan",
                        Password = "******",
                        Role = "Team leader",
                        HireDate = new DateTime(2013, 8, 1)
                    },
                    Contact = new UserProfileContactModel
                    {
                        Mail = "*****@*****.**",
                        Website = "http://www.stefanprodan.com"
                    }
                };

                userModel.Basic.Username = userModel.UserInfo.Firstname + " " + userModel.UserInfo.Lastname;

                Session["UserProfileModel"] = userModel;
            }

            return userModel;
        }