public static bool Delete(int id) { Controller_BodegaPliegos control = new Controller_BodegaPliegos(); return(control.ElimanarAsignacion(id, "", 2)); }
protected void Page_Load(object sender, EventArgs e) { txtAncho.Attributes.Add("onkeypress", "return solonumeros(event);"); txtLargo.Attributes.Add("onkeypress", "return solonumeros(event);"); try { if (Request.QueryString["p"] == "1") { } else { bool x = bp.ElimanarAsignacion(0, Request.QueryString["usuario"], 3); } } catch { } if (!IsPostBack) { lblTitulo.Text = "Atender Solicitud PreID "; lblPreID.Text = bp.PREID("", "", "", 0, "", "", 0, 0, 0, "", 0, "", "", 3, 0).ToString(); string Papel = ""; DateTime f = DateTime.Now; BodegaPliegos d = bp.BuscaOTComponente(Request.QueryString["ot"], Request.QueryString["comp"], "", "", f, f, 0, 4); lblOT.Text = d.OT; lblNombreOT.Text = d.NombreOT.ToUpper(); lblComponente.Text = d.Componente; lblFormatoPapel.Text = d.FormatoPapel; lblFechaCreacion.Text = d.FechaCreacion; lblCliente.Text = d.Cliente; lblCodigoProducto.Text = d.CodigoProducto; lblPapel.Text = d.Papel.ToUpper(); lblGramaje.Text = d.Gramaje; lblAncho.Text = d.Ancho; lblLargo.Text = d.Largo; txtAncho.Text = d.Ancho; txtLargo.Text = d.Largo; if (d.Papel.Contains("PEFC")) { lblCertificacion.Text = "SI"; lblTipoCertificacion.Text = "PEFC"; } else { lblCertificacion.Text = "NO"; lblTipoCertificacion.Text = "-"; } #region papel if (d.Papel.Contains("Bond Blanco")) { Papel = "bond blanco"; } else if (d.Papel.Contains("Bond Crema")) { Papel = "bond crema"; } else if (d.Papel.Contains("Bond Ahuesado")) { Papel = "bond ahuesado"; } else if (d.Papel.Contains("Cartulina")) { Papel = "cartulina"; } else if (d.Papel.Contains("Couche Brillante")) { Papel = "couche brillante"; } else if (d.Papel.Contains("Couche Op")) { Papel = "couche op"; } else if (d.Papel.Contains("diario hibrite")) { Papel = "diario hibrite"; } else if (d.Papel.Contains("diario periodico")) { Papel = "diario periodico"; } else if (d.Papel.Contains("diario salmon")) { Papel = "diario salmon"; } else if (d.Papel.Contains("Diario")) { Papel = "diario"; } else if (d.Papel.Contains("lwc brillante")) { Papel = "lwc brillante"; } else if (d.Papel.Contains("lwc opaco")) { Papel = "lwc opaco"; } #endregion RadGrid1.DataSource = bp.StockBodegaPliegos(lblOT.Text, lblComponente.Text, lblLargo.Text, Papel, Convert.ToInt32(lblGramaje.Text), Convert.ToInt32(lblAncho.Text), Convert.ToInt32(Request.QueryString["solFL"]), Convert.ToInt32(Request.QueryString["solKG"]), lblPreID.Text, Request.QueryString["usuario"], 2); RadGrid1.DataBind(); RadGrid2.DataSource = bp.ListadoPapelAsignado(lblOT.Text, lblComponente.Text, "", "", 0, 0, 0, "", 0, "", "", lblPreID.Text, 0, 1, 0); RadGrid2.DataBind(); int totalAsignado = bp.totalAsignado(lblOT.Text, lblComponente.Text, 0); //for (int i = 0; i < RadGrid2.Items.Count; i++) //{ // totalAsignado = totalAsignado + Convert.ToInt32(RadGrid2.Items[i]["stockFL"].Text); //} lblAsignadoFL.Text = totalAsignado.ToString("N0").Replace(",", "."); lblSolicitadoFL.Text = Convert.ToInt32(Request.QueryString["solFL"]).ToString("N0").Replace(",", "."); lblSolicitadoKG.Text = Convert.ToInt32(Request.QueryString["solKG"]).ToString("N0").Replace(",", "."); lblSaldoFL.Text = (Convert.ToInt32(Request.QueryString["solFL"]) - totalAsignado).ToString("N0").Replace(",", "."); } }
protected void btnAsignar_Click(object sender, EventArgs e) { string ot = Request.QueryString["ot"]; string compo = Request.QueryString["comp"]; bool br = false; if (gv1.Rows.Count > 0) { for (int i = 0; i <= gv1.Rows.Count - 1; i++) { String torval = ((TextBox)gv1.Rows[i].FindControl("txtCantidad")).Text; String drop = ((DropDownList)gv1.Rows[i].FindControl("ddlFactor")).SelectedValue.ToString(); int fac = Convert.ToInt32(drop); string inicial = gv1.Rows[i].Cells[11].Text; int ini = Convert.ToInt32(inicial); int asignado = Convert.ToInt32(torval); if (asignado <= ini) { int result = 0; //ot //compo //Request.QueryString["usuario"] //idpapel Convert.ToInt32(gv1.Rows[i].Cells[0].Text) //asignado result = bp.InsertAsignarPapelCorte(ot, compo, gv1.Rows[i].Cells[0].Text, asignado, Request.QueryString["usuario"], 0); //result = bp.InsertAsignarPapel(ot, compo, lblPreID.Text, Convert.ToInt32(gv1.Rows[i].Cells[0].Text), gv1.Rows[i].Cells[1].Text, gv1.Rows[i].Cells[2].Text, Convert.ToInt32(gv1.Rows[i].Cells[7].Text), Convert.ToInt32(gv1.Rows[i].Cells[8].Text), Convert.ToInt32(gv1.Rows[i].Cells[9].Text), "", asignado, gv1.Rows[i].Cells[10].Text, Request.QueryString["usuario"], 0, fac); if (result > 0) { br = false; } else { br = true; break; } //transaccion } else { br = true; break; } } } if (br == true) { string popupScript = "<script language='JavaScript'>alert('La cantidad Asignada no puede ser mayor al stock disponible'); </script>"; Page.RegisterStartupScript("PopupScript", popupScript); for (int i = 0; i <= gv1.Rows.Count - 1; i++) { bool r = bp.ElimanarAsignacion(Convert.ToInt32(gv1.Rows[i].Cells[0].Text), "", 1); // gv1.Rows[i].Cells[11].Text; } // bool resp = bp.ElimanarAsignacion(Request.QueryString["usuario"], 0); } else { string popupScript = "<script language='JavaScript'>alert('Pliegos Asignados Correctamente');location.href='AtenderSolicitudPapel2.aspx?ot=" + ot + "&comp=" + compo + "&solFL=" + Request.QueryString["solFL"] + "&solKG=" + Request.QueryString["solKG"] + "&preid=" + Request.QueryString["preid"] + "&usuario=" + Request.QueryString["usuario"] + "&p=1'; </script>"; Page.RegisterStartupScript("PopupScript", popupScript); } }