public void Handle(List <string> listArgs) { ValidatorArgument.Validate(listArgs); ValidatorOptionCommandKey.Validate(listArgs[0]); string optionCommandKey = listArgs[0]; listArgs.RemoveAt(0); ValidatorArgument.Validate(listArgs); string idOrUuid = listArgs[0]; listArgs.RemoveAt(0); List <ModelSensitiveInformation> listSI = CoreManagerSensitiveInformation.Read(); if (optionCommandKey.Equals(CommandOptionKey.SI_UUID)) { ModelSensitiveInformation modelSI = listSI.Find(si => si.uuid.Equals(idOrUuid)); ValidatorIsNull.Validate(modelSI); modelSI = HandlerAddHelper.Handle(listArgs, modelSI); CoreManagerSensitiveInformation.Update(idOrUuid, modelSI); } else if (optionCommandKey.Equals(CommandOptionKey.SI_ID)) { ModelSensitiveInformation modelSI = listSI.Find(si => si.id.ToString().Equals(idOrUuid)); ValidatorIsNull.Validate(modelSI); modelSI = HandlerAddHelper.Handle(listArgs, modelSI); CoreManagerSensitiveInformation.Update(Int32.Parse(idOrUuid), modelSI); } Console.WriteLine("Update sucessfully"); }
public void Handle(List <string> listArgs) { ValidatorArgument.Validate(listArgs); ValidatorOptionCommandKey.Validate(listArgs[0]); string optionCommand = listArgs[0]; listArgs.RemoveAt(0); ValidatorArgument.Validate(listArgs); if (optionCommand.Equals(CommandOptionKey.SI_UUID)) { ContainerUseCase.getUseCaseCrud().Delete(listArgs[0]); } else if (optionCommand.ToString().Equals(CommandOptionKey.SI_ID)) { ContainerUseCase.getUseCaseCrud().Delete(Int32.Parse(listArgs[0])); } Console.WriteLine("Remove sucessfully"); }
public void Handle(List <string> listArgs) { ValidatorArgument.Validate(listArgs); ValidatorOptionCommandKey.Validate(listArgs[0]); string optionCommand = listArgs[0]; listArgs.RemoveAt(0); ValidatorArgument.Validate(listArgs); if (optionCommand.Equals(CommandOptionKey.SI_UUID)) { CoreManagerSensitiveInformation.Delete(listArgs[0]); } else if (optionCommand.ToString().Equals(CommandOptionKey.SI_ID)) { CoreManagerSensitiveInformation.Delete(Int32.Parse(listArgs[0])); } Console.WriteLine("Remove sucessfully"); }