private List <Error> ValidarCampos() { try { List <Error> ListaErrores = new List <Error>(); int Aux = 0; if (string.IsNullOrEmpty(this.mktxtMac.Text.Trim())) { ListaErrores.Add(new Error { Numero = (Aux += 1), Descripcion = "Ingrese una dirección MAC válida.", ControlSender = this.mktxtMac }); } if (!Validar.IsValidMACAddress(this.mktxtMac.Text.Trim())) { ListaErrores.Add(new Error { Numero = (Aux += 1), Descripcion = "Ingrese una dirección MAC válida.", ControlSender = this.mktxtMac }); } if (this.cmbCajas.SelectedIndex == -1) { ListaErrores.Add(new Error { Numero = (Aux += 1), Descripcion = "Seleccione un número de caja.", ControlSender = this.cmbCajas }); } Caja CajaSeleccionada = (Caja)this.cmbCajas.SelectedItem; if (string.IsNullOrEmpty(CajaSeleccionada.IDCajaCat)) { ListaErrores.Add(new Error { Numero = (Aux += 1), Descripcion = "Seleccione un número de caja.", ControlSender = this.cmbCajas }); } if (this.cmbSucCaja.SelectedIndex == -1) { ListaErrores.Add(new Error { Numero = (Aux += 1), Descripcion = "Seleccione una sucursal para la caja.", ControlSender = this.cmbSucCaja }); } Sucursal SucSeleccionada = (Sucursal)this.cmbSucCaja.SelectedItem; if (string.IsNullOrEmpty(SucSeleccionada.IDSucursal)) { ListaErrores.Add(new Error { Numero = (Aux += 1), Descripcion = "Seleccione una sucursal para la caja.", ControlSender = this.cmbSucCaja }); } if (string.IsNullOrEmpty(this.txtNombreCaja.Text) || string.IsNullOrWhiteSpace(this.txtNombreCaja.Text)) { ListaErrores.Add(new Error { Numero = (Aux += 1), Descripcion = "Asigne un nombre a la caja..", ControlSender = this.txtNombreCaja }); } return(ListaErrores); } catch (Exception ex) { throw ex; } }