Ejemplo n.º 1
0
        public void ModifyUser(Entities.User user)
        {
            try
            {
                SharepointHelper SPHelper = new SharepointHelper(Web);
                UserProfile uProfile = SPHelper.GetUserProfile(user.UserName);

                uProfile["CreationDate"].Value = user.CreationDate;
                uProfile["UserType"].Value = user.UserType.ToString();
                uProfile["FirstName"].Value = user.FirstName;
                uProfile["SecondName"].Value = user.SecondName;
                uProfile["FirstSurname"].Value = user.FirstSurname;
                uProfile["SecondSurname"].Value = user.SecondSurname;
                uProfile["IdentificationType"].Value = user.IdentificationType;
                uProfile["IdentificationNumber"].Value = user.IdentificationNumber;
                uProfile["NIT"].Value = user.NIT;
                uProfile["SubNIT"].Value = user.SubNIT;
                uProfile["Audience"].Value = user.Audience;
                uProfile["TradeName"].Value = user.TradeName;
                uProfile["BirthDate"].Value = user.BirthDate;
                uProfile["MaritalState"].Value = user.MaritalState;
                uProfile["Ocupattion"].Value = user.Ocupattion;
                uProfile["CompensationFund"].Value = user.CompensationFund;
                uProfile["Company"].Value = user.Company;
                uProfile["Position"].Value = user.Position;
                uProfile["PrivateEmail"].Value = user.PrivateEmail;
                uProfile["CompanyEmail"].Value = user.CompanyEmail;
                uProfile["PrivateTel"].Value = user.PrivateTel;
                uProfile["PrivateMobile"].Value = user.PrivateMobile;
                uProfile["CompanyMobile"].Value = user.CompanyMobile;
                uProfile["CompanyTel"].Value = user.CompanyTel;
                uProfile["TelExtension"].Value = user.TelExtension;
                uProfile["AddressCombo1"].Value = user.Address.AddressCombo1;
                uProfile["AddressCombo2"].Value = user.Address.AddressCombo2;
                uProfile["AddressCombo3"].Value = user.Address.AddressCombo3;
                uProfile["AddressCombo4"].Value = user.Address.AddressCombo4;
                uProfile["AddressCombo5"].Value = user.Address.AddressCombo5;
                uProfile["AddressCombo6"].Value = user.Address.AddressCombo6;
                uProfile["AddressText1"].Value = user.Address.AddressText1;
                uProfile["AddressText2"].Value = user.Address.AddressText2;
                uProfile["AddressText3"].Value = user.Address.AddressText3;
                uProfile["AddressText4"].Value = user.Address.AddressText4;
                uProfile["AddressText5"].Value = user.Address.AddressText5;
                uProfile["EPS"].Value = user.EPS;
                uProfile["ChildrenQuantity"].Value = user.ChildrenQuantity;
                uProfile["IncomeLevel"].Value = user.IncomeLevel;
                uProfile["PersonalManager"].Value = user.PersonalManager;
                uProfile["MarketSales"].Value = user.TopicOfInterest.MarketSales;
                uProfile["Recreation"].Value = user.TopicOfInterest.Recreation;
                uProfile["Education"].Value = user.TopicOfInterest.Education;
                uProfile["Home"].Value = user.TopicOfInterest.Home;
                uProfile["Health"].Value = user.TopicOfInterest.Health;
                uProfile["Subsidy"].Value = user.TopicOfInterest.Subsidy;
                uProfile["Credits"].Value = user.TopicOfInterest.Credits;
                uProfile["AuthorizedBy"].Value = user.AuthorizedBy;
                uProfile["AuthorizationDate"].Value = user.AuthorizationDate;
                uProfile["AuthorizedToGetBasicData"].Value = user.AuthorizedToGetBasicData;
                uProfile["AuthorizedToGetContibutionData"].Value = user.AuthorizedToGetContibutionData;
                uProfile["AuthorizedToGetMemberData"].Value = user.AuthorizedToGetMemberData;
                uProfile["SecurityAnswer"].Value = user.SecurityAnswer;
                uProfile["SecurityQuestion"].Value = user.SecurityQuestion;

                uProfile.Commit();

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
        public Entities.User GetUser(int id)
        {
            try
            {
                SharepointHelper SPHelper = new SharepointHelper(Web);
                UserProfile uProfile = SPHelper.GetUserProfile(id);

                return GetUser(uProfile);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }