Пример #1
0
        static void UpdateProgram(Guid organizationalUnitGuid)
        {
            ServiceFactory             factory   = new ServiceFactory();
            IOrganizationalUnitService ouService = factory.CreateOrganizationalUnitService();

            var oUnit = new OrganizationalUnit();

            // the following are required fields.
            oUnit.OrganizationalUnitGuid = new Guid(organizationalUnitGuid.ToString());
            oUnit.Name = "Updated Organization Unit";

            // the following are optional.

            bool success = ouService.Update(oUnit);

            if (!success)
            {
                Console.WriteLine("ErrorCode: " + ouService.LastError.ErrorCode);
                Console.WriteLine("ErrorMessage: " + ouService.LastError.ErrorCodeString);
            }
            else
            {
                Console.WriteLine(string.Format("User {0} was updated.", oUnit.Name));
            }
        }
Пример #2
0
 public IActionResult Put([FromBody] OrganizationalUnitVO orgUnit)
 {
     if (orgUnit == null)
     {
         return(BadRequest());
     }
     return(new ObjectResult(_orgService.Update(orgUnit)));
 }