protected void btnCerrarPallet_Click(object sender, EventArgs e) { if (txtCodigo.Text != "") { List <Prod_Terminados> lisPT = new List <Prod_Terminados>(); lisPT = cPT.BuscaPallet(txtCodigo.Text); if (lisPT.Count != 0) { bool respuesta = cPT.CerrarPallet(txtCodigo.Text, Session["Usuario"].ToString()); if (respuesta == true) { DivMensaje.Visible = true; imgMensaje.ImageUrl = "../../Images/tick.png"; lblCodAnterior.Text = txtCodigo.Text; lblMensaje.Text = "El Pallet " + txtCodigo.Text + " ha sido Cerrado Correctamente."; lblMensaje.ForeColor = Color.White; DivMensaje.Attributes.Add("style", "background-color:Green"); if (cPT.CorreoPrimerDespacho(txtOT.Text, "cjerias", 0) == false) { bool rrr = cPT.CorreoPrimerDespacho(txtOT.Text.Trim(), "cjerias", 1); generarCorreo(txtOT.Text, cPT.CargarPalletsCorreo(lblCodAnterior.Text.Trim(), txtOT.Text.Trim(), 2), txtNombreOT.Text); } //habilita impresion btnImprimir.Attributes.Add("onclick", "window.open('EtiquetaProductosTerminados.aspx?Cod=" + txtCodigo.Text + ",'Procesar Documento','toolbar=no, location=yes,status=no,menubar=no,scrollbars=no,resizable=no, width=730,height=650,left=340,top=200')"); btnImprimir.Visible = true; Recarga(); } else { DivMensaje.Visible = true; imgMensaje.ImageUrl = "../../Images/cross.png"; lblMensaje.Text = "Ha ocurrido un Error, vuelva a intentarlo."; lblMensaje.ForeColor = Color.White; DivMensaje.Attributes.Add("style", "background-color:Red"); } } else { DivMensaje.Visible = true; imgMensaje.ImageUrl = "../../Images/cross.png"; lblMensaje.Text = "Pallet Vacio, debe ingresar productos para cerrar un pallet."; lblMensaje.ForeColor = Color.White; DivMensaje.Attributes.Add("style", "background-color:Red"); } } }