Esempio n. 1
0
File: WS.cs Progetto: deeze307/IA
        public static string splitRawMaterial(string contenedor, int qtyInicial, int qtySplit, string contenedorNuevo, string modelo, string lote)
        {
            if (qtyInicial >= qtySplit)
            {
                try
                {
                    executeCommandRequest  execSRM = new executeCommandRequest("splitRawMaterial", @"
                    <Parameters>
                        <Parameter name=""itemId"">" + contenedor + @"</Parameter>
                        <Parameter name=""quantity"">" + qtySplit + @"</Parameter>
                        <Parameter name=""targetItemId"">" + contenedorNuevo + @"</Parameter>
                    </Parameters>

                    ");
                    executeCommandResponse resSRM  = RPC.executeCommand(execSRM);
                    Conexion.insertInSplitDataBase(contenedor, qtySplit, contenedorNuevo);
                    return("Operación Exitosa");
                }
                catch (Exception e)
                {
                    Conexion.insertErrorInDB(e.ToString());
                    return("Ah ocurrido un error");
                }
            }
            else
            {
                return("La cantidad de Subdivision no puede ser Mayor a la Inicial");
            }
        }
Esempio n. 2
0
        /// <summary>
        /// This method brings the materials with low level.
        /// </summary>
        /// <returns></returns>
        #region GetLowLevelsOfMaterials
        internal static List <EntityMaterialRequest> StartSendingLowLevelToPizzarra()
        {
            RPCServicesClient      RPC   = new RPCServices_CogiscanManager.RPCServicesClient();
            executeCommandRequest  param = new executeCommandRequest("getComponentLowLevelWarnings", "<Parameters></Parameters>");
            executeCommandResponse res   = RPC.executeCommand(param);
            XDocument arr  = XDocument.Parse(res.result, LoadOptions.None);
            XElement  root = arr.Element("LowLevelWarnings");
            IEnumerable <XElement> list = root.Elements();

            List <EntityMaterialRequest> listMaterialRequest = new List <EntityMaterialRequest>();

            foreach (XElement element in list)
            {
                string idTool = element.Attribute("id").Value;
                //string location = element.Element("Mapping").Value;
                IEnumerable <XElement> partList = element.Elements();
                foreach (XElement partes in partList)
                {
                    EntityMaterialRequest rmr = new EntityMaterialRequest();
                    rmr.idMaquina         = idTool;
                    rmr.status            = partes.Attribute("status").Value;
                    rmr.minutos           = partes.Attribute("remainingTimeMinutes").Value;
                    rmr.remainingBoards   = partes.Attribute("remainingBoards").Value;
                    rmr.partNumber        = partes.Attribute("partNumber").Value;
                    rmr.rawMaterialId     = partes.Attribute("rawMaterialId").Value;
                    rmr.location          = partes.Attribute("location").Value;
                    rmr.productPartNumber = partes.Attribute("productPartNumber").Value;
                    rmr.timeStampRegistro = DateTime.Now.ToString("dd/MM/yyy HH:mm:ss tt", System.Globalization.DateTimeFormatInfo.InvariantInfo);

                    listMaterialRequest.Add(rmr);
                }
            }
            return(listMaterialRequest);
        }
Esempio n. 3
0
        internal static string executeWSRequest(executeCommandRequest commandRequest)
        {
            RPCServicesClient      RPC = new RPCServicesClient();
            executeCommandResponse res = RPC.executeCommand(commandRequest);

            return(res.result);
        }
Esempio n. 4
0
File: WS.cs Progetto: deeze307/IA
        public static bool chkPN(string PN)
        {
            try
            {
                executeCommandRequest exec = new executeCommandRequest("queryPartNumber", @"
                    <Parameters>
                        <Parameter name =""itemTypeClass"">Component Lot</Parameter>
                        <Parameter name =""partNumber"">" + PN + @"</Parameter>
                    </Parameters>"

                                                                       );
                executeCommandResponse res = RPC.executeCommand(exec);
                if (res != null)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                Conexion.insertErrorInDB(e.ToString());
                return(false);
            }
        }
Esempio n. 5
0
        internal static String updatePartNumber()
        {
            String resultReturn = "";

            try
            {
                RPCServicesClient     RPC = new RPCServices_CogiscanManager.RPCServicesClient();
                executeCommandRequest updatePartNumber = new executeCommandRequest("updatePartNumber", @"
                    <Parameters>
                    <Parameter name=""partNumber"">344-876-87</Parameter>
                    <Parameter name=""description"">IC</Parameter>
                    <Parameter name=""containerType""></Parameter>
                    <Parameter name=""supplier""></Parameter>
                    <Parameter name=""msLevel""></Parameter>
                    <Parameter name=""bodyThickness""></Parameter>
                    <Parameter name=""bgaPackage""></Parameter>
                    <Parameter name=""stackedDie""></Parameter>
                    <Parameter name=""feedPitch""></Parameter>
                    </Parameters>");

                executeCommandResponse res = RPC.executeCommand(updatePartNumber);
            }
            catch
            {
            }
            return(resultReturn);
        }
Esempio n. 6
0
File: WS.cs Progetto: deeze307/IA
        public static bool getContents(string item)
        {
            try
            {
                executeCommandRequest exec = new executeCommandRequest("getContents", @"
                    <Parameters>
                        <Parameter name =""containerId"">" + item + @"</Parameter>
                    </Parameters>"

                                                                       );
                executeCommandResponse res = RPC.executeCommand(exec);
                if (res.result != @"<Exception exceptionType=""java.lang.Exception"" message=""Container does not exist."" />")
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                Conexion.insertErrorInDB(e.ToString());
                return(false);
            }
        }
Esempio n. 7
0
File: WS.cs Progetto: deeze307/IA
        public static bool queryItem(string item)
        {
            try
            {
                executeCommandRequest exec = new executeCommandRequest("queryItem", @"
                    <Parameters>
                        <Parameter name =""itemId"">Component Lot</Parameter>
                    </Parameters>"

                                                                       );
                executeCommandResponse res = RPC.executeCommand(exec);
                if (res != null)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                Conexion.insertErrorInDB(e.ToString());
                return(false);
            }
        }
Esempio n. 8
0
File: WS.cs Progetto: deeze307/IA
        public static string[] queryTooling()
        {
            string[] tooling = {};
            executeCommandRequest  execQT = new executeCommandRequest("queryPartNumber", @"
<Parameters>
  <Parameter name =""itemTypeClass"">Tooling</Parameters>
  <Parameter name =""partNumber"">%%</Parameter>
</Parameters>");
            executeCommandResponse resQT  = RPC.executeCommand(execQT);

            return(tooling);
        }
Esempio n. 9
0
File: WS.cs Progetto: deeze307/IA
        public static Array getRawMaterialStatus(string container)
        {
            DataTable dt = new DataTable();
            List <RMWstatusEntity> propiedadesMateriales = new List <RMWstatusEntity>();

            try
            {
                executeCommandRequest exec = new executeCommandRequest("getContents", @"
                    <Parameters>
                        <Parameter name =""containerId"">" + container + @"</Parameter>
                    </Parameters>"

                                                                       );
                executeCommandResponse res = RPC.executeCommand(exec);
                if (res != null)
                {
                    string                 partNumber;
                    string                 rawMaterialId;
                    List <RMWentity>       listaProMat = new List <RMWentity>();
                    XDocument              arr         = XDocument.Parse(res.result, LoadOptions.None);
                    XElement               Elemento    = arr.Element("Contents");
                    IEnumerable <XElement> lista       = Elemento.Elements();
                    foreach (XElement item in lista)
                    {
                        IEnumerable <XElement> subLista = item.Elements();//Genero una sublista de los elementos del primer elemento
                        partNumber    = subLista.ElementAt(0).Attribute("partNumber").Value;
                        rawMaterialId = item.Attribute("itemId").Value;
                        listaProMat   = Conexion.getRawMaterialHistory(rawMaterialId, partNumber);
                        propiedadesMateriales.Add(new RMWstatusEntity()
                        {
                            partNumber   = partNumber,
                            primerCarro  = "",
                            segundoCarro = "",
                            tercerCarro  = "",
                            cuartoCarro  = "",
                            quintoCarro  = ""
                        });
                    }
                }
            }
            catch (Exception e)
            {
                Conexion.insertErrorInDB(e.ToString());
            }
            Array propMat = propiedadesMateriales.ToArray();

            return(propMat);
        }
Esempio n. 10
0
        private void button1_Click(object sender, EventArgs e)
        {
            RPCServicesClient     RPC   = new RPCServices_CogiscanManager.RPCServicesClient();
            executeCommandRequest param = new executeCommandRequest("getComponentLowLevelWarnings", "<Parameters></Parameters>");

            executeCommandResponse res = RPC.executeCommand(param);

            treeView1.Text = res.result;

            XDocument arr = XDocument.Parse(res.result, LoadOptions.None);

            treeView1.Nodes.Clear();
            TreeNode warningNode = treeView1.Nodes.Add("Warnings");

            XElement root = arr.Element("LowLevelWarnings");
            IEnumerable <XElement> list = root.Elements();

            foreach (XElement element in list)
            {
                string   idTool   = element.Attribute("id").Value;
                TreeNode toolNode = warningNode.Nodes.Add(idTool);
                IEnumerable <XElement> partList = element.Elements();
                foreach (XElement partes in partList)
                {
                    string status            = partes.Attribute("status").Value;
                    string minutos           = partes.Attribute("remainingTimeMinutes").Value;
                    string remainingBoards   = partes.Attribute("remainingBoards").Value;
                    string partNumber        = partes.Attribute("partNumber").Value;
                    string rawMaterialId     = partes.Attribute("rawMaterialId").Value;
                    string location          = partes.Attribute("location").Value;
                    string productPartNumber = partes.Attribute("productPartNumber").Value;
                    string timeStampRegistro = DateTime.Now.ToString("dd/MM/yyy HH:mm:ss tt", System.Globalization.DateTimeFormatInfo.InvariantInfo);

                    TreeNode lotNode = toolNode.Nodes.Add(rawMaterialId);
                    lotNode.Nodes.Add("Estado: " + status);
                    lotNode.Nodes.Add("Minutos: " + minutos);
                    lotNode.Nodes.Add("Placas: " + remainingBoards);
                    lotNode.Nodes.Add("Part#: " + partNumber);
                    lotNode.Nodes.Add("Materia Prima: " + rawMaterialId);
                    lotNode.Nodes.Add("Locacion: " + location);
                    lotNode.Nodes.Add("prodPart#: " + productPartNumber);
                    lotNode.Nodes.Add("TimeStamp: " + timeStampRegistro);
                }
            }
        }
Esempio n. 11
0
        internal static String InitRawMaterial(Entity.EntityInitRawMaterial q)
        {
            String resultReturn = "";

            try
            {
                DataTable queryTable  = new DataTable();
                String    queryString = "select * from materiales where num_pallet='" + q.Num_Pallet + "'";
                String    connectionStringFromAppConfig = "ConnectToMySQL";
                queryTable = Conectivity.ConnectItAndExecuteMYSQL(queryString, connectionStringFromAppConfig);

                if (queryTable.Rows.Count == 0)
                {
                    RPCServicesClient RPC        = new RPCServices_CogiscanManager.RPCServicesClient();
                    String            partNumber = SQLDataManager.selectValuesFromMateriales(q.NumMaterial);

                    executeCommandRequest paramInitRawMat = new executeCommandRequest("initializeRawMaterial", @"
                    <Parameters>
                       <Parameter name=""itemId"">" + q.Num_Pallet + @"</Parameter>
                       <Parameter name=""partNumber"">" + partNumber + @"</Parameter>
                       <Parameter name=""msLevel"">1</Parameter>k
                       <Parameter name=""containerType"">REEL</Parameter>
                       <Parameter name=""supplierId"">Default</Parameter>
                       <Parameter name=""quantity"">" + q.Orig_Cant + @"</Parameter>
                       <Parameter name=""tagId""></Parameter>
                       <Parameter name=""tagModel""></Parameter>
                    </Parameters>");

                    executeCommandResponse res = RPC.executeCommand(paramInitRawMat);
                    LogThis.LogThisValue("Material Inicializado: " + q.Num_Pallet);
                    takeTheThreadFlag(Form1.logRTBInitRaw, true, q.Num_Pallet);

                    resultReturn = CleanInput(res.result);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception e)
            { LogThis.LogThisValue(e); return(e.Message); }

            return(resultReturn);
        }
Esempio n. 12
0
File: WS.cs Progetto: deeze307/IA
 public static string initRawMaterial(string partNumber, string contenedor, int qty, string tipo, string modelo, string lote)
 {
     try
     {
         if (tipo == "REEL")//Si no posee barcode de referencia lo inicializo normalmente, de otra manera, se dirige al "else"
         {
             executeCommandRequest  execIRM = new executeCommandRequest("initializeRawMaterial", @"
             <Parameters>
                 <Parameter name=""itemId"">" + contenedor + @"</Parameter>
                 <Parameter name=""partNumber"">" + partNumber + @"</Parameter>
                 <Parameter name=""containerType"">" + tipo + @"</Parameter>
                 <Parameter name=""supplierId"">Default</Parameter>
                 <Parameter name=""quantity"">" + qty + @"</Parameter>
             </Parameters>");
             executeCommandResponse resIRM  = RPC.executeCommand(execIRM);
         }
         else
         {
             executeCommandRequest  execIRM = new executeCommandRequest("initializeRawMaterial", @"
             <Parameters>
                 <Parameter name=""itemId"">" + contenedor + @"</Parameter>
                 <Parameter name=""partNumber"">" + partNumber + @"</Parameter>
                 <Parameter name=""msLevel"">1</Parameter>
                 <Parameter name=""containerType"">" + tipo + @"</Parameter>
                 <Parameter name=""supplierId"">Default</Parameter>
                 <Parameter name=""quantity"">" + qty + @"</Parameter>
                 <Parameter name=""itemBarcode"">" + Global.barcode + @"</Parameter>
                 <Parameter name=""updateExisting"">true</Parameter>
             </Parameters>");
             executeCommandResponse resIRM  = RPC.executeCommand(execIRM);
         }
         //Inserto los datos en la base de datos de IA Server
         Conexion.insertInContainerDataBase(partNumber, contenedor, qty, tipo, modelo, lote, 'N');
         return("Operación Exitosa");
     }
     catch (Exception e)
     {
         Conexion.insertErrorInDB(e.ToString());
         return("Ah ocurrido un error");
     }
 }
Esempio n. 13
0
File: WS.cs Progetto: deeze307/IA
 public static bool LoadContent(string contenedor, string idContenedor, string Location)
 {
     try
     {
         executeCommandRequest  exeLCI = new executeCommandRequest("load", @"
             <Parameters>
                 <Parameter name=""contentId"">" + contenedor + @"</Parameter>
                 <Parameter name=""containerId"">" + idContenedor + @"</Parameter>
                 <Parameter name=""location"">" + Location + @"</Parameter>
                 <Parameter name=""unloadPrevious"">true</Parameter>
                 <Parameter name=""deleteContent"">false</Parameter>
             </Parameters>");
         executeCommandResponse resLCI = RPC.executeCommand(exeLCI);
     }
     catch (Exception e)
     {
         Conexion.insertErrorInDB(e.ToString());
         return(false);
     }
     return(true);
 }
Esempio n. 14
0
        /*
         * Método que devuelve una lista con las Tools de cada complexTool.
         */
        private static List <OracleParameters> giveMeTheIdKeysOfTheComplexTool(string complexTool)
        {
            List <OracleParameters> ctList = new List <OracleParameters>();

            try
            {
                RPCServicesClient      RPC         = new RPCServicesClient();
                executeCommandRequest  getContents = new executeCommandRequest("getContents", @"
                <Parameters>
                        <Parameter name=""containerId"">" + complexTool + @"</Parameter>
                </Parameters>");
                executeCommandResponse res         = RPC.executeCommand(getContents);
                XDocument arr = XDocument.Parse(res.result, LoadOptions.None);

                XElement root = arr.Element("Contents");
                IEnumerable <XElement> list = root.Elements();
                foreach (XElement element in list)
                {
                    OracleParameters ct   = new OracleParameters();
                    Tool             tool = new Tool();

                    tool.itemId          = element.Attribute("itemId").Value;
                    tool.itemKey         = element.Attribute("itemKey").Value;
                    tool.itemType        = element.Attribute("itemType").Value;
                    tool.itemTypeClass   = element.Attribute("itemTypeClass").Value;
                    tool.containerId     = element.Attribute("containerId").Value;
                    tool.toolContainerId = element.Attribute("toolContainerId").Value;

                    ct.toolList.Add(tool);
                    ctList.Add(ct);
                }
            }
            catch (Exception e)
            { MessageBox.Show(e.ToString()); }
            return(ctList);
        }
Esempio n. 15
0
File: WS.cs Progetto: deeze307/IA
        public static bool loadInContainer(string rawMaterial, string partNumber, string qty, string contenedor, string ubicacionEnContenedor)
        {
            executeCommandRequest execLoad = new executeCommandRequest("load", @"
                    <Parameters>
                        <Parameter name =""contentId"">" + rawMaterial + @"</Parameter>
                        <Parameter name =""containerId"">" + contenedor + @"</Parameter>
                        <Parameter name =""location"">" + ubicacionEnContenedor + @"</Parameter>
                        <Parameter name =""unloadPrevious"">false</Parameter>
                        <Parameter name =""deletePrevious"">false</Parameter>
                    </Parameters>"

                                                                       );
            executeCommandResponse res = RPC.executeCommand(execLoad);

            if (res.result == "<Success />")
            {
                Conexion.insertLoadEvent(rawMaterial, partNumber, qty, contenedor, Global.userLogged);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 16
0
        internal static String InitRawMaterial(Entity.EntityInitRawMaterial q)
        {
            String resultReturn = "";

            try
            {
                DataTable queryTable  = new DataTable();
                String    queryString = "select num_pallet from materiales where num_pallet='" + q.Num_Pallet + "'";
                String    connectionStringFromAppConfig = "ConnectToMySQL";
                queryTable = Conectivity.ConnectItAndExecuteMYSQL(queryString, connectionStringFromAppConfig);

                if (queryTable.Rows.Count == 0)
                {
                    String partNumber = SQLDataManager.selectValuesFromMateriales(q.NumMaterial);

                    //Boolean opNotInit = CheckIfOpMustInit(q.NumMaterial, q.Num_Pallet);

                    //if (opNotInit)
                    //{ goto skipped; }

                    RPCServicesClient RPC = new RPCServicesClient();

                    executeCommandRequest paramInitRawMat = new executeCommandRequest("initializeRawMaterial", @"
                    <Parameters>
                       <Parameter name=""itemId"">" + q.Num_Pallet + @"</Parameter>
                       <Parameter name=""partNumber"">" + partNumber + @"</Parameter>
                       <Parameter name=""containerType"">REEL</Parameter>
                       <Parameter name=""supplierId"">DEFAULT</Parameter>
                       <Parameter name=""quantity"">" + q.Orig_Cant + @"</Parameter>
                       <Parameter name=""tagId""></Parameter>
                       <Parameter name=""tagModel""></Parameter>
                    </Parameters>");


                    executeCommandResponse res = RPC.executeCommand(paramInitRawMat);
                    //LogThis.LogThisValue("Material Inicializado: " + q.Num_Pallet);
                    takeTheThreadFlag(Form1.logRTBInitRaw, true, q.Num_Pallet);

                    resultReturn = CleanInput(res.result);

                    if (res.result.Contains("<Success />"))
                    {
                        executeCommandRequest paramLoadRawMat = new executeCommandRequest("load", @"
                        <Parameters>
                            <Parameter name=""contentId"">" + q.Num_Pallet + @"</Parameter>
                            <Parameter name=""containerId"">DEFAULTSTORAGE</Parameter>
                            <Parameter name=""location""></Parameter>
                            <Parameter name=""unloadPrevious"">false</Parameter>
                            <Parameter name=""deletePrevious"">false</Parameter>
                        </Parameters>");

                        string responseFromLoad = executeWSRequest(paramLoadRawMat);
                        resultReturn = "||" + responseFromLoad + "OnLoad - ";
                    }


                    skipped : string skipped = "";
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception e)
            { System.Console.WriteLine(e.Message); }

            return(resultReturn);
        }
Esempio n. 17
0
File: WS.cs Progetto: deeze307/IA
        public static string[] getContainerInfo(string contenedor)
        {
            string pn;
            string qty;
            string containerId;
            string locationInContainer;

            string[] array = { };

            if (contenedor.StartsWith(")"))
            {
                contenedor = contenedor.Replace(")", "(");
            }

            try
            {
                executeCommandRequest exec = new executeCommandRequest("queryItem", @"
                    <Parameters>
                        <Parameter name =""itemId"">" + contenedor + @"</Parameter>
                    </Parameters>"

                                                                       );
                executeCommandResponse res = RPC.executeCommand(exec);
                if (res != null)
                {
                    XDocument arr      = XDocument.Parse(res.result, LoadOptions.None);
                    XElement  Elemento = arr.Element("Item");
                    IEnumerable <XElement> elementos = Elemento.Elements();
                    pn  = elementos.ElementAt(0).Attribute("partNumber").Value;
                    qty = elementos.ElementAt(0).Attribute("quantity").Value;
                    if (Elemento.ToString().Contains("containerId"))
                    {
                        containerId = Elemento.Attribute("containerId").Value;
                        if (Elemento.ToString().Contains("locationInContainer"))
                        {
                            locationInContainer = Elemento.Attribute("locationInContainer").Value;
                            array = new string[4] {
                                pn, qty, containerId, locationInContainer
                            };
                        }
                        else
                        {
                            array = new string[3] {
                                pn, qty, containerId
                            };
                        }
                    }
                    else
                    {
                        array = new string[2] {
                            pn, qty
                        };
                    }

                    return(array);
                }
                else
                {
                }
            }
            catch (Exception e)
            {
                Conexion.insertErrorInDB(e.ToString());
                return(null);
            }
            return(null);
        }