Example #1
0
 public static void insertInContainerDataBase(string pn, string contenedor, int qty, string tipo, string modelo, string lote, char reimpresion)
 {
     if (ConexionCogiscanUtilities.State == ConnectionState.Closed)
     {
         ConexionCogiscanUtilities.Open();
     }
     string[] usuario = HostAndUser.host();
     using (MySqlCommand cmdInsertIRM = ConexionCogiscanUtilities.CreateCommand())
     {
         cmdInsertIRM.CommandType = CommandType.StoredProcedure;
         cmdInsertIRM.CommandText = "spInsertNewContainer";
         cmdInsertIRM.Parameters.AddWithValue("_pn", pn);
         cmdInsertIRM.Parameters.AddWithValue("_contenedor", contenedor);
         cmdInsertIRM.Parameters.AddWithValue("_qty", qty);
         cmdInsertIRM.Parameters.AddWithValue("_barcode", Global.barcode);
         cmdInsertIRM.Parameters.AddWithValue("_host", usuario[0]);
         cmdInsertIRM.Parameters.AddWithValue("_usuario", Global.userLogged);
         cmdInsertIRM.Parameters.AddWithValue("_tipo", tipo);
         cmdInsertIRM.Parameters.AddWithValue("_modelo", modelo);
         cmdInsertIRM.Parameters.AddWithValue("_lote", lote);
         cmdInsertIRM.Parameters.AddWithValue("_reimpresion", reimpresion);
         cmdInsertIRM.ExecuteNonQuery();
     }
     ConexionCogiscanUtilities.Close();
 }
Example #2
0
 public static void insertInSplitDataBase(string contenedorInicial, int qty, string contenedorNuevo)
 {
     if (ConexionCogiscanUtilities.State == ConnectionState.Closed)
     {
         ConexionCogiscanUtilities.Open();
     }
     string[] usuario = HostAndUser.host();
     using (MySqlCommand cmdInsertSplit = ConexionCogiscanUtilities.CreateCommand())
     {
         cmdInsertSplit.CommandText = "spInsertSplitMaterial";
         cmdInsertSplit.CommandType = CommandType.StoredProcedure;
         cmdInsertSplit.Parameters.AddWithValue("_contenedor_inicial", contenedorInicial);
         cmdInsertSplit.Parameters.AddWithValue("_qty_division", qty);
         cmdInsertSplit.Parameters.AddWithValue("_contenedor_nuevo", contenedorNuevo);
         cmdInsertSplit.Parameters.AddWithValue("_host", usuario[0]);
         cmdInsertSplit.Parameters.AddWithValue("_usuario", Global.userLogged);
         cmdInsertSplit.ExecuteNonQuery();
     }
     ConexionCogiscanUtilities.Close();
 }
Example #3
0
 public static void insertHearthBreath()
 {
     //Obtengo los datos del cliente
     string[] hostInfo = HostAndUser.host();
     if (ConexionCogiscanUtilities.State == ConnectionState.Closed)
     {
         ConexionCogiscanUtilities.Open();
     }
     using (MySqlCommand cmdInsertError = ConexionCogiscanUtilities.CreateCommand())
     {
         cmdInsertError.CommandText = "spUpdHearthBreath";
         cmdInsertError.CommandType = CommandType.StoredProcedure;
         cmdInsertError.Parameters.AddWithValue("_hostname", hostInfo[0]);
         cmdInsertError.Parameters.AddWithValue("_ip_address", hostInfo[2]);
         cmdInsertError.ExecuteNonQuery();
     }
     if (ConexionCogiscanUtilities.State == ConnectionState.Open)
     {
         ConexionCogiscanUtilities.Close();
     }
 }
Example #4
0
        private void Form1_Load(object sender, EventArgs e)
        {
            HostAndUser.host();
            Global.chkUserLogged();//chequeo si hay algun usuario logueado
            lblresultado.Text   = "";
            lblResultSplit.Text = "";
            lblPNSplit.Text     = "";
            lblQtySplit.Text    = "";
            //WS.queryTooling();
            List <string> dataSource = new List <string>();

            dataSource             = Conexion.queryModelos();
            cbModeloGC.DataSource  = dataSource;
            cbModeloSM.DataSource  = dataSource;
            cbTipoCG.SelectedIndex = 0;// por defecto selecciono el tipo REEL
            //****LOAD TAB****//
            lblSelectedContainer.Text = "";
            lblSelectedLocation.Text  = "";
            lblStatusLoad.Text        = "";
            btnDelete.Enabled         = false;
            btnDeleteAll.Enabled      = false;
            ////////////////////

            string partNumber       = "T2SC3332-S--";
            string partNumberToRead = "";

            if (partNumber.Contains("-"))
            {
                string[] splitted = partNumber.Split('-');
                for (int i = 0; i < splitted.Length; i++)
                {
                    if (i < (splitted.Length - 1))
                    {
                        if (splitted[i] == "")
                        {
                            if (splitted[i - 1] == "")
                            {
                                partNumberToRead = partNumberToRead + "-";
                            }
                            else
                            {
                                partNumberToRead = partNumberToRead + "-";
                            }
                        }
                        else
                        {
                            if (Char.IsLetter(splitted[i], splitted[i].Length - 1))
                            {
                                partNumberToRead = partNumberToRead + splitted[i] + "->5";
                            }
                            else if (Char.IsNumber(splitted[i], splitted[i].Length - 1))
                            {
                                partNumberToRead = partNumberToRead + splitted[i] + ">6->5";
                            }
                        }
                    }
                    else
                    {
                        partNumberToRead = partNumberToRead + splitted[i];
                    }
                }
                partNumberToRead = "";
                //Este es para el caso "Letra - Nro - Letra/Nro"
                string pattern     = @"(?'letra'[A-Z]\-)(?'centro'\w+)(?'digito'\d)(\-)";
                string replacement = "${letra}>5${centro}${digito}>6->5";
                Regex  rgx         = new Regex(pattern);
                partNumberToRead = rgx.Replace(partNumberToRead, replacement);
            }
        }