Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                lblTitulo.Text = "Asignar Papel Solicitud PreID ";
                lblPreID.Text  = Request.QueryString["preid"];

                int    id    = Convert.ToInt32(Request.QueryString["id"]);
                string ot    = Request.QueryString["ot"];
                string comp  = Request.QueryString["comp"];
                int    solFL = Convert.ToInt32(Request.QueryString["solFL"]);
                int    solKG = Convert.ToInt32(Request.QueryString["solKG"]);
                lblSolicitado.Text = "Cantidad Solicitada: " + solFL.ToString("N0").Replace(",", ".") + " Pliegos.";

                lista = bp.ListadoDetalleSKU(id.ToString(), "", "", 0, "", "", 0, 0, 0, "", 0, "", "", 2, 0);

                RadGrid1.DataSource = lista;//.Where(s => s.Asignar == "NO").ToList();
                RadGrid1.DataBind();

                gv1.DataSource = lista2;
                gv1.DataBind();
                BodegaPliegos d = bp.BuscaOTComponente(Request.QueryString["ot"], Request.QueryString["comp"], "", "", DateTime.Now, DateTime.Now, 0, 4);
                lblCodigoProducto.Text = d.CodigoProducto;
                lblPapel.Text          = d.Papel.ToUpper();
                lblGramaje.Text        = d.Gramaje;
                lblAncho.Text          = d.Ancho;
                lblLargo.Text          = d.Largo;
                if (d.Papel.Contains("PEFC"))
                {
                    lblCertificacion.Text     = "SI";
                    lblTipoCertificacion.Text = "PEFC";
                }
                else
                {
                    lblCertificacion.Text     = "NO";
                    lblTipoCertificacion.Text = "-";
                }
            }
        }
Ejemplo n.º 2
0
        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(",", ".");
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                RadGrid1.DataSource = "";
                RadGrid1.DataBind();

                BodegaPliegos d = bp.BuscaOTComponente(Request.QueryString["ot"], Request.QueryString["comp"], "", "", DateTime.Now, DateTime.Now, 0, 4);
                lblCodigoProducto.Text = d.CodigoProducto;
                lblPapel.Text          = d.Papel.ToUpper().Replace("  ", " ");
                string gramaje  = "";
                string Papel    = "";
                string Ancho    = "";
                string Largo    = "";
                int    contador = 0;
                int    b        = 0;
                try
                {
                    string[] algo = d.Papel.Split(' ');
                    for (int i = 0; i < algo.Length; i++)
                    {
                        if (algo[i].ToString().Trim() != "")
                        {
                            if (int.TryParse(algo[i].ToString().Substring(0, 1), out b))
                            {
                                if (contador == 0)
                                {
                                    gramaje = algo[i].ToString().ToLower().Replace("g", "").Replace("gr", "");
                                }
                                else
                                {
                                    string[] axl = algo[i].ToString().Split('x');
                                    Ancho = axl[0].ToString().Replace("m", "").Replace("mm", "");
                                    Largo = axl[1].ToString().Replace("m", "").Replace("mm", "");
                                }
                                contador++;
                            }
                            else
                            {
                                Papel += algo[i].ToString() + " ";
                            }
                        }
                    }
                    txtPapel.Text   = Papel;
                    txtGramaje.Text = gramaje;
                    txtAncho.Text   = Ancho;
                    txtLargo.Text   = Largo;
                    btnFiltro_Click1(sender, e);
                }
                catch
                {
                }

                lblGramaje.Text = d.Gramaje;
                lblAncho.Text   = d.Ancho;
                lblLargo.Text   = d.Largo;

                if (d.Papel.Contains("PEFC"))
                {
                    lblCertificacion.Text     = "SI";
                    lblTipoCertificacion.Text = "PEFC";
                }
                else
                {
                    lblCertificacion.Text     = "NO";
                    lblTipoCertificacion.Text = "-";
                }

                lblSolicitado.Text = "Cantidad Solicitada: " + Convert.ToInt32(Request.QueryString["solFL"]).ToString("N0").Replace(",", ".") + " Pliegos.";



                ddlCertificacion.DataSource     = bp.BuscaCertificaciones("", "", "", "", "", "", 0, 0, 0, 0, 0, "", "", 1);
                ddlCertificacion.DataTextField  = "Certificacion";
                ddlCertificacion.DataValueField = "Certificacion";
                ddlCertificacion.DataBind();
                ddlCertificacion.Items.Insert(0, new ListItem("Seleccione..."));
            }
            // (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);
        }