protected void B_Conflicto_Click(object sender, EventArgs e) { DAOUsuario dAO = new DAOUsuario(); Pedido devolver = new Pedido(); DateTime fechaHoy = DateTime.Now; devolver.Sede = Convert.ToString(Session["sede"]); devolver.Fecha = fechaHoy.ToString("d"); devolver.Estado = false; dAO.crearPedido(devolver, TB_Observación.Text); DataTable id = new DataTable(); id = dAO.verUltimoId(); if (id.Rows.Count > 0) { foreach (DataRow rowe in id.Rows) { devolver.Idpedido = Convert.ToInt32(rowe["f_verultimoid"]); } foreach (GridViewRow row in GV_Devolver.Rows) { Asignacion temp = new Asignacion(); temp.Referencia = Convert.ToString(((Label)row.Cells[0].FindControl("L_Referencia")).Text); temp.Talla = Convert.ToDouble(((Label)row.Cells[1].FindControl("L_Talla")).Text); temp.Cantidad = Convert.ToInt32(((Label)row.Cells[1].FindControl("L_Cantidad")).Text); dAO.crearPedidos(temp, devolver.Idpedido); } } TB_Observación.Text = ""; GV_Devolver.DataSource = null; GV_Devolver.DataBind(); }
void llenarGV_Devoluciones() { List <Inventario> inventarios; if (Session["listaDev"] == null) { #pragma warning disable CS0618 // Type or member is obsolete RegisterStartupScript("mensaje", "<script type='text/javascript'>alert('No hay productos con conflictos para enviar.');</script>"); #pragma warning restore CS0618 // Type or member is obsolete } else { inventarios = (Session["listaDev"] as List <Inventario>); GV_Devolver.DataSource = inventarios; GV_Devolver.DataBind(); } }