Example #1
0
        public ActionResult SaveProfile(UserProfile aProfile)
        {
            using (DB.IObjectRepository tdb = DBContext.Create())
            {
                DB.User lUser = CheckPoint.Instance.GetUser(tdb);

                lUser.Use(u =>
                {
                    u.FirstName                = aProfile.firstName;
                    u.LastName                 = aProfile.lastName;
                    u.Phone                    = aProfile.phone;
                    u.Email                    = aProfile.email;
                    u.OkayToContact            = aProfile.okayToContact;
                    u.ExternalOrganizationName = aProfile.organization;
                    u.ExternalOrganizationType = aProfile.organizationType;
                });

                tdb.SaveChanges();

                return(ProfileData());
            }
        }
        public ActionResult SaveProfile(UserProfile aProfile)
        {
            using (DB.TemplateDatabaseDataSource tdb = new TemplateDatabaseDataSource())
            {
                DB.User lUser = CheckPoint.Instance.GetUser(tdb);

                lUser.Use(u =>
                {
                    u.FirstName                = aProfile.firstName;
                    u.LastName                 = aProfile.lastName;
                    u.Phone                    = aProfile.phone;
                    u.Email                    = aProfile.email;
                    u.OkayToContact            = aProfile.okayToContact;
                    u.ExternalOrganizationName = aProfile.organization;
                    u.ExternalOrganizationType = aProfile.organizationType;
                    u.ApiKey                   = aProfile.apiKey;
                });

                tdb.SaveChanges();

                return(ProfileData());
            }
        }