Exemplo n.º 1
0
        internal static DataTable ExecuteSpDefaultStorage(String sp, String parameter, Boolean developerMode)
        {
            String    connectionString = "ConnectToMaidana";
            DataTable dt = new DataTable();

            String queryForWareHouse = @"SELECT * FROM `ins_result` WHERE `id_instruction` = '16' AND `field2` = '" + parameter + "' ORDER BY `field2` DESC";

            dt = Conectivity.ConnectItAndExecuteMYSQL(queryForWareHouse, connectionString);
            return(dt);
        }
Exemplo n.º 2
0
        /*****************************************************************************************************/
        /******************************* PIZARRA DATABASE ****************************************************/
        internal static String IAServerInsertionLog(Entity.EntityInitRawMaterial q, string p)
        {
            if (p != null)
            {
                String partNumber   = SQLDataManager.selectValuesFromMateriales(q.NumMaterial);
                String lastInserted = "";

                String connectionStringFromAppConfig = "ConnectToMySQL";
                String insertStringToMateriales      =
                    "INSERT INTO materiales(NumMaterial,Material,Orig_Ubic_Alm,Orig_Cant,Conf_Fecha,Conf_Hora,Conf_Usuario,Descripcion,Cantidad,Num_Pallet,Num_Ord_Transp,TimeStamp) values ('" + q.NumMaterial + "','"
                    + partNumber + "','"
                    + q.Orig_Ubic_Alm + "','"
                    + q.Orig_Cant + "','"
                    + q.Conf_Fecha + "','"
                    + q.Conf_Hora + "','"
                    + q.Conf_Usuario + "','"
                    + q.Descripcion + "','"
                    + q.Cantidad + "','"
                    + q.Num_Pallet + "','"
                    + q.Num_Ord_Transp +
                    "',NOW())";

                DataTable queryTable = new DataTable();

                try
                {
                    Conectivity.ConnectItAndExecuteMYSQL(insertStringToMateriales, connectionStringFromAppConfig);

                    lastInserted = GetLastMySQLInsertedId("materiales", "idMateriales", "ConnectToMySQL");

                    if (lastInserted == null || lastInserted == "")
                    {
                        lastInserted = "1";
                    }

                    String insertStringToDetMateriales = "INSERT INTO wsmensajeresponse(idMateriales,detalleMensaje) VALUES ('" + lastInserted + "','" + p + "')";
                    Conectivity.ConnectItAndExecuteMYSQL(insertStringToDetMateriales, connectionStringFromAppConfig);
                }
                catch (Exception e)
                { System.Console.WriteLine(e.Message); }

                return(p);
            }
            else
            {
                return(null);
            }
        }