Ejemplo n.º 1
0
        public static string validaInfo(string valor, string tipo, string orden = null)
        {
            string    strSecondVal = string.Empty;
            string    strError     = string.Empty;
            string    retorno      = string.Empty;
            DataTable resultado    = new DataTable();

            InterfazDAL_ttwhcol016 idal016 = new InterfazDAL_ttwhcol016();
            Ent_ttwhcol016         obj016  = new Ent_ttwhcol016();

            InterfazDAL_tticol090 idal = new InterfazDAL_tticol090();
            Ent_tticol090         obj  = new Ent_tticol090();

            if (tipo == "1") // Items
            {
                obj.item = valor;
                obj.fpdn = orden;

                resultado = idal.lineClearance_verificaRegistrosOrden_Param(ref obj, ref strError);
            }

            if (tipo == "2") // Lote
            {
                String[] valores = valor.Split('|');

                obj016.clot = valores[0].Trim().ToUpperInvariant();
                obj016.item = valores[1].Trim().ToUpperInvariant();
                obj.fpdn    = orden;

                resultado = idal016.TakeMaterialInv_verificaLote_Param(ref obj016, ref strError);
                strError  = _idioma == "INGLES" ? "Lot code doesn´t exist. Cannot Continue" : "Codigo de lote no existe, no se puede continuar.";
                if (string.IsNullOrEmpty(strError))
                {
                    resultado = idal.lineClearance_verificaRegistrosOrden_Param(ref obj, ref obj016, ref strError);
                }
                strError = _idioma == "INGLES" ? "Lot code was not on Work Order. Cannot Continue" : "Codigo de lote no es de la orden de trabajo, no se puede continuar.";
            }

            // Validar si el numero de orden trae registros
            if (strError != string.Empty)
            {
                return("BAAN: " + strError);
            }
            if (resultado.Rows.Count > 0)
            {
                retorno = resultado.Rows[0]["DESCRIPCION"].ToString();
            }

            return(retorno);
        }
Ejemplo n.º 2
0
        public static string validaInfo(string valor, string tipo, string orden = null)
        {
            string    strSecondVal = string.Empty;
            string    strError     = string.Empty;
            string    retorno      = string.Empty;
            DataTable resultado    = new DataTable();

            InterfazDAL_ttwhcol016 idal016 = new InterfazDAL_ttwhcol016();
            Ent_ttwhcol016         obj016  = new Ent_ttwhcol016();

            InterfazDAL_tticol090 idal = new InterfazDAL_tticol090();
            Ent_tticol090         obj  = new Ent_tticol090();

            if (tipo == "1") // Items
            {
                obj.item = valor;
                obj.fpdn = orden;

                resultado = idal.lineClearance_verificaRegistrosOrden_Param(ref obj, ref strError);
            }

            if (tipo == "2") // Lote
            {
                String[] valores = valor.Split('|');

                obj016.clot = valores[0].Trim().ToUpperInvariant();
                obj016.item = valores[1].Trim().ToUpperInvariant();
                obj.fpdn    = orden;

                resultado = idal016.TakeMaterialInv_verificaLote_Param(ref obj016, ref strError);

                if (string.IsNullOrEmpty(strError))
                {
                    resultado = idal.lineClearance_verificaRegistrosOrden_Param(ref obj, ref obj016, ref strError);
                }
            }

            // Validar si el numero de orden trae registros
            if (strError != string.Empty)
            {
                return("BAAN: " + strError);
            }
            if (resultado.Rows.Count > 0)
            {
                retorno = resultado.Rows[0]["DESCRIPCION"].ToString();
            }

            return(retorno);
        }
Ejemplo n.º 3
0
        public static string validaInfo(string valor, string tipo, string orden = null)
        {
            string    strSecondVal = string.Empty;
            string    strError     = string.Empty;
            string    retorno      = string.Empty;
            DataTable resultado    = new DataTable();

            InterfazDAL_ttwhcol016 idal016 = new InterfazDAL_ttwhcol016();
            Ent_ttwhcol016         obj016  = new Ent_ttwhcol016();

            InterfazDAL_ttscol100 idal = new InterfazDAL_ttscol100();
            Ent_ttscol100         obj  = new Ent_ttscol100();

            if (tipo == "1") // Items
            {
                obj.item  = valor;
                resultado = idal.spareDelivery_listaRegistroItem_Param(ref obj, ref strError);
                if (resultado.Rows.Count > 0)
                {
                    retorno = resultado.Rows[0]["DESCRIPCION"].ToString().Trim() + "|" +
                              resultado.Rows[0]["UNIDAD"].ToString().Trim() + "|" +
                              resultado.Rows[0]["ARTICULO"].ToString().Trim();
                }
            }

            if (tipo == "2") // Lote
            {
                obj.loca  = valor;
                resultado = idal.spareDelivery_listaRegistroUbicacion_Param(ref obj, ref strError);
                if (resultado.Rows.Count > 0)
                {
                    retorno = resultado.Rows[0]["LOCATION"].ToString().Trim() + "|" +
                              resultado.Rows[0]["WAREHOUSE"].ToString().Trim();
                }
            }

            // Validar si el numero de orden trae registros
            if (strError != string.Empty)
            {
                return("BAAN: " + strError);
            }
            // if (resultado.Rows.Count > 0) { retorno = resultado.Rows[0]["DESCRIPCION"].ToString(); }

            return(retorno);
        }
        public static string validaInfo(string valor, string tipo)
        {
            InterfazDAL_ttwhcol016 idal = new InterfazDAL_ttwhcol016();
            Ent_ttwhcol016         obj  = new Ent_ttwhcol016();
            string    strError          = string.Empty;
            string    retorno           = string.Empty;
            DataTable resultado         = new DataTable();
            string    strSecondVal      = string.Empty;

            if (tipo == "1") // Bodega
            {
                obj.cwar  = valor.Trim().ToUpperInvariant();
                resultado = idal.TakeMaterialInv_verificaBodega_Param(ref obj, ref strError);
            }
            if (tipo == "2") // Zona
            {
                obj.zone  = valor.Trim().ToUpperInvariant();
                resultado = idal.TakeMaterialInv_verificaZona_Param(ref obj, ref strError);
                if (resultado.Rows.Count > 0)
                {
                    int consecutivo = 0;
                    consecutivo  = idal.TakeMaterialInv_verificaConsLabel_Param(ref obj, ref strError);
                    strSecondVal = "|" + consecutivo.ToString().Trim();

                    if (consecutivo < 1)
                    {
                        strError = _idioma == "INGLES" ? "Sequence Zone " + valor + " doesn't exist. Cannot Continue"
                            : "Secunecia de zona " + valor + " no existe, no se puede continuar.";
                    }
                }
            }
            if (tipo == "3") // Item
            {
                obj.item  = valor.Trim().ToUpperInvariant();
                resultado = idal.TakeMaterialInv_verificaItem_Param(ref obj, ref strError);
                if (resultado.Rows.Count <= 0)
                {
                    strError = _idioma == "INGLES" ? "Item code doesn´t exist. Cannot continue" : "Codigo de articulo no existe. No se puede continuar";
                }
            }
            if (tipo == "4") // Lote
            {
                obj.clot  = valor.Trim().ToUpperInvariant();
                resultado = idal.TakeMaterialInv_verificaLote_Param(ref obj, ref strError);
                if (resultado.Rows.Count <= 0)
                {
                    strError = _idioma == "INGLES" ? "Lot Code doesn´t exist. Cannot Continue" : "Codigo de lote no existe. No se puede continuar";
                }
            }



            // Validar si el numero de orden trae registros
            if (strError != string.Empty)
            {
                return("BAAN: " + strError);
            }

            if (resultado.Rows.Count > 0)
            {
                retorno = resultado.Rows[0]["DESCRIPCION"].ToString();

                if (tipo == "3")
                {
                    retorno = resultado.Rows[0]["DESCRIPCION"].ToString().Trim() + "|" +
                              resultado.Rows[0]["UNIDAD"].ToString().Trim() + "|" +
                              resultado.Rows[0]["LOTE"].ToString().Trim();
                }
            }

            return(retorno + strSecondVal);
        }