示例#1
0
        public void InsertValeConsumo(E_ValeConsumo ObjValeConsumo)
        {
            SqlDatabase  SqlClient = new SqlDatabase(connectionString);
            DbConnection tCnn;

            tCnn = SqlClient.CreateConnection();
            tCnn.Open();
            DbTransaction tran = tCnn.BeginTransaction();

            try
            {
                DbCommand SqlCommand = SqlClient.GetStoredProcCommand("Ventas.Usp_InsertValeConsumo");
                SqlClient.AddInParameter(SqlCommand, "@Numvale", SqlDbType.VarChar, ObjValeConsumo.Numvale);
                SqlClient.AddInParameter(SqlCommand, "@PagoID", SqlDbType.Int, ObjValeConsumo.PagoID);
                SqlClient.AddInParameter(SqlCommand, "@FechaEmision", SqlDbType.SmallDateTime, ObjValeConsumo.FechaEmision);
                SqlClient.AddInParameter(SqlCommand, "@Monto", SqlDbType.Decimal, ObjValeConsumo.Monto);
                SqlClient.AddInParameter(SqlCommand, "@UsuarioID", SqlDbType.Int, ObjValeConsumo.UsuarioID);

                SqlClient.ExecuteNonQuery(SqlCommand, tran);
                SqlCommand.Dispose();

                tran.Commit();
                tCnn.Close();
                tCnn.Dispose();
            }
            catch (Exception ex)
            {
                tran.Rollback();
                throw new Exception(ex.Message);
            }
        }
示例#2
0
        public void InsertValeConsumo(E_ValeConsumo ObjValeConsumo)
        {
            CD_Pago objCD_Pago = new CD_Pago(AppSettings.GetConnectionString);

            objCD_Pago.InsertValeConsumo(ObjValeConsumo);
        }