private int BuscarComuna(string co, ref string mensaje) { if (!string.IsNullOrEmpty(co)) { co_tg_comunas comuna = new bf_tg_comunas().GetData(new co_tg_comunas { co_comuna = co }).FirstOrDefault(); if (comuna != null) { if (comuna.id != 0) { return comuna.id; } else { mensaje += "Comuna \"" + co + "\" no Existe."; } } else { mensaje += "Comuna \"" + co + "\" no Existe."; } } else { mensaje += "Comuna \"" + co + "\" no Existe."; } return 0; }
private int BuscarRegion(int idComuna, ref string mensaje) { co_tg_comunas comuna = new bf_tg_comunas().GetData(idComuna); if (comuna != null) { if (comuna.id != 0) { return comuna.id_region.id; } else { mensaje += "Región no Existe."; } } else { mensaje += "Región no Existe."; } return 0; }