예제 #1
0
        private void cbLine_RowSelected(object sender, Infragistics.Win.UltraWinGrid.RowSelectedEventArgs e)
        {
            #region Conexion SAM obtener id de linea
            ConexionSambhs conectasam = new ConexionSambhs();
            conectasam.openSambhs();
            var           cadena   = "select v_IdLinea from [dbo].[linea] where v_Nombre='" + cbLine.Text + "' and i_Eliminado=0";
            SqlCommand    comandou = new SqlCommand(cadena, connection: conectasam.conectarSambhs);
            SqlDataReader lectoru  = comandou.ExecuteReader();
            lineId = "";
            while (lectoru.Read())
            {
                lineId = lectoru.GetValue(0).ToString();
            }
            lectoru.Close();
            conectasam.closeSambhs();
            #endregion

            txtUnidProdId.Text = lineId;
        }
예제 #2
0
        private void cbLine_RowSelected(object sender, Infragistics.Win.UltraWinGrid.RowSelectedEventArgs e)
        {
            #region Conexion SAMBHS
            ConexionSambhs     conectaConexionSambhs = new ConexionSambhs(); conectaConexionSambhs.openSambhs();
            var                cadenasam             = "select v_IdLinea  from linea where i_Eliminado=0 and v_Nombre ='" + cbLine.Text + "'";
            var                comando        = new SqlCommand(cadenasam, connection: conectaConexionSambhs.conectarSambhs);
            var                lector         = comando.ExecuteReader();
            string             LineId         = "";
            List <ListaLineas> objListaLineas = new List <ListaLineas>();

            while (lector.Read())
            {
                LineId = lector.GetValue(0).ToString();
            }
            lector.Close();
            conectaConexionSambhs.closeSambhs();
            #endregion

            txtUnidadProdId.Text = LineId;
        }
예제 #3
0
        private object LlenarLines()
        {
            #region Conexion SAMBHS
            ConexionSambhs     conectaConexionSambhs = new ConexionSambhs(); conectaConexionSambhs.openSambhs();
            var                cadenasam             = "select v_Nombre, v_IdLinea  from linea where i_Eliminado=0";
            var                comando        = new SqlCommand(cadenasam, connection: conectaConexionSambhs.conectarSambhs);
            var                lector         = comando.ExecuteReader();
            string             preciounitario = "";
            List <ListaLineas> objListaLineas = new List <ListaLineas>();

            while (lector.Read())
            {
                ListaLineas Lista = new ListaLineas();
                Lista.v_Nombre  = lector.GetValue(0).ToString();
                Lista.v_IdLinea = lector.GetValue(1).ToString();
                objListaLineas.Add(Lista);
            }
            lector.Close();
            conectaConexionSambhs.closeSambhs();
            #endregion

            return(objListaLineas);
        }