public static string[] CargarFaltantes(string IDTrabajo)
        {
            Controller_Cortadora cc = new Controller_Cortadora();
            BodegaPliegos        d  = cc.CargaFaltantesDimensionadora(IDTrabajo, "", 0);

            return(new[] { d.Solicitada, d.Asignada, d.Faltante });
        }
Example #2
0
        public static string[] CrearPallet(string OT, string nombreot, string compo, string papel, int ancho, int largo, int gramaje, int Asignado, float peso)
        {
            Controller_Cortadora cc = new Controller_Cortadora();

            //BodegaPliegos d = cc.BuscaTotalCant(OT);
            return(new[] { "" });
        }
        public static string[] CargarFaltantesGuillotina(string IDTrabajo, string FolioOrigen)
        {
            Controller_Cortadora cc = new Controller_Cortadora();
            BodegaPliegos        d  = cc.CargaFaltantesDimensionadora(IDTrabajo, FolioOrigen, 1);

            return(new[] { d.Solicitada, d.Asignada, d.Faltante });
        }
        public static string CargaPalletCreados(string Folio, string OT, string Componente)
        {
            Controller_Cortadora cc = new Controller_Cortadora();
            string res = cc.CargaPalletCreados(Folio, OT, Componente, 0);

            return(res);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Controller_Cortadora cc = new Controller_Cortadora();
                string        ot        = Request.QueryString["ot"];
                string        compo     = Request.QueryString["comp"];
                string        codigo    = Request.QueryString["Codigo"];
                BodegaPliegos d         = cc.BuscaTotalCant(ot, compo, codigo);
                lblOT.Text         = d.OT;
                lblNombreOT.Text   = d.NombreOT;
                lblComponente.Text = d.Componente;
                lblPapel.Text      = d.Papel;
                lblCodigo.Text     = d.CodigoProducto;
                lblMarca.Text      = "";
                lblGramaje.Text    = d.Gramaje;
                lblAncho.Text      = d.Ancho;
                lblLargo.Text      = d.Largo;
                lblCantidad.Text   = d.StockFL;

                int sol = Convert.ToInt32(d.StockFL.Replace(".", ""));
                int ca  = cc.CantidadPallet(d.OT, d.Componente, d.CodigoProducto, 0);
                lblTotalSolicitado.Text = d.StockFL;
                lblTotalCreado.Text     = ca.ToString().Replace(",", ".");
                int resul = sol - ca;
                lblTotalFaltante.Text = resul.ToString().Replace(",", ".");
                this.BindDummyRow();
            }
        }
Example #6
0
        public static string[] BuscarOT(string OT)
        {
            Controller_Cortadora cc = new Controller_Cortadora();

            //BodegaPliegos d = cc.BuscaTotalCant(OT);
            //return new[] { d.OT, d.NombreOT, d.Componente, d.Papel, d.Gramaje, d.Ancho, d.Largo, d.StockFL };
            return(new[] { "" });
        }
 public static string[] CargaSolicitud(string IDCorte, string OT, string Componente, string SKU)
 {
     try
     {
         Controller_Cortadora cc = new Controller_Cortadora();
         BodegaPliegos        d  = cc.BuscaTotalCant(IDCorte, Componente, SKU);
         int sol   = Convert.ToInt32(d.StockFL.Replace(".", ""));
         int ca    = cc.CantidadPallet(d.OT, d.Componente, d.CodigoProducto, 0);
         int resul = sol - ca;
         return(new[] { d.OT, d.NombreOT.ToUpper(), d.Componente, d.Papel.ToUpper(), d.CodigoProducto, d.Gramaje, d.Ancho, d.Largo, d.StockFL, ca.ToString().Replace(",", "."), resul.ToString().Replace(",", "."), d.SKUSalida, d.FAncho, d.FLargo });
     }
     catch
     {
         return(new[] { "" });
     }
 }
        public static string[] BuscarOT(string loc)
        {
            Controller_Cortadora cc = new Controller_Cortadora();

            //string v = "";
            //string ot = "";
            //string compo = "";
            //string codigo = "";

            //if (loc.IndexOf("=") > 0)
            //{
            //    v = loc.Substring(loc.IndexOf("="), loc.IndexOf("&") - loc.IndexOf("="));
            //    string[] v2 = v.Split(',');
            //    ot = v2[0];
            //    compo = v2[1];
            //    codigo = v2[2];
            //}

            //BodegaPliegos d = cc.BuscaTotalCant(ot);
            //return new[] { d.OT, d.NombreOT, d.Componente, d.Papel, d.Gramaje, d.Ancho, d.Largo, d.StockFL };
            return(new[] { "" });
        }
        public static string[] CrearPallet(string OT, string NombreOT, string Comp, string Codigo, string Papel, int Ancho, int Largo, int Gramaje, int Cantidad, float Peso, int Faltante, string loc)
        {
            Controller_Cortadora cc = new Controller_Cortadora();

            if (OT != "" && Comp != "" && Cantidad != 0 && Peso != 0 && Codigo != "")
            {
                if ((Faltante - Cantidad) >= 0)
                {
                    string r = "";
                    r = cc.IngresarPallet("", Codigo, OT, Comp, NombreOT, Papel, "Sin Marca", Gramaje, Ancho, Largo, Cantidad, Peso, "Sistema", "", "", "", 0);//poner idtrabajo
                    if (r != "")
                    {
                        //string[] ll = loc.Split('?');
                        //string b = ll[1];
                        //string[] v2 = b.Split('&');
                        //string ot = v2[0].Replace("ot=", "");
                        //string compo = v2[1].Replace("comp=", "");
                        //string codigo = v2[2].Replace("Codigo=", "");


                        return(new[] { "OK" });
                    }
                    else
                    {
                        return(new[] { "Error" });
                    }
                }
                else
                {
                    return(new[] { "Error2" });
                }
            }
            else
            {
                return(new[] { "Error3" });
            }
        }
        public static string[] CrearPallet(string IDCorte, int Pliegos, float Peso, string Tipo, int Faltante, string Usuario, string SKUSalida)
        {
            Controller_Cortadora cc = new Controller_Cortadora();

            if (IDCorte == "" || Pliegos >= 0 || Peso >= 0)
            {
                if (Tipo == "Cerrar" || ((Faltante - Pliegos) == 0))
                {
                    string r = "";
                    r = cc.IngresarPalletCorte(IDCorte, Pliegos, Peso, Usuario, SKUSalida, 0);
                    // r = cc.IngresarPallet(FolioOrigen, Codigo, OT, Comp, NombreOT, Papel.Replace(Codigo, "").Trim(), "Sin Marca", Gramaje, Ancho, Largo, Cantidad, Peso, Usuario, FolioAnterior, FolioOrigen, "GUILLOTINA", 3);//poner idtrabajo
                    if (r != "")
                    {
                        return(new[] { "OK", r, "0" });
                    }
                    else
                    {
                        return(new[] { "¡Error al Generar el Pallet, vuela a intentarlo!" });
                    }
                }
                else
                {
                    if ((Faltante - Pliegos) > 0)
                    {
                        string r = "";
                        r = cc.IngresarPalletCorte(IDCorte, Pliegos, Peso, Usuario, SKUSalida, 1);
                        //   r = cc.IngresarPallet(FolioOrigen, Codigo, OT, Comp, NombreOT, Papel.Replace(Codigo, "").Trim(), "Sin Marca", Gramaje, Ancho, Largo, Cantidad, Peso, Usuario, FolioAnterior, FolioOrigen, "GUILLOTINA", 2);//poner idtrabajo
                        if (r != "")
                        {
                            return(new[] { "OK", r, "0" });
                        }
                        else
                        {
                            return(new[] { "¡Error al Generar el Pallet, vuela a intentarlo!" });
                        }
                    }
                    else
                    {
                        return(new[] { "¡La Cantidad ingresada no puede ser mayor a la faltante!" });
                    }
                }
            }
            else
            {
                return(new[] { "¡Debe Ingresar todos los campos!" });
            }


            //if (OT != "" && Comp != "" && Cantidad != 0 && Peso != 0 && Codigo != "" && Codigo!="Seleccionar")
            //{
            //    if (Procedencia.ToUpper()=="STOCK")
            //    {
            //        if (Tipo == "Cerrar" || ((Faltante - Cantidad) == 0))
            //        {
            //            string r = "";
            //            r = cc.IngresarPallet(FolioOrigen, Codigo, OT, Comp, NombreOT, Papel.Replace(Codigo, "").Trim(), "Sin Marca", Gramaje, Ancho, Largo, Cantidad, Peso, Usuario, FolioAnterior, FolioOrigen,"GUILLOTINA", 5);//poner idtrabajo
            //            if (r != "")
            //            {
            //                return new[] { "OK", r, "0" };
            //            }
            //            else
            //            {
            //                return new[] { "¡Error al Generar el Pallet, vuela a intentarlo!" };
            //            }
            //        }
            //        else
            //        {
            //            if ((Faltante - Cantidad) > 0)
            //            {
            //                string r = "";
            //                r = cc.IngresarPallet(FolioOrigen, Codigo, OT, Comp, NombreOT, Papel.Replace(Codigo, "").Trim(), "Sin Marca", Gramaje, Ancho, Largo, Cantidad, Peso, Usuario, FolioAnterior, FolioOrigen,"GUILLOTINA", 4);//poner idtrabajo
            //                if (r != "")
            //                {
            //                    return new[] { "OK", r, "0" };
            //                }
            //                else
            //                {
            //                    return new[] { "¡Error al Generar el Pallet, vuela a intentarlo!" };
            //                }
            //            }
            //            else
            //            {
            //                return new[] { "¡La Cantidad ingresada no puede ser mayor a la faltante!" };
            //            }
            //        }
            //    }
            //    else
            //    {
            //        if (Tipo == "Cerrar" || ((Faltante - Cantidad) == 0))
            //        {
            //            string r = "";
            //            r = cc.IngresarPallet(FolioOrigen, Codigo, OT, Comp, NombreOT, Papel.Replace(Codigo, "").Trim(), "Sin Marca", Gramaje, Ancho, Largo, Cantidad, Peso, Usuario, FolioAnterior, FolioOrigen,"GUILLOTINA", 3);//poner idtrabajo
            //            if (r != "")
            //            {
            //                return new[] { "OK", r, "0" };
            //            }
            //            else
            //            {
            //                return new[] { "¡Error al Generar el Pallet, vuela a intentarlo!" };
            //            }
            //        }
            //        else
            //        {
            //            if ((Faltante - Cantidad) > 0)
            //            {
            //                string r = "";
            //                r = cc.IngresarPallet(FolioOrigen, Codigo, OT, Comp, NombreOT, Papel.Replace(Codigo, "").Trim(), "Sin Marca", Gramaje, Ancho, Largo, Cantidad, Peso, Usuario, FolioAnterior, FolioOrigen,"GUILLOTINA", 2);//poner idtrabajo
            //                if (r != "")
            //                {
            //                    return new[] { "OK", r, "0" };
            //                }
            //                else
            //                {
            //                    return new[] { "¡Error al Generar el Pallet, vuela a intentarlo!" };
            //                }
            //            }
            //            else
            //            {
            //                return new[] { "¡La Cantidad ingresada no puede ser mayor a la faltante!" };
            //            }
            //        }
            //    }
            //}
            //else
            //{
            //    return new[] { "¡Debe Ingresar todos los campos!" };
            //}
        }
        public static string[] CrearSolicitudCorte(string FolioOrigen, string OT, string NombreOT, string Comp, string SKU, string Papel, int Ancho, int Largo, int Gramaje, int Cantidad, float Peso, int Faltante, string loc, int Factor, string Folio, int FAncho, int FLargo, string Usuario, string IDT, string Tipo)
        {
            Controller_Dimensionadora cc = new Controller_Dimensionadora();
            Controller_Cortadora      cp = new Controller_Cortadora();
            string r = "";

            if (OT != "" && Comp != "" && Cantidad != 0 && Peso != 0 && SKU != "" && SKU != "Seleccionar")
            {
                //if (OT == "Stock")
                //{
                #region Stock
                if (FAncho == Ancho || FLargo == Largo)
                {
                    //finalizar pallet y generar etiqueta BP
                    if (Tipo.ToLower() == "cerrar" || ((Faltante - Cantidad) == 0))
                    {
                        r = cp.IngresarPallet(FolioOrigen, SKU, OT, Comp, NombreOT, Papel, "Sin Marca", Gramaje, Ancho, Largo, Cantidad, Peso, Usuario, FolioOrigen, IDT, "DIMENSIONADORA", 3);
                        if (r != "")
                        {
                            return(new[] { "OK", r, "0" });
                        }
                        else
                        {
                            return(new[] { "¡Error al Generar el Pallet, vuela a intentarlo!" });
                        }
                    }
                    else
                    {
                        if ((Faltante - Cantidad) > 0)
                        {
                            r = cp.IngresarPallet(FolioOrigen, SKU, OT, Comp, NombreOT, Papel, "Sin Marca", Gramaje, Ancho, Largo, Cantidad, Peso, Usuario, FolioOrigen, IDT, "DIMENSIONADORA", 2);
                            if (r != "")
                            {
                                return(new[] { "OK", r, "0" });
                            }
                            else
                            {
                                return(new[] { "¡Error al Generar el Pallet, vuela a intentarlo!" });
                            }
                        }
                        else
                        {
                            return(new[] { "¡La Cantidad ingresada no puede ser mayor a la faltante!" });
                        }
                    }
                }
                else
                {
                    //si cambia el formato generar SC
                    if (FAncho < Ancho || FLargo < Largo)
                    {
                        if (Tipo == "CERRAR" || ((Faltante - Cantidad) == 0))
                        {
                            //r = cc.CrearSolicitudCorte(OT, Comp, Papel, SKU, Gramaje, Ancho, Largo, FAncho, FLargo, Factor, Cantidad, Peso, Usuario, Folio, IDT, 1);
                            r = cc.CrearSolicitudCorte("", SKU, OT, Comp, NombreOT, Papel, "", Gramaje, Ancho, Largo, Cantidad, Peso, Usuario, Folio, IDT, "", 5);
                            if (r != "")
                            {
                                return(new[] { "OK", r, "1" });
                            }
                            else
                            {
                                return(new[] { "¡Error al Generar el Pallet, vuela a intentarlo!" });
                            }
                        }
                        else
                        {
                            if ((Faltante - Cantidad) > 0)
                            {
                                r = cc.CrearSolicitudCorte("", SKU, OT, Comp, NombreOT, Papel, "", Gramaje, Ancho, Largo, Cantidad, Peso, Usuario, Folio, IDT, "", 4);
                                if (r != "")
                                {
                                    return(new[] { "OK", r, "1" });
                                }
                                else
                                {
                                    return(new[] { "¡Error al Generar el Pallet, vuela a intentarlo!" });
                                }
                            }
                            else
                            {
                                return(new[] { "¡La Cantidad ingresada no puede ser mayor a la faltante!" });
                            }
                        }
                    }
                    else
                    {
                        return(new[] { "¡El Formato de corte no puede ser mayor a el formato del papel!" });   //el formato de corte no puede ser mayor
                    }
                }
                #endregion
                //}
                //else
                //{
                //    #region crear pallet para ot

                //    if (FAncho > Ancho || FLargo > Largo)
                //    {
                //        return new[] { "Error4" };
                //    }
                //    else
                //    {
                //        if (FAncho == Ancho || FLargo == Largo)
                //        {
                //            if (Tipo == "Cerrar" || ((Faltante - Cantidad) == 0))
                //            {
                //                r = cp.IngresarPallet(FolioOrigen, "", OT, Comp, NombreOT, Papel, "Sin Marca", Gramaje, Ancho, Largo, Cantidad, Peso, Usuario, FolioOrigen, IDT, 3);
                //                if (r != "")
                //                {
                //                    return new[] { "OK", r, "0" };
                //                }
                //                else
                //                {
                //                    return new[] { "¡Error al Generar el Pallet, vuela a intentarlo!" };
                //                }
                //            }
                //            else
                //            {
                //                if ((Faltante - Cantidad) > 0)
                //                {

                //                    r = cp.IngresarPallet(FolioOrigen, "", OT, Comp, NombreOT, Papel, "Sin Marca", Gramaje, Ancho, Largo, Cantidad, Peso, Usuario, FolioOrigen, IDT, 2);
                //                    if (r != "")
                //                    {
                //                        return new[] { "OK", r, "0" };
                //                    }
                //                    else
                //                    {
                //                        return new[] { "¡Error al Generar el Pallet, vuela a intentarlo!" };
                //                    }
                //                }
                //                else
                //                {
                //                    return new[] { "¡La Cantidad ingresada no puede ser mayor a la faltante!" };
                //                }
                //            }
                //        }
                //        else
                //        {
                //            if (FAncho < Ancho || FLargo < Largo)
                //            {
                //                if (Tipo == "CERRAR" || ((Faltante - Cantidad) == 0))
                //                {

                //                    r = cc.CrearSolicitudCorte(OT, Comp, Papel, SKU, Gramaje, Ancho, Largo, FAncho, FLargo, Factor, Cantidad, Peso, Usuario, Folio, IDT, 1);
                //                    if (r != "")
                //                    {
                //                        return new[] { "OK", r, "1" };
                //                    }
                //                    else
                //                    {
                //                        return new[] { "¡Error al Generar el Pallet, vuela a intentarlo!" };
                //                    }
                //                }
                //                else
                //                {

                //                    if ((Faltante - Cantidad) > 0)
                //                    {
                //                        r = cc.CrearSolicitudCorte(OT, Comp, Papel, SKU, Gramaje, Ancho, Largo, FAncho, FLargo, Factor, Cantidad, Peso, Usuario, Folio, IDT, 0);
                //                        if (r != "")
                //                        {
                //                            return new[] { "OK", r, "1" };
                //                        }
                //                        else
                //                        {
                //                            return new[] { "¡Error al Generar el Pallet, vuela a intentarlo!" };
                //                        }
                //                    }
                //                    else
                //                    {
                //                        return new[] { "¡La Cantidad ingresada no puede ser mayor a la faltante!" };
                //                    }
                //                }
                //            }
                //            else
                //            {
                //                return new[] { "¡El Formato de corte no puede ser mayor a el formato del papel!" };//el formato de corte no puede ser mayor
                //            }
                //        }
                //    }
                //    #endregion
                //}
            }
            else
            {
                return(new[] { "¡Debe ingrear todos los campos!" });//campos vacios
            }
        }