protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { List Lista = LogicaFarmaceutica.ListarFarm(); if (Lista != null) { try { drplistarfarma.DataSource = Lista; drplistarfarma.DataTextField = "ruc"; drplistarfarma.DataValueField = "ruc"; drplistarfarma.DataBind();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
List<Farmaceutica> Lista = LogicaFarmaceutica.ListarFarm();
if (Lista != null)
{
try
{
drplistarfarma.DataSource = Lista;
drplistarfarma.DataTextField = "ruc";
drplistarfarma.DataValueField = "ruc";
drplistarfarma.DataBind();
}
catch
{
lblerror.Text = "Error en grilla";
}
}
}
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
Medicamentos M = null;
string ruc = drplistarfarma.SelectedValue;
int numero = Convert.ToInt32(Gvmedicamentos.SelectedRow.Cells[1].Text);
Session["medi"] = LogicaMedicamento.ListarFarma(M.Farmacia);
Gvmedicamentos.DataSource = Session["medi"];
Gvmedicamentos.DataBind();
}
catch
{
lblerror.Text = "error";
}
}
protected void drplistarfarma_SelectedIndexChanged(object sender, EventArgs e)
{
if (drplistarfarma.SelectedValue != null)
{
try
{
string nombre = drplistarfarma.SelectedValue;
Medicamentos M = null;
Gvmedicamentos.DataSource = Session["medi"];
Gvmedicamentos.DataBind();
}
catch
{
lblerror.Text = "Error en grilla.";
}
}