コード例 #1
0
 private void TraerDatos()
 {
     IgvPuntos ip = new IgvPuntos();
     VentaSQL vsql = new VentaSQL();
     ip = vsql.sacarDatos();
     TxtIgv = ip.Igv.ToString();
     TxtPuntos = ip.Puntos.ToString();
 }
コード例 #2
0
ファイル: VentaSQL.cs プロジェクト: alfonsobp/made-in-house
        public IgvPuntos sacarDatos()
        {
            IgvPuntos ip = null;
            db.cmd.CommandText = "Select * from IgvPuntos";
            try
            {
                if (tipo) db.conn.Open();
                SqlDataReader reader = db.cmd.ExecuteReader();
                reader.Read();
                ip = new IgvPuntos();
                ip.Igv = Convert.ToInt32(reader["igv"].ToString());
                ip.Puntos = Convert.ToInt32(reader["puntos"].ToString());
                reader.Close();
                db.cmd.Parameters.Clear();
                if (tipo) db.cmd.Clone();

            }
            catch (SqlException e)
            {
                MessageBox.Show(e.Message);
            }
            return ip;
        }