// VERIFICAR SI SE COMPLETAN LOS DEMAS CAMPOS AL AGREGAR INMUEBLE public bool ChkProductForAdd(Inmueble p) { int errCnt = 0; if (String.IsNullOrEmpty(p.Direccion)) { errCnt++; DireccionBrush = errorBrush; } else { DireccionBrush = okBrush; } if (String.IsNullOrEmpty(p.Vendedor)) { errCnt++; NombreVendedorBrush = errorBrush; } else { NombreVendedorBrush = okBrush; } if (String.IsNullOrEmpty(p.Categoria)) { errCnt++; NombreCategoriaBrush = errorBrush; } else { NombreCategoriaBrush = okBrush; } if (!ChkUnitCost(p.Precio)) { errCnt++; CostBrush = errorBrush; } if (errCnt == 0) { Status = "OK"; return(true); } else { Status = "Agregar Inmueble, falta un campo o esta incorrecto."; return(false); } }
// AGREGAR INMUEBLES private void AddInmueble(Inmueble inmueble) { dataItems.Add(inmueble); }