示例#1
0
        protected void btnInsertar_Click(object sender, EventArgs e)
        {
            DataTable dt = Session["DescarteDetalle"] as DataTable;
            DataRow   dr = dt.NewRow();

            dr["Medicamento"] = ((DropDownList)grdDescarteDetalle.FooterRow.FindControl("ddlInsertMedicamento")).SelectedValue;
            dr["Lote"]        = ((DropDownList)grdDescarteDetalle.FooterRow.FindControl("ddlInsertLote")).SelectedValue;
            dr["Cantidad"]    = ((TextBox)grdDescarteDetalle.FooterRow.FindControl("txtInsertCantidad")).Text;
            dr["Motivo"]      = ((TextBox)grdDescarteDetalle.FooterRow.FindControl("txtInsertMotivo")).Text;
            dr["Eliminar"]    = string.Empty;

            dt.Rows.Add(dr);
            grdDescarteDetalle.DataSource = dt;
            grdDescarteDetalle.DataBind();
            Session["DescarteDetalle"] = dt;

            grdDescarteDetalle.Rows[0].Visible = false;
            descarte.DropMedicamento((DropDownList)grdDescarteDetalle.FooterRow.FindControl("ddlInsertMedicamento"));
            descarte.DropLote((DropDownList)grdDescarteDetalle.FooterRow.FindControl("ddlInsertLote"));
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            descarte = new DescarteAD();

            if (!IsPostBack)
            {
                GridLoad();

                descarte.DropBodega(ddlBodegaOrigen);
                descarte.DropMedicamento((DropDownList)grdDescarteDetalle.FooterRow.FindControl("ddlInsertMedicamento"));
                descarte.DropLote((DropDownList)grdDescarteDetalle.FooterRow.FindControl("ddlInsertLote"));
            }
        }