Esempio n. 1
0
        public static void agregarPago(Pago p)
        {
            SqlConnection cnn = new SqlConnection(ClasesBase.Properties.Settings.Default.conexion);

            SqlCommand cmd = new SqlCommand("agregarPago", cnn);

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.AddWithValue("@cod", p.CUO_Codigo);
            cmd.Parameters.AddWithValue("@fecha", p.PAG_Fecha);
            cmd.Parameters.AddWithValue("@imp", p.PAG_Importe);

            cnn.Open();
            cmd.ExecuteNonQuery();
            cnn.Close();
        }
        public static void insert_Pago(Pago pago)
        {
            SqlConnection cn  = new SqlConnection(ClasesBase.Properties.Settings.Default.conexion);
            SqlCommand    cmd = new SqlCommand();

            cmd.CommandText = "pago_insertar";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Connection  = cn;

            cmd.Parameters.AddWithValue("@codigo", pago.Cuo_Codigo);
            cmd.Parameters.AddWithValue("@fecha", pago.Pag_Fecha);
            cmd.Parameters.AddWithValue("@importe", pago.Pag_Importe);

            cn.Open();
            cmd.ExecuteNonQuery();
            cn.Close();
        }