private int ObtenerIdEmpresa() { int id = 0; foreach (Empresa e in _emprs.TraerListado()) { if (e.ToString() == comboBox1.SelectedItem.ToString()) { id = e.id; } } return(id); }
private Empresa ObtenerEmpresa() { Empresa empresa = new Empresa("", 30222222223, ""); foreach (Empresa e in _emprs.TraerListado()) { if (e.ToString() == listBox1.SelectedItem.ToString()) { empresa = e; } } return(empresa); }
private Boolean ValidarUnicidadCuit(Int64 cuit) { bool valido = true; string msg = string.Empty; List <long> listcuit = new List <long>(); List <Empresa> listempresas = _emprs.TraerListado(); foreach (Empresa e in listempresas) { listcuit.Add(e.Cuit); } if (listcuit.Any(x => x == cuit)) { msg = "El Cuit ya se encuentra ingresado."; } if (msg != string.Empty) { valido = false; MessageBox.Show(msg); } return(valido); }