public static string VerificarWarehouse(string CWAR)
        {
            string strError = string.Empty;

            Ent_ttwhcol016 Obj_twhcol016 = new Ent_ttwhcol016();

            Obj_twhcol016.cwar = CWAR;

            Ent_twhwmd200 Obj_twhwmd200 = new Ent_twhwmd200();

            Obj_twhwmd200.cwar = CWAR;

            DataTable DtTtwhcol016 = ITtwhcol016.TakeMaterialInv_verificaBodega_Param(ref Obj_twhcol016, ref strError);
            DataTable DtTwhwmd200  = ITwhwmd200.listaRegistro_ObtieneAlmacenLocation(ref Obj_twhwmd200, ref strError);

            if (DtTtwhcol016.Rows.Count > 0)
            {
                Obj_twhcol016.error      = false;
                Obj_twhcol016.typeMsgJs  = "console";
                Obj_twhcol016.SuccessMsg = "Warehouse Encontrado";
                Obj_twhcol016.dsca       = DtTtwhcol016.Rows[0]["DESCRIPCION"].ToString();

                if (DtTwhwmd200.Rows.Count > 0)
                {
                    Obj_twhcol016.sloc = DtTwhwmd200.Rows[0]["LOC"].ToString();
                }
                else
                {
                    Obj_twhcol016.sloc = string.Empty;
                }
            }
            else
            {
                Obj_twhcol016.error     = true;
                Obj_twhcol016.typeMsgJs = "label";
                Obj_twhcol016.errorMsg  = Warehousecodedoesntexist;
            }

            return(JsonConvert.SerializeObject(Obj_twhcol016));
        }
        public static string VerificarWarehouse(string CWAR)
        {
            Ent_twhcol130131 MyObj131Base = (Ent_twhcol130131)HttpContext.Current.Session["MyPalletTwhcol13"];
            string           strError     = string.Empty;

            Ent_ttwhcol016 Obj_twhcol016 = new Ent_ttwhcol016();

            Obj_twhcol016.cwar = CWAR;

            Ent_twhwmd200 Obj_twhwmd200 = new Ent_twhwmd200();

            Obj_twhwmd200.cwar = CWAR;

            DataTable DtTtwhcol016 = ITtwhcol016.TakeMaterialInv_verificaBodega_Param(ref Obj_twhcol016, ref strError);
            DataTable DtTwhwmd200  = ITwhwmd200.listaRegistro_ObtieneAlmacenLocation(ref Obj_twhwmd200, ref strError);

            if (DtTtwhcol016.Rows.Count > 0)
            {
                Obj_twhcol016.Error      = false;
                Obj_twhcol016.TypeMsgJs  = "console";
                Obj_twhcol016.SuccessMsg = "Warehouse Encontrado";

                if (DtTwhwmd200.Rows.Count > 0)
                {
                    Obj_twhcol016.sloc = DtTwhwmd200.Rows[0]["LOC"].ToString();
                }
                else
                {
                    Obj_twhcol016.sloc = string.Empty;
                    if (MyObj131Base.CWAR == CWAR)
                    {
                        Obj_twhcol016.Error     = true;
                        Obj_twhcol016.TypeMsgJs = "label";
                        Obj_twhcol016.ErrorMsg  = "Warehouse / Location can't be the same";
                    }
                }
            }
            else
            {
                Obj_twhcol016.Error     = true;
                Obj_twhcol016.TypeMsgJs = "label";

                Obj_twhcol016.ErrorMsg = Warehousecodedoesntexist;
            }

            return(JsonConvert.SerializeObject(Obj_twhcol016));
        }
        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);
        }