Ejemplo n.º 1
0
 /// <remarks/>
 public void ModifyUserPropertyByAccountNameAsync(string accountName, PropertyData[] newData, object userState) {
     if ((this.ModifyUserPropertyByAccountNameOperationCompleted == null)) {
         this.ModifyUserPropertyByAccountNameOperationCompleted = new System.Threading.SendOrPostCallback(this.OnModifyUserPropertyByAccountNameOperationCompleted);
     }
     this.InvokeAsync("ModifyUserPropertyByAccountName", new object[] {
                 accountName,
                 newData}, this.ModifyUserPropertyByAccountNameOperationCompleted, userState);
 }
Ejemplo n.º 2
0
 /// <remarks/>
 public void ModifyUserPropertyByAccountNameAsync(string accountName, PropertyData[] newData) {
     this.ModifyUserPropertyByAccountNameAsync(accountName, newData, null);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Write a Single valued property to SPO
        /// </summary>
        /// <param name="UserName"></param>
        /// <param name="PropertyName"></param>
        /// <param name="PropertyValue"></param>
        static void SetSingleProfileProperty(string UserName, string PropertyName, string PropertyValue)
        {

            try
            {
                UPSvc.PropertyData[] data = new UPSvc.PropertyData[1];
                data[0] = new UPSvc.PropertyData();
                data[0].Name = PropertyName;
                data[0].IsValueChanged = true;
                data[0].Values = new UPSvc.ValueData[1];
                data[0].Values[0] = new UPSvc.ValueData();
                data[0].Values[0].Value = PropertyValue;
                _userProfileService.ModifyUserPropertyByAccountName(UserName, data);
            }
            catch (Exception ex)
            {
                LogMessage("Exception trying to update profile property " + PropertyName + " for user " + UserName + "\n" + ex.Message, LogLevel.Error);
            }

        }
Ejemplo n.º 4
0
 public void ModifyUserPropertyByAccountName(string accountName, PropertyData[] newData) {
     this.Invoke("ModifyUserPropertyByAccountName", new object[] {
                 accountName,
                 newData});
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Write a MultiValued property to SPO
        /// </summary>
        /// <param name="UserName"></param>
        /// <param name="PropertyName"></param>
        /// <param name="PropertyValue"></param>
        static void SetSingleMVProfileProperty(string UserName, string PropertyName, string PropertyValue)
        {

            try
            {
                string[] arrs = PropertyValue.Split(ConfigurationManager.AppSettings["PROPERTYSEPERATOR"][0]);
                
               UPSvc.ValueData[] vd = new UPSvc.ValueData[arrs.Count()];
               
               for (int i=0;i<=arrs.Count()-1;i++)
               {
                    vd[i] = new UPSvc.ValueData();
                    vd[i].Value = arrs[i];
                }
               
                UPSvc.PropertyData[] data = new UPSvc.PropertyData[1];
                data[0] = new UPSvc.PropertyData();
                data[0].Name = PropertyName;
                data[0].IsValueChanged = true;
                data[0].Values = vd;
                               
                _userProfileService.ModifyUserPropertyByAccountName(string.Format(@"i:0#.f|membership|{0}", UserName), data);

            }
            catch (Exception ex)
            {
                LogMessage("Exception trying to update profile property " + PropertyName + " for user " + UserName + "\n" + ex.Message, LogLevel.Error);
            }

        }