private Structure estructuraCorrespondiente(string nombreEstructura) { foreach (DataGridViewRow fila in DGV_Estructuras.Rows) { if (fila.Cells[0].Value.Equals(nombreEstructura)) { string estructuraID = (string)(fila.Cells[1].Value); return(Estructura.listaEstructuras(planSeleccionado()).Where(s => s.Id.Equals(estructuraID)).FirstOrDefault()); } } return(null); }
/* private void BT_SeleccionarPlantillas_Click(object sender, EventArgs e) * { * llenarDGVEstructuras(); * }*/ private void llenarDGVEstructuras() { DGV_Estructuras.Rows.Clear(); DGV_Estructuras.ColumnCount = 3; foreach (Estructura estructura in plantilla.estructuras()) { DGV_Estructuras.Rows.Add(); DGV_Estructuras.Rows[DGV_Estructuras.Rows.Count - 1].Cells[0].Value = estructura.nombre; } DataGridViewComboBoxColumn dgvCBCol = (DataGridViewComboBoxColumn)DGV_Estructuras.Columns[1]; dgvCBCol.DataSource = Estructura.listaEstructurasID(Estructura.listaEstructuras(planSeleccionado())); asociarEstructuras(); }
private void asociarEstructuras() { for (int i = 0; i < DGV_Estructuras.Rows.Count; i++) { Structure estructura = Estructura.asociarConLista(plantilla.estructuras()[i].nombresPosibles, Estructura.listaEstructuras(planSeleccionado())); if (estructura != null) { (DGV_Estructuras.Rows[i].Cells[1]).Value = estructura.Id; } else { (DGV_Estructuras.Rows[i].Cells[1]).Value = ""; } } }
private void asociarEstructuras() { bool existeArchivoPar = File.Exists(nombreArchivoParEstructura(paciente, planSeleccionado())); List <parEstructura> lista = new List <parEstructura>(); if (existeArchivoPar) { lista = leerArchivoParEstructura(nombreArchivoParEstructura(paciente, planSeleccionado())); } for (int i = 0; i < DGV_Estructuras.Rows.Count; i++) { Structure estructura = Estructura.asociarConLista(plantilla.estructuras()[i].nombresPosibles, Estructura.listaEstructuras(planSeleccionado())); if (estructura != null) { (DGV_Estructuras.Rows[i].Cells[1]).Value = estructura.Id; } else { if (existeArchivoPar) { DGV_Estructuras.Rows[i].Cells[1].Value = structureDeEstructura(DGV_Estructuras.Rows[i].Cells[0].Value.ToString(), lista); } else { (DGV_Estructuras.Rows[i].Cells[1]).Value = ""; } } } }
public static void aplicarPlantilla(Caso caso) { foreach (IRestriccion restriccion in caso.plantilla.listaRestricciones) { Structure estructuraEc = Estructura.asociarConLista(restriccion.estructura.nombresPosibles, Estructura.listaEstructuras(caso.plan)); if (restriccion.dosisEstaEnPorcentaje()) { restriccion.prescripcionEstructura = caso.plan.TotalPrescribedDose.Dose; } if (estructuraEc != null) { restriccion.analizarPlanEstructura(caso.plan, estructuraEc); } } }