예제 #1
0
        public static List <clsCorte> Listar_Corte()
        {
            List <clsCorte> x = new List <clsCorte>();

            SqlConnection conexion;

            conexion = new SqlConnection(mdlVariables.CadenaConexion);

            SqlCommand comando;

            comando             = new SqlCommand("usp_Corte_Listar_Todos", conexion);
            comando.CommandType = System.Data.CommandType.StoredProcedure;

            conexion.Open();

            SqlDataReader contenedor;

            contenedor = comando.ExecuteReader();
            while (contenedor.Read() == true)
            {
                clsCorte MiObjeto;
                MiObjeto = new clsCorte(contenedor["Nombre"].ToString(), Convert.ToSingle(contenedor["Precio"]));

                MiObjeto.Idcorte = Convert.ToInt32(contenedor["Idcorte"]);

                x.Add(MiObjeto);
            }
            conexion.Close();

            return(x);
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            clsCorte nuevo;

            nuevo = new clsCorte(txtNombre.Text, Convert.ToSingle(txtprecio.Text));
            nuevo.insertar();
            MessageBox.Show("Corte ingresado. ");
        }
예제 #3
0
 public clsArticuloDeVenta(clsCorte parCorte)
 {
     Corte = parCorte;
 }