protected void Button4_Click(object sender, EventArgs e) { if (txtporcentaje.Text != "") { Medicamento oMedicamento = TraerMedicamento(txtnombre.Text); Droga oDroga = TraerDroga(txtdroga.Text); if (oMedicamento.Control(txtdroga.Text) == false) { oMedicamento.AddDrogas(oDroga, double.Parse(txtporcentaje.Text)); string save = "Droga Cargada, Cargue otra o vuelva atras"; this.Page.Response.Write("<script language='JavaScript'>window.alert('" + save + "');</script>"); Button1.Visible = true; } else { string save = "Droga ya fue cargada, cargue otra"; this.Page.Response.Write("<script language='JavaScript'>window.alert('" + save + "');</script>"); } txtdroga.Text = ""; txtdroga.Enabled = true; txtporcentaje.Text = ""; } }
protected void Page_Load(object sender, EventArgs e) { if (this.LEspecialidades.Count == 0) { MapeoCL oMapeo = new MapeoCL(); LEspecialidades = oMapeo.RecuperarEspecialidad(); LMedicos = oMapeo.RecuperarMedico(); CargarMedEsp(); LPaciente = oMapeo.RecuperarPaciente(); oMapeo.RecuperarPacienteporEsp(LPaciente, LEspecialidades); oMapeo.RecuperarPacienteMedico(LPaciente, LMedicos); Droga oDroga = new Droga("acelsalicico"); oDroga.AddAccion("dolor de cabeza"); Medicamento oMedicamento = new Medicamento("Aspirina"); oMedicamento.AddDrogas(oDroga, 40); LMedicamentos.Add(oMedicamento); LDroga.Add(oDroga); } }