Esempio n. 1
0
 public IActionResult Delete([FromQuery] string dn,
                             [FromQuery] string name)
 {
     if (!string.IsNullOrWhiteSpace(dn) && !string.IsNullOrWhiteSpace(name))
     {
         if (_orgService.Delete(dn, name))
         {
             return(Ok());
         }
         return(NoContent());
     }
     return(BadRequest());
 }
Esempio n. 2
0
        static void DeleteProgram(Guid organizationalUnitGuid)
        {
            ServiceFactory             factory   = new ServiceFactory();
            IOrganizationalUnitService ouService = factory.CreateOrganizationalUnitService();

            bool success = ouService.Delete(organizationalUnitGuid);

            if (!success)
            {
                Console.WriteLine("ErrorCode: " + ouService.LastError.ErrorCode);
                Console.WriteLine("ErrorMessage: " + ouService.LastError.ErrorCodeString);
            }
            else
            {
                Console.WriteLine(string.Format("Organizational Unit [{0}] was deleted.", organizationalUnitGuid));
            }
        }