Esempio n. 1
0
        public static int?Execute(CorrigoService service, int woid)
        {
            var assignment = new WoAssignment
            {
                WorkOrderId = woid,
                EmployeeId  = 4,
                IsPrimary   = true
            };
            var command = new CreateCommand {
                Entity = assignment
            };
            var response = service.Execute(command) as OperationCommandResponse;

            Debug.Print(response.ErrorInfo?.Description
                        ?? $"Successfully created WoAssignment for Wo with id {woid}");

            return(response.EntitySpecifier?.Id);
        }
Esempio n. 2
0
        public static void Execute(CorrigoService service, int id)
        {
            var entity = new WoAssignment
            {
                Id         = id,
                EmployeeId = 3,
                IsPrimary  = false
            };

            string[] properties = { "EmployeeId", "IsPrimary" };
            var      command    = new UpdateCommand
            {
                Entity      = entity,
                PropertySet = new PropertySet {
                    Properties = properties
                }
            };
            var response = service.Execute(command) as OperationCommandResponse;

            Debug.Print(response.ErrorInfo?.Description ?? "Successfully updated WoAssignment!");
        }