protected void Page_Load(object sender, EventArgs e) { cargardatospaciente(); IngresoDTO ingresoDTO = (IngresoDTO)Session["ingresoDTO"]; PacienteDTO pacienteDTO = (PacienteDTO)Session["pacienteDTO"]; List <ProcedimientoDTO> listProcedimientoDTO = new List <ProcedimientoDTO>(); ProcedimientoNEG procedimientoNEG = new ProcedimientoNEG(); ProcedimientoDTO procedimientoDTOIN = new ProcedimientoDTO(); procedimientoDTOIN.ingresoID = ingresoDTO.ingresoID; listProcedimientoDTO = procedimientoNEG.readxIngreso(procedimientoDTOIN); gvProcedimientos.DataSource = listProcedimientoDTO; gvProcedimientos.DataBind(); List <FormulaMedicamentoDTO> listFormMedDTO = new List <FormulaMedicamentoDTO>(); FormulaMedicamentoNEG FormMedNEG = new FormulaMedicamentoNEG(); FormulaMedicamentoDTO ForMedDTOIN = new FormulaMedicamentoDTO(); ForMedDTOIN.ingresoID = ingresoDTO.ingresoID; listFormMedDTO = FormMedNEG.readxIngreso(ForMedDTOIN); gvMedicamentos.DataSource = listFormMedDTO; gvMedicamentos.DataBind(); }
protected void btnIngreso_Click(object sender, EventArgs e) { IngresoDTO ingresoDTO = (IngresoDTO)Session["ingreso_ADM_DTO"]; FormulaMedicamentoNEG formulamedicamentoNEG = new FormulaMedicamentoNEG(); FormulaMedicamentoDTO formulamedicamentoDTOIN = new FormulaMedicamentoDTO(); int retorno = 0; formulamedicamentoDTOIN.medicamento = txtNombreMedicamento.Text; formulamedicamentoDTOIN.cantidad = txtCantidad.Text; formulamedicamentoDTOIN.medida = txtMedidad.Text; formulamedicamentoDTOIN.unidad_medida = ddlUnidadMedida.SelectedValue.ToString(); formulamedicamentoDTOIN.ingresoID = ingresoDTO.ingresoID; retorno = formulamedicamentoNEG.create(formulamedicamentoDTOIN); if (retorno == 1) { //Mensaje OK divok.Visible = true; } else { //Mensaje OK diverror.Visible = true; } }