public void QuandoSelecionarONivel(int Nivel, Table table) { Niveis nv = table.CreateInstance <Niveis>(); actions.SelecionarNivel(Nivel, nv); _context["Nivel"] = nv.nivel1; }
public void AdicionarCargo(Cargo cargo) { Niveis.Add(new WorkflowAprovacaoNivelDto() { Cargo = cargo, Nivel = 1 }); }
public void AdicionarNivel(Cargo cargo) { Niveis.Add(new WorkflowAprovacaoNivelDto() { Cargo = cargo, Nivel = Niveis.Count() + 1 }); }
public IEnumerable <ValidationResult> Validate(ValidationContext validationContext) { if (Niveis == null || Niveis.Count == 0) { yield return(new ValidationResult("No mínimo 1 nível deve ser informado.")); } if (Niveis != null) { if (Niveis.Count(a => a.Cargo.HasValue) > 0) { if (string.IsNullOrEmpty(UeId)) { yield return(new ValidationResult("Este workflow possui níveis com cargo e é necessário informar a Ue.")); } } } }
public IEnumerable <ValidationResult> Validate(ValidationContext validationContext) { if (Niveis == null || Niveis.Count == 0) { yield return(new ValidationResult("No mínimo 1 nível deve ser informado.")); } if (Niveis != null) { if (Niveis.Count(a => a.Cargo.HasValue) > 0) { if (string.IsNullOrEmpty(UeId)) { yield return(new ValidationResult("Este workflow possui níveis com cargo e é necessário informar a Ue.")); } } } if (Tipo != WorkflowAprovacaoTipo.Basica) { yield return(new ValidationResult("Para este tipo de workflow, é necessário informar um Id de entidade para aprovar.")); } }
public void SelecionarNivel(int Nivel, Niveis Nvs) { _wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(cadastroNivelPage.Nivel1)); SelectElement Nv = new SelectElement(cadastroNivelPage.Nivel1); if (Nivel == 1) { Nv.SelectByText("Inserir nesse nível"); } else if (Nivel == 2) { Nv.SelectByText(Nvs.nivel1); _wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(cadastroNivelPage.Nivel2)); Nv = new SelectElement(cadastroNivelPage.Nivel2); Nv.SelectByText("Inserir nesse nível"); } else if (Nivel == 3) { Nv.SelectByText(Nvs.nivel1); _wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(cadastroNivelPage.Nivel2)); Nv = new SelectElement(cadastroNivelPage.Nivel2); Nv.SelectByText(Nvs.nivel2); _wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(cadastroNivelPage.Nivel3)); Nv = new SelectElement(cadastroNivelPage.Nivel3); Nv.SelectByText("Inserir nesse nível"); } else if (Nivel == 4) { Nv.SelectByText(Nvs.nivel1); _wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(cadastroNivelPage.Nivel2)); Nv = new SelectElement(cadastroNivelPage.Nivel2); Nv.SelectByText(Nvs.nivel2); _wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(cadastroNivelPage.Nivel3)); Nv = new SelectElement(cadastroNivelPage.Nivel3); Nv.SelectByText(Nvs.nivel3); _wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(cadastroNivelPage.Nivel4)); Nv = new SelectElement(cadastroNivelPage.Nivel4); Nv.SelectByText("Inserir nesse nível"); } else if (Nivel == 5) { Nv.SelectByText(Nvs.nivel1); _wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(cadastroNivelPage.Nivel2)); Nv = new SelectElement(cadastroNivelPage.Nivel2); Nv.SelectByText(Nvs.nivel2); _wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(cadastroNivelPage.Nivel3)); Nv = new SelectElement(cadastroNivelPage.Nivel3); Nv.SelectByText(Nvs.nivel3); _wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(cadastroNivelPage.Nivel4)); Nv = new SelectElement(cadastroNivelPage.Nivel4); Nv.SelectByText(Nvs.nivel4); _wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(cadastroNivelPage.Nivel5)); Nv = new SelectElement(cadastroNivelPage.Nivel5); Nv.SelectByText("Inserir nesse nível"); } else if (Nivel == 6) { Nv.SelectByText(Nvs.nivel1); _wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(cadastroNivelPage.Nivel2)); Nv = new SelectElement(cadastroNivelPage.Nivel2); Nv.SelectByText(Nvs.nivel2); _wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(cadastroNivelPage.Nivel3)); Nv = new SelectElement(cadastroNivelPage.Nivel3); Nv.SelectByText(Nvs.nivel3); _wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(cadastroNivelPage.Nivel4)); Nv = new SelectElement(cadastroNivelPage.Nivel4); Nv.SelectByText(Nvs.nivel4); _wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(cadastroNivelPage.Nivel5)); Nv = new SelectElement(cadastroNivelPage.Nivel5); Nv.SelectByText(Nvs.nivel5); } }